{tex-core} is for questions that are independent of formats and macro packages. Such questions usually relate to low-level TeX programming or the behaviour of TeX at an underlying level. Note that even Plain TeX is a format in itself; for questions about it, use {plain-tex}.

learn more… | top users | synonyms (1)

3
votes
1answer
55 views

halign and vertical spacings

Here is a somewhat simple \halign usage which show that I'm missing something: \documentclass{article} \begin{document} \halign{&#\cr \noalign{\hrule} \rule{0.4pt}{4cm}& ...
11
votes
2answers
296 views

What is the difference between assigning and \def

What is the syntax difference between these two assignments (basically) \arraycolsep=1mm \def\arraystretch{0.7} What are the fundamental differences of the command \arraycolsep and \arraystretch ...
4
votes
1answer
81 views

Center last line of the paragraph; but I don't like small lines

Attention: This is an advanced TeX problem. I usually dislike lines that are too small, and so I tend to add \parfilskip=2em plus 0.6\textwidth to my documents (apart from small lines, this also ...
3
votes
1answer
55 views

What handles kerning TeX or DviOut

Does TeX process kerning so that sw reading dvi file does not need to do kerning as defined in tfm file but can run with character widhts information from tfm file only. I use TeX not LaTeX. I am ...
7
votes
1answer
391 views

TeX: reasons to start tokens using backslash

I was wondering over the TeX programming language syntax. Is there a known reason why Knuth chose the backslash notation we all love and fear? It seams to me that most other contemporary languages (C, ...
5
votes
2answers
98 views

How to define macros that are executed at begin and end of the page body or text column(s)?

I need a way to insert \special{...} or \pdfliteral{...} commands at the start of the page body and at its end, but before headers and footers are inserted into the box to be shipped out. The ...
1
vote
1answer
65 views

Latex files not compiling due to buffer size

So I have some Latex files with large eps images which cause a buf_size error. When I was compiling the files a few months ago I solved the problem by increasing the buffer size in texmf.cnf. I have ...
19
votes
2answers
1k views

Why do we need \ldots?

While trying to understand Chapter 12 of Knuth's TeXbook about Glueing, I run into troubles in understanding why \ldots ends up in looking better than .... It seems to me that the usual period . has ...
13
votes
3answers
765 views

What is Tex's gullet?

Chapter 7 of The TEXbook famously talks of Tex as having 'eyes', 'mouth' and 'stomach' and goes on to talk of Tex's 'digestive processes' and keeps reusing these terms. Chapter 8 introduces talk of ...
4
votes
2answers
190 views

Are xelatex, pdflatex, … compilers?

I am just asking for the terminology here. I know the technical details of what pdflatex, xelatex and similiar software really is. But how would you describe that? a "compiler"? does it "compile" ...
3
votes
0answers
66 views

Diagrams of TeX Design

In order to understand TeX better, and in order to procrastinate on stuff that is almost certainly more important, I'm slowly working my way through a YouTube series of Knuth explaining TeX82 ...
6
votes
1answer
441 views

Is there a language standard (ISO, ANSI, …) for LaTeX?

Coming from the C/C++ world, I am used to a standardized language. There are differenct standards, such as ISO or ANSI C. Is there a language standard for LaTeX? (Syntax, keywords, ...)
6
votes
2answers
133 views

How to extend existing macro with \edef?

\edef does expansion, but does not execute the commands. How in the following example make so that \foo will do assignment to \tmp at the moment of its call, not when it is defined? Why \foo produces ...
2
votes
1answer
80 views

Distributing a LaTeX2e compiler in .NET application

Is there a way to wrap a LaTeX compiler with a .NET application, so that the wrapper can compile an output .tex file, and visualize the results? Where can I get a compiler (For free, commercial?) ...
4
votes
3answers
125 views

How to make existing \strut-based code work with accented letters?

\strut-based solutions assume that heights cannot exceed 8.5 pt and depth - 3.5 pt. But with accented letters this assumption is not true. In the second example the last line is lower than in the ...
5
votes
1answer
208 views

Empty/blank lines in LaTeX code

I hope this question is in order here although it rather asks for a "best practice" than for some "solution". I am wondering to what extent blank/empty lines in the code (I am using pdflatex) should ...
8
votes
1answer
170 views

Infinite loop in \everypar

Why the following code enters an infinite loop? \everypar={\hrule} a \bye \tracingcommands=1 gives this: {vertical mode: \everypar} {blank space } {the letter a} {horizontal mode: \hrule} {\par} ...
8
votes
1answer
409 views

A “#1#” argument. What is the meaning of the second hash? [duplicate]

In an answer to this question Automatically replace environment align by equation+aligned combination egreg uses \def\relaxtag#1#{\relaxrelaxtag} \def\relaxrelaxtag#1{} The role of the second # is ...
0
votes
0answers
43 views

LaTeX pgfplots - dimension too large

i have problem with drawing graphs... \begin{tikzpicture} \begin{axis}[ xtick=\empty, ytick=\empty, minor tick num=0, anchor=origin, % Align the origins axis lines=middle, ...
3
votes
1answer
205 views

How to set margins and page size in pdfLaTeX without geometry?

What is the TeX equivalent of \usepackage[paperwidth=10cm, paperheight=15cm, margin=0mm, bottom=1mm]{geometry} ? I know nothing in TeX and so far, I am playing ...
2
votes
1answer
71 views

Calculation in a TeX function. How to do it?

I don't know anything of TeX but would like to improve a function. Here is the initial function: \newcommand{\setnewvsize}[1]{% \global\paperheight\dimexpr#1+\initialVerticalInset\relax% ...
4
votes
2answers
142 views

How to place amsmath equations at top of page ignoring \topskip?

I need every amsmath equation to place at the top of the page. So I use \noindent to do that. Everything is fine except equation+split environment. Than formula is placed a bit higher (by ...
5
votes
2answers
78 views

Output Location of Element

Suppose I have a LaTeX document, the entirety of whose content is: $\frac{a+b}{c}$ Now, suppose I want to bounding rectangles for the $a$, $b$, and $c$. Is there a way to DEFINE A FUNCTION "bbox" ...
11
votes
2answers
727 views

How are curly braces used?

In TeX, the same characters (namely, { and }) are used for grouping and to define macros (\def{...}). I think that this is because it can be distinguished from context which one is which. So, ...
7
votes
2answers
112 views

\write and \ifmmode

This is related to a previous question of mine (if I understand correctly, \write works a bit like \edef). Consider the following code: \documentclass[varwidth,convert={size=640}]{standalone} ...
5
votes
1answer
185 views

\edef, \xdef and \ifmmode

I don't understand the difference between \edef and \xdef in the following code. Clearly, the \xdef does what I'm expecting but why? AFAIK, $ does not start a group. ...
3
votes
2answers
53 views

What are the rules for style change in formulas (Plain TeX)?

Both numerator and denominator in the following two formulas are of the same size, namely \textstyle (from which we conclude, that: 1) style change does not affect the digit, which immediately ...
1
vote
1answer
44 views

Weird spaces after \magstepN

Consider example1: hello% world \bye In example2 a space is added between o and w, in comparison with example 1: hello% \magnification\magstep0 world \bye (It seems that space (which appeared ...
14
votes
1answer
383 views

How to write a two-pass system in TeX?

On page 400 of The TeXbook ("Dirty tricks" part) it is said: An output routine can also write notes on a file, based on what occurs in a manuscript. A two-pass system can be devised where TeX ...
4
votes
1answer
62 views

Why depth of \vadjust does not influence interline glue?

Consider the following examples: example1.tex %\input vadjust_hook \def\marginalstar{\strut\vadjust{\kern-\dp\strutbox\specialstar}} \def\specialstar{\vtop to \dp\strutbox{ ...
6
votes
1answer
162 views

How are dimensions converted in multiplication and division?

In the TeXbook it is said (page 118): Multiplication and division are possible too, but only by integers. ... Dimension values are integer multiples of sp (scaled points). Example 1. Result is ...
7
votes
2answers
131 views

Why does the redefinition of \par disable \nopagenumbers?

Let's disable page numbers: \nopagenumbers Hello world. \bye Page numbers appear if we redefine the nearest \par: \begingroup\def\par{\endgraf\endgroup} \nopagenumbers Hello world. \bye If we ...
1
vote
1answer
49 views

How to get last box in vertical mode?

I'm trying to get the contents of a paragraph with \showbox via \vadjust, by overloading \par. I came up with this: \showboxdepth\maxdimen \showboxbreadth\maxdimen \let\oldvadjust\vadjust ...
11
votes
1answer
143 views

Why does \moveleft not contribute to width but \moveright does?

Consider example1: \setbox1=\vbox{ \moveleft 1pt \vbox{\hrule width 4pt height 10pt depth 0pt} \hrule width 4pt height 10pt depth 0pt } \showbox1 The output: \vbox(20.0+0.0)x4.0 ...
9
votes
2answers
1k views

What is a macro, really?

From the list of catcodes, \ starts a new control sequence, { starts a group, and } ends a group. In LaTeX, a macro appears as \foo[opt-arg]{arg1}{arg2} However, TeX does not seem to have the ...
8
votes
4answers
418 views

What's the best practice way to test whether parameter is empty?

I have a macro that might work either in LaTeX or in plain TeX and I'd like to test whether one of its parameters, which presumably should be just text, is empty. Currently I do it this way: \bgroup ...
3
votes
1answer
239 views

How to convert pdflatex to word [duplicate]

I have a tex document with math formula, figure, tikz drawings. What is the best way to convert tex to doc format. I tried with latex2rtf, pandoc, ... but nothing works. Can someone write step ...
6
votes
1answer
128 views

Weird error after \showthe

I'm trying to understand the meaning of \p@ from plain.tex: \newdimen\p@ \p@=1pt % this saves macro space and time While trying to figure it out, I stumbled upon strange behavior. Consider this: ...
5
votes
1answer
79 views

How is a page produced in the output routine?

Compare this \nonstopmode \tracingonline=1 \showboxdepth=\maxdimen \showboxbreadth=\maxdimen \output={\shipout\vbox{ \unvbox255 \showlists }} \nopagenumbers \noindent A \bye and this ...
6
votes
1answer
72 views

Question about exercise 12.17 in TeXbook

This is exercise 12.17 (This is a sequel to exercise 12.2, but it's trickier.) Describe the result of \line{\hfil A puzzle.\hfilneg} This is exercise 12.2 Describe the result of ...
6
votes
1answer
124 views

How to draw borders around page contents

During learning, while conducting different experiments, it's useful to see actual page borders. So I wrote the code which does this and would like to know whether it is the proper way to accomplish ...
0
votes
1answer
69 views

Add notes in the equation under brace [duplicate]

How to write the equation shown in the image
7
votes
1answer
76 views

Question about vertical glue (concerning example from TeXbook)

The question concerns The TeXbook, page 78, 4th dangerous-bend paragraph. For example, let's suppose that \baselineskip=12pt plus 2pt, \lineskip=3pt minus 1pt, and \lineskiplimit=2pt... Suppose ...
12
votes
4answers
283 views

Useful applications of \edef with macro arguments

Well, it's been in my head for some time, but I haven't got anything out of it, so I ask here. At what places could be useful to have \edef\foo#1{..}? What applications could it have? Is it useful at ...
6
votes
3answers
224 views

nested \ifnum commands

I'm trying to make macro to work in biblatex edition field. Logic is following: if edition =1 there is suffix -li (1-li) if edition>1 and if edition<21 there is prefix me- (me-15,me-20 ..etc) if ...
4
votes
1answer
87 views

Question about space factor after \char

The TeXbook page 76: When ligatures are formed, or when a special character is specified via \char, the space factor code is computed from the individual characters that generated the ligature. ...
6
votes
1answer
147 views

Why does \loop behave differently depending on order of its contents?

Just a question out of curiosity. I tested the code below, and first two {\loop...\repeat} commands returned \TeX!\quad six times, and others returned it five times. Why do only first two ...
2
votes
1answer
319 views

How TeX reads what you type

These questions are connected with this answer: Carriage-return and line-feed in web2cTeX Suppose TeX is reading an input file and is at the beginning of new line, in state N. New end-of-line ...
4
votes
1answer
137 views

How is “noindent” different from “parindent0pt + leavevmode”?

Why these two examples produce different results? \parindent=0pt \leavevmode \hbox to 0pt{\hskip -\parindent \bf 8.}% Lorem ipsum dolor sit amet. \bye \noindent \hbox to 0pt{\hskip -\parindent ...
6
votes
1answer
110 views

Why hbox does not start a new paragraph?

These two produce the same result: abc %\null def \bye abc \null def \bye These two are different: abc %\null def \bye abc \null def \bye Does anybody know where this behavior is ...