Tag Info

13

The \tag command allows a *-form, so it can be called as \tag{x} or \tag*{x}. Since the aim is to neutralize \tag we need no fancy \@ifstar definition. The syntax \def\relaxtag#1#{...} means that the argument to \relaxtag is delimited by the first left brace that's found in the input stream. So in the case \relaxtag{...} the argument is empty, in the ...

0

Well, here's one of the uses I was looking for (it's practically the same code I used in the question, but at least it's public and useful code :D) The l3benchmark package, at lines 420–421 has a nice definition of \@@_replicate_kibi_fold:n (@@ is symbolic): \cs_new:Npx \@@_replicate_kibi_fold:n #1 { \prg_replicate:nn {1024} {#1} } As its name ...

0

Correct me if I'm wrong. This answer is probably less correct than those above but possibly more useful. A token is a symbol (character if you like) which has been translated into tex language, but it's still just a symbol. Each character(letter, number, etc..) in a block of text is considered to be a symbol, but an entire control sequence (e.g. ...

1

The difference by example : \documentclass[preview, border=7mm]{standalone} \usepackage{xcolor} \usepackage{blindtext} \begin{document} \textcolor{red}{Line with \texttt{vspace} :} \vspace{1cm} \blindtext \hrulefill \textcolor{red}{Line with \texttt{vskip} :} \vskip 1cm \blindtext \end{document}

2

You just need to use \dimexpr .. \relax where you want inline opertions with dimensions. The more LaTeX-y way would be using \global\setlength\textheight{\dimexpr\paperheight-\bottomMargin} and the mor plain version would be \global\textheight\dimexpr\paperheight-bottomMargin\relax (if you understand the assignment better you can use an equal after ...

3

Here is a solution \documentclass{article} \usepackage{lipsum} \newlength{\bottomMargin} \setlength{\bottomMargin}{1mm} % paper size \setlength{\paperwidth}{10cm} \setlength{\paperheight}{15cm} \setlength{\pdfpagewidth}{\paperwidth} \setlength{\pdfpageheight}{\paperheight} % horizontal dimensions \setlength{\oddsidemargin}{-1in} ...

3

The problem is \noindent \begin{align} you have a paragraph break there. Remove the blank line. The space at the top of the page is not dropped as it is not vertical space it is a one line blank paragraph. With blank line before equation: Without blank line: With the corrected version and the addition of \showoutput \showboxdepth5 The log ...

3

Box dimensions The material of \bbox can be put into a box and the dimensions of the box can be output. However, math mode is especially difficult, because the math style is not known. This can be partially solved by \mathpalette (\mathchoice), where the box is set in all four math styles and TeX then selects the right one. The output must then be done via ...

3

You can try following macros: \newwrite\fbbox \immediate\openout\fbbox=\jobname.box \def\bbox#1#2{#2\def\bboxid{#1}% \ifmmode \mathpalette\bboxM{#2}\else \bboxA{#2}\fi } \def\bboxA#1{\setbox0=\hbox{#1}\pdfsavepos\bboxB} \def\bboxM#1#2{\setbox0=\hbox{$#1#2$}\pdfsavepos\bboxB} \def\bboxB{\edef\tmp{\write\fbbox {\bboxid: (\noexpand\the\pdflastxpos, ...

8

The braces {} (more precisely the chracters with the catcode 1 and 2) have various meanings depending of the context. (1) They begins and ends group when they are use alone. Moreover, in math mode, they creates new Ord atom. (2) They are separators for parameters of macros (and they are removed from the boundary of the parameter). For example ...

11

Primitives that, according to the syntax rules, should be followed by <general text> have a very peculiar behavior: they expand the next token (if expandable) in order to find tokens that qualify as <filler> and, eventually, the left brace that delimits the <balanced text>. More precisely, this happens whenever the syntax rule allows a ...

7

Some variations. The fun of \expandafter: \documentclass[varwidth,convert={size=640}]{standalone} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{fancyvrb} \begin{document} \newwrite\foo \immediate\openout\foo=foo.txt $\immediate\expandafter\write\expandafter\foo\expandafter{% \ifmmode\noexpand\true\else\noexpand\false\fi}$ ...

8

Inside a \write, TeX is in 'no mode', not in hmode, math mode, etc. Thus you have to move the test outside of the \write $\ifmmode \immediate\write\foo{\string\true}% \else \immediate\write\foo{\string\false}% \fi}$

5

a math list forms a group so the first \edef definition is discarded and \meaning shows the original definition. The definition with \xdef is the same, but is visible outside the group closed by the trailing \$.

5

The font size for \displaystyle and \textstyle is the same. Therefore, a difference between the two formulas cannot be seen, if the material consists of digits only. $$2\atop8$$ $$\displaystyle2\atop8$$ But if the sum with limits is used, then the position of the limits differ dependent on the style: $$\sum_0^\infty$$ $$\textstyle \sum_0^\infty$$ ...

2

In fact \displaystyle, \textstyle, \scriptstyle and \scriptscriptstyle will be applied from the point on where they got invoked til the end of the formula or subformula. In your first example \displaystyle gets selected by default, not \textstyle (where in this case the distinction does not make any difference as only digits get typeset, which are identical ...

6

\magstep is a macro, which takes one argument. Thus \magstep0 or \magstep{0} uses 0 as argument. A space afterwards remains, because it is not touched by \magstep0 at all. There is an implicit kern between ow. They are moved a little together. Example 3 breaks this implicit kerning, because it inserts unexpandable stuff (assignment of \magnification) ...

1

The question has two relatively independent aspects: 1. how to organize gracefully a long list of \ifnum.. clauses, 2. how to automatize over a list. I won't delve much about the second part here, illustrated in the code below by the handling of 300, 400, .., 1000 via \xintApplyUnbraced from package xinttools. This is expandable. And the Test itself ...

11

You can use \pfdsavepos for measuring the depth of the previous line while using \vadjust. But this is not classical TeX, this is from pdfTeX extension: This is the line in the paragraph% \pdfsavepos\write16{\the\pdflastypos}% \vadjust{\pdfsavepos\write16{\the\pdflastypos}} this continues the line in the paragraph, this continues the line in the paragraph. ...

6

You can create vertical material from \vadjust{parameter} by macro expansion in its parameter. But this is processed immediately in horizontal mode and macro programmer is unable to measure the depth of the previous line because such line doesn't exist at this time. And the result of \vadjust is a fixed vertical list which cannot be modified later after ...

6

The difference isn't actually \moveleft v \moveright as \moveright -1pt acts like \moveleft 1pt and \moveleft -1pt acts like \moveright 1pt including the width of the outer box. As noted in the updated question the TeXBook documents this as The width of a computed \vbox is the maximum distance by which an enclosed box extends to the right of the ...

5

TeX is a macro expansion language; this means that it will use the current meaning of a macro and the current value of a variable when doing expansion and executing commands. The meaning of \nopagenumbers is \footline{\hfil}; \footline is a token register, defined with \newtoks, so when \nopagenumbers is expanded, a local assignment to \footline is ...

10

There is a convention that even register (except count) numbers smaller than ten are free registers for local assignments, whereas odd numbers should only be used for global assignments. Mixing local and global assignments can cause memory trouble. Therefore I have multiplied the register numbers by two to get register numbers for local assignments. The ...

10

The \nopagenumbers is only active for the current group, which is ended at the end of the current paragraph. But the page is shipped out afterwards, so page numbering is again active. If you do the same thing in a paragraph which breaks over a page, you will get no page number on the page on which the paragraph begins: As any dedicated reader can clearly ...

Top 50 recent answers are included