Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [output-routine]

{output-routine} is a basic element of TeX processing which is automatically called at different occasions (e.g., at insertions like footnotes or floats) and finally makes up the contents of a page for shipout after a page break has occurred. Headers and footers as well as floats, margin paragraphs ...

3
votes
2answers
79 views

Reliably detect space left on the last page

I would like to reliably detect how much space is left on the last page of the document. Preferably, this should be accessible in a \AtEndDocument or similar hook, so that I can write this information ...
0
votes
1answer
38 views

Go back to “mark” in LaTeX to update something

Say you have some command in a part of the code. I want to execute that command at a later point, so that it can be set at a later point. E.g. a header, and you want to set the margin after some other ...
2
votes
1answer
51 views

Why does \openout produce output in plain tex when it does not in latex?

This is a follow up question of this question. Why this plain code (from shreevatsar's answer) \newwrite\outfile \openout\outfile\jobname.out \end produce a page but this (equivalent) latex code ...
3
votes
1answer
44 views

Table of contents with headings on every page when last page of TOC has a single item

Similar questions have been asked—and answered—a number of times (e.g. here, here, and here), but all the answers seem to have the following bug: if the final page of the table of contents ...
0
votes
1answer
111 views

Page height is greater than `\textheight`

Sometimes, when a page is ended with a formula, it goes below the desired page border. For example, the following code \documentclass{article} \usepackage[showframe, textwidth=4cm, ...
0
votes
0answers
43 views

Repeat a diagram at the top of the next odd-numbered page

I would like to build a LaTeX environment that could include a diagram to be rendered at full size, followed by a subsequent discussion of said diagram. What I would really like to do here is have ...
1
vote
1answer
74 views

Interrupt Document with Ancillary Material

Suppose I want to create an in-class text. Suppose further that as a lecturer I want my copy of the text to have copious amounts of ancillary material (notes, solutions to exercises, blackboard ...
1
vote
0answers
52 views

How to fix this (un)expected result from atbegshi

Please how to fix this? \documentclass{article} \usepackage{lipsum} \usepackage{atbegshi} \begin{document} \section{Foo 1} \lipsum[1-2] \section{Foo 2} \lipsum[1-2] \section{Foo 3} \...
7
votes
2answers
153 views

Prevent \topinsert on chapter page (Plain TeX)

How to define chapter to prevent insertion of floating figures and tables (\topinsert) on chapter page. I would like to place an object at the top of the next page. \def\chap#1{\vfil\break \vglue1cm ...
2
votes
1answer
62 views

Does LuaTeX change the message in “Output Routines Part IV: Horizontal Techniques”?

In the excellent article "Output routines: examples and techniques Part IV: Horizontal techniques", David Salomon explores three techniques for dealing with communication from horizontal mode to the ...
10
votes
1answer
198 views

Rearranging blocks (poetry) in OTR (Plain TeX)

I have a problem that I think would best be solved by an output routine. It seems like an act of moderate TeX wizardry so before I get stuck in the weeds on a wrong approach I thought I would describe ...
5
votes
1answer
118 views

Test inside output routine

in order to provides new feature in eledpar, I would like to output somes notes only on odd page. I have a problem, as you could see with the following MWE I have modified the output routine to add a ...
2
votes
2answers
134 views

Figure content does not appear on even pages after introducing changes to the output routine

In a document with wide margins, I want to offer a figure environment which extends into the marginpar-area. Furthermore, I want the caption-text to be placed in this area, too, either above or below ...
5
votes
2answers
232 views

Long footnote, newpage and output

In order to solve an issue in eledpar (letting long/many footnotes 'flow' over two pages (eledpar)), I need some help with the relation between insert, ouput and \newpage. Let the (real) MWE :...
2
votes
0answers
97 views

Can TeX produce an expanded TeX as an output format similar to PDF? [duplicate]

I am looking at TeX as an output format similar to PDF that describes the page sufficiently, but with all tokens resolved (more like going from Postscript to PDF). This format should also indicate all ...
5
votes
2answers
341 views

Typesetting Devanagari-manuscript-style “Pothi”/“Patravali” books

First of all, I am quite new to TeX - so practically a newbie. I am trying to typeset Devanagari books in the traditional "Pothi" format, which looks pretty much like the manuscript illustrated below. ...
5
votes
1answer
116 views

What happens to fonts (and robust commands) in shipout?

The following example does not produce quite the output I expect: \documentclass{article} \let\origshipout\shipout \def\shipout{\origshipout\vbox{ %\normalsize \emph{hello}}\origshipout} \begin{...
4
votes
1answer
86 views

polyglossia + output routine = wrong expansion in file writing (???)

If I use the following custom class: \NeedsTeXFormat{LaTeX2e} \ProvidesClass{upecha}[2014/09/21 v0.8 tibetan modern pecha class] \input{size11.clo} \def\@outputpage{\shipout\vbox{\box\@outputbox}} ...
28
votes
2answers
10k views

Is there a way to get at the value of \prevdepth from the main vertical list inside the output routine?

To motivate that (admittedly) strange question: When TeX builds a vertical list it keeps track of the depth of the last box added in a special variable called \prevdepth which is used to calculate ...
18
votes
2answers
2k views

All about \shipout

While reading about packages that allow to hook macros to certain events, I came across this command, \shipout. Searching on the internet didn't help a lot but if I'm not so wrong it's somehow related ...
8
votes
1answer
569 views

Execute a command at the start of every page

Is there any way I can execute a command (\ifthenelse actually) at the start of every page? I tried \AtBeginShipout (atbegshi) but that seem to get executed when the page is about to be rendered (...
3
votes
1answer
124 views

Penalty inserted by output routine

I am using plain TeX (actually plain e-TeX) processed by a relatively recent version of MiKTeX (pdfTeX). Consider the following fragment of code that can be processed with plain TeX: \noindent A\par ...
7
votes
0answers
167 views

Replace paragraphs with boxes [closed]

I would like to replace the paragraphs of a compiled document with framed boxes. Although I read the /tex/latex/base documentations I have no idea how to tackle this problem. In detail I want to ...
1
vote
0answers
35 views

headlines are not shown with tikz input (plain TeX) [duplicate]

I'm usign plain TeX with custom headlines. If I load Tikz packages with \input tikz then headlines are blank. The following are my headlines (some commands don't belong to plain TeX, but I think ...
20
votes
3answers
602 views

Strange behaviour with PGF/TikZ and Plain TeX output routine

I noticed a strange behavior when running PGF/tikZ with pdfTeX on my Debian box : a simple session without tikz: pdftex **\relax *Hello World *\bye do output the page number on the page footer. On ...
9
votes
1answer
515 views

Shipout line like Shipout page

In lineno package guide, I found: Attaching line numbers after TeX has broken the paragraph into lines is already quite a difficult job for TeX. Why? Because TeX does not normally give you any ...
18
votes
1answer
695 views

Flushbottom columns when \parskip has no stretchable glue

In the following example, the columns on page 1 and 3 "sit" perfectly on the frame, while on page 2 (with the large float) the columns end a bit above the frame. Does anyone have an idea what I could ...
5
votes
1answer
291 views

Outputting a spread at a time

I think I remember Stephan Lehmke writing here somewhere in a comment about outputting a spread at a time instead of page. That got me thinking; does that mean something like: \output={\shipout\vbox ...
8
votes
2answers
2k views

Output routine and \box255

The \box255 referred to in this question applies only to the container of the latest chunk of the MVL, as cut by the page builder. Now the question: I read somewhere that \setbox0=\vbox to \vsize{\...
22
votes
2answers
1k views

What is \box255?

I'm just reading the everyshi manual, and it says: This package provides the hooks \EveryShipout and \AtNextShipout whose arguments are executed after the output routine has constructed \...
11
votes
2answers
232 views

Can I detect whether a footnote has been split?

Title sez it all: Can I detect, hopefully by inspecting \box\footins, whether a footnote has been split at page-breaking? I found the package fnbreak but it uses labels, which is much too delayed for ...
13
votes
2answers
207 views

Can I get at stuff in “current page” or “recent contributions”?

When I compile the following, \documentclass[a4paper]{article} \usepackage{atbegshi} \AtBeginShipout{\showlists} \showboxdepth\maxdimen \showboxbreadth\maxdimen \usepackage{lipsum} \newcommand\...
2
votes
1answer
2k views

How to use ltxgrid to switch between one and two columns

After reading answers to this question, I decided to give ltxgrid a try. A simple experiment showed that using \twocolumngrid and \onecolumngrid do their job; however, the vertical space between one- ...
2
votes
1answer
316 views

Which memoir package emulation clashes with footbib?

memoir has at least one package that modifies the output routine and conflicts with footbib, does anyone know which one(s)?
13
votes
2answers
1k views

Background baseline grid with output routine

I am trying to get a baseline grid in the background of every page. I am using the plain format with XeTeX. This is what I have tried: \baselineskip=13pt \topskip=0pt \parskip=0pt \newbox\gridbox \...
15
votes
3answers
835 views

Unbalanced output routine

The TeX primitive \output behaves almost like a toks register, except in the fact that it is always surrounded by braces. For instance, after \output={\plainoutput}, the result of \showthe\output is {\...
3
votes
1answer
244 views

Can I write a macro for placing a vertical, breakable rule along arbitrary paragraphs without an output routine?

I answered a question last week about creating a continuous but breakable rule next to an arbitrary number of paragraphs in Plain TeX. My solution gathered the paragraphs to rule in a vbox; my output ...
10
votes
1answer
138 views

Why does the list of recent contributions contain exactly two boxes?

In the transcript of \nonstopmode \tenrm \vsize=2cm \output={\shipout\vbox{ \showlists \unvbox255 }} \hbox{blah} \hbox{blah} \hbox{blah} \hbox{blah} \hbox{blah} \hbox{blah} \hbox{blah} \hbox{...
11
votes
2answers
414 views

Can I make some vertical material disappear if it occurs next to a page break?

I'd like to place a horizontal rule above each section title, to separate the new section from the text before it. But I don't want the rule to appear if the section begins on a new page, since that ...
52
votes
3answers
2k views

Notes overflowing from marginpar to footer

In this document, from page 12 and following, the notes from the marginpar are overflowing in the footer of each page. How can this be achieved in LaTeX? ConTeXT/LuaTeX based solutions are welcome, ...
17
votes
2answers
9k views

Installing background and foreground page layers with TikZ

Several times I discovered the need to draw TikZ material behind and on top of the page text (How to draw text-anchored tikz line below text instead of above?, Test if a paragraph has a page break in ...
50
votes
1answer
2k views

An explanation of LaTeX's output routine

Is there a good reference for LaTeX's output routine? The documented source is confused and confusing. The authors seem confused as to why parts are the way they are and wonder if maybe things should ...