Tag Info

20

The spacefactor (\sfcode) does not add any space after the . it just increases the space that a space token after a . produces so in This is the end. A new sentence the end of sentence space will be a bit bigger and allowed to stretch more if the sfcode of . is not 1000. If you go ... there are no space tokens between the dots so the space factor code ...

17

One obvious reason is that you are typesetting general text, so keywords such as "if" appearing in the text would need to be escaped. The operative word being "escape", for which the backslash is common.

14

The terminology isn't that useful really but as far as I can make out. The mouth is where tokens get recognised so abc becomes three character tokens, and \abc becomes one control token Unexpandable tokens are handled in the stomach so the gullet is basically the expansion process. The texbook only uses gullet twice, and tex.web not at all expandable ...

12

I don't think that the comparison TeX with a living being having eyes, mouth, stomach and bowels should be taken so seriously as to find an analogy with other body parts. I like better the description Victor Eijkhout makes in “TeX by Topic” of TeX as operating on four levels (see pages 21 and 22): The four levels are (corresponding roughly to the ...

10

\arraycolsep is a dimension register, i.e. holding 'lengths' and can be assigned with = The symbolic name is used instead of remembering \dim... register names. \arraystretch is a macro, which must be redefined and can hold any value, but it would be rejected at the point of expansion. You can't say \arraystretch=... however. The = syntax is restricted to ...

7

The key typographic difference between ... and \ldots is not anything to do with the width of a subsequent space. \ldots puts more spacing in between the dots. Observe: x...x\par x\dots x\par \bye renders as (note: in plain TeX \ldots is math-only, you have to use \dots in text mode.)

6

At the beginning of the source code for TeX, Knuth calls TeX a "document compiler". But in The Art of Computer Programming, vol. 1, Knuth says that the TeX program is an interpreter for the TeX language, which produces output in DVI format, which can in turn be converted to PostScript, another interpreted language. I will have to let someone with ...

5

The question is not very clear but certainly {} does not expand to nothing and typically will affect spacing. Compare one two and one {} two Plain TeX and LaTeX do have a command \empty defined (effectively) as \def\empty{} which does expand to nothing so you could use \empty, but it would seem better to fix the configuration in the editor rather ...

5

For example like this: \let\oriship=\shipout \def\shipout{\afterassignment\shipA\setbox0=} \def\shipA{\aftergroup\shipB} \def\shipB{\oriship\vbox{\preship\box0\postship}} \def\preship{\pdfliteral{q 1 0 0 rg}} \def\postship{\pdfliteral{Q}}

5

Quoting from TeX For The Impatient, page 16, emphasis added: The eyes transform an input file into a sequence of characters. The mouth transforms the sequence of characters into a sequence of tokens, where each token is either a single character or a control sequence. The gullet expands the tokens into a sequence of primitive commands, which are ...

5

Yes by the time it gets to the dvi file user or font specified kerns come to the same thing, so you should only need the advance widths from the font metrics. In your example t h is incorrectly set in math italic font, which by design has wide side bearings to keep adjacent letters from looking like a word, as juxtaposition is assumed to be multiplication, ...

4

The \@outputpage routine and the \@outputbox seem to be the right hooks in order to implement actions at start and end of the page body without affecting headers and footers. As an example we overwrite \@outputpage to change the text colour in a cyclic way between red, green and blue for every new page by inserting two \pdfliteral around the original ...

4

buff_size is used as the input line buffer for tex sources and also the buffer that is used for macro expansion. So the only place that I think it is used for graphics inclusion is looking for the bounding box. If you look in the file you should see a comment of the form %%BoundingBox: 19 19 221 221 presumably with a line of >2000000 characters before ...

4

You can use this with pdflatex --shell-escape \documentclass{article} \usepackage{graphicx} \def\hideemail#1#2{% \IfFileExists{#1.png}{}% {\immediate\write18{% echo '\detokenize{\setbox0\hbox{\strut #2}\hoffset-1in\voffset-1in\pdfpageheight\baselineskip \pdfpagewidth\wd0\shipout\box0\bye'|pdftex;convert -density 600 texput.pdf #1.png}}}% \box0{#2}% ...

3

Per @phg's suggestion, I'll post this answer on his behalf: if running a posix compliant system, try rlwrap tex; that indeed keeps record of keys typed on TeX's command line without linking it to readline. Your (pdf)latex is very likely simply a symlink to the pdftex interpreter, which is actually what runs under the hood. Having that in mind, from @phg's ...

3

Using the test release of luatex 0.85 I get from \tracingoutput1 \tracingonline1 \showboxdepth1000 \showboxbreadth1000 abc\begingroup\hyphenpenalty -10001\discretionary{d}{e}{f}\endgroup ghi\begingroup\hyphenpenalty 10001\discretionary{d}{e}{f}\endgroup \bye and a log Completed box being shipped out [1] \vbox(667.20255+0.0)x469.75499, direction TLT ...

3

You can traverse the linked list of lua nodes that make up a TeX box. texdoc luatex should show you the manual, there are several examples on this site as noted in comments for example PDF page references in TeX4ht generated html?

3

touhami's suggestion in the comments made me find an answer for this admittedly niche problem. The solution is to construct the paragraph as if it was being normally typeset and then handle the positioning of the last paragraph manually. Here's how it goes: \textbf{CENTRED / NOT SMALL}\par { % Typeset as we did previously for the "regular / not small" ...

2

TeX has no data type for decimal numbers. It can only use them in connection with lengths, but they actually represent an integer in (implicit) unit sp (where 1pt=65536sp). One could think to store \arraystretch or \baselinestretch as dimensions, but this would cause difficulties when they are to be used: when, for instance, \fontsize{10}{12}\selecfont is ...

1

To add to existing answers, Knuth made a comment in his parody "An Earthshaking Announcement" talk, in TUG 2010 Conference indicating the peculiarity of this name: Examples of my tunnel vision abound, on almost every page of The TEXbook. For example, I used backslashes and other strange characters to define what I called “control sequences”. Does any ...

1

Assuming that you can use components with open source licences I would use luatex (or xetex+xdvipdfmx) and generate tex files using system fonts via the fontspec and unicode-math packages. That way you only need a very minimal tex distribution, with no fonts as you can use system fonts (eg assuming you are only using .NET on windows, not the linux/mono ...

1

To be precise, I think xelatex and pdflatex may be better described as front-end programs running the LaTeX document preparation system (a set of TeX macros) on top of the xetex and pdftex document compilers.

Only top voted, non community-wiki answers of a minimum length are eligible