{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)

68
votes
3answers
110k views

Escape character in LaTeX

I need to output the below text but since \ is a special character, I cannot: [RegularExpression(@"\d+")] Also sometimes I need use dollar sign $ as well but it seems to be a special char, too. ...
15
votes
3answers
806 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 ...
5
votes
1answer
45 views

Is 1238pt = 1157dd an exact definition for the Didot point in Tex?

After having read the answers to What are the various units (ex, em, in, pt, bp, dd, pc) expressed in mm? and some related questions, I’ve realized that one of my basic assumptions about Tex was wrong:...
34
votes
2answers
771 views

What is truecm?

In examples found around the web, some people specify lengths such as width=5truecm with \includegraphics or the geometry package. How is this different from regular 5cm?
6
votes
2answers
78 views

Where to find the tex web output documenting the original tex implementation in pascal

I recently read a blog post on literate programming and that tex was written using this paradigm. So I thought it might be a good idea to read the original tex program's source, by Knuth himself (the ...
5
votes
2answers
61 views

How do I perform an expandable string comparison?

I need to perform a string comparison (string equality). If the macro is non-expandable (e.g. contains \def or \let), it causes problems in the place where it is used. I tried using \ifthenelse from ...
10
votes
2answers
430 views

How is \catcode handled?

\centerline is the same as \line{\hss#1\hss} Then why in the next example in the \line case the space is visible, and in \centerline case it is not? In both cases space has correct catcode 12. \...
5
votes
1answer
103 views

Examples of table of contents in pure TeX

I'd like to try to create a document structure and table of contents in pure TeX. Does anyone know of any resources or examples to do this? My purpose is mainly educational, to learn how to write ...
1
vote
0answers
30 views

How do I avoid pdflatex error in TexMaker? [closed]

I'm new to TeX. I've downloaded TexMaker and trying to run "Quick Build" after simple code written. But I get that pdflatex-related error. Since my settings in "Options" -> "Configure Texmaker" -> "...
3
votes
1answer
149 views

How declare a new package language

I need writing normal text and some sentences in artifical conscript language. How writing small as possible package and how use it (include?) in file? My language have my own font and each glyphs is ...
4
votes
0answers
36 views

Release space in the string pool

I managed to get a capacity exceeded message by adding a bit too many named coordinates to a number of tikzpictures and so started to test and now wonder if it is possible to release unneeded space in ...
12
votes
3answers
322 views

Why does \boxN clear the box?

I understand that w.l.o.g. \box0 puts the content of box 0 and clears the content of box 0, while \copy0 puts the content of box 0 and does not change the content of box 0 at all. Whenever I do \...
10
votes
4answers
446 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 \...
81
votes
5answers
39k views

How to expand TeX's “main memory size”? (pgfplots memory overload)

I'm compiling one pretty simple LaTeX file with few dozen of pgfplots. Now, I can compile part by part, but am unable to compile it all at once. I really need good precision for all those plots (noise ...
19
votes
2answers
433 views

When is \relax necessary after a \ifcase#1 statement

In the LaTeX kernel (latex.ltx) we see some examples of \ifcase#1\or a\or b\or ... (an \ifcase without an added \relax), but when we look at some packages most of them add this statement after the \...
13
votes
3answers
233 views

Accessing TeX token or exporting filtered plain text

(updated according to gained information) In the context of keyword extraction from arbitrary (La)TeX documents and simple manipulations with them (automated annotation), I would like to be able to ...
2
votes
1answer
69 views

Circuitikz Inverter Open Collector Symbol

I'm looking for the symbol of the Open Collector Inverter in Circuitikz, but I can't find it. Anyone knows how to do it?
16
votes
3answers
583 views

The "^'' glyph in the TeXBook

TeX, plain TeX, within the source of the Texbook of Don Knuth, there is use of ^ in different command sequences, and in text bites. Is there a special meaning to ^ in TeX primitives, in plain TeX, ...
7
votes
1answer
78 views

Macro overloading, catcode redefining… or how can I parse XML with TeX?

Given this code that barely parse XML and print it as SXML (s-exp XML, aka lisp-style XML, aka XML-with-parenthesis): \catcode`@=11 \let\@xp\expandafter \def\@makeletter#1#2\@nil{\catcode`#1 \ifx\...
16
votes
1answer
623 views

What is the programming term for the command invoking '\' in latex?

I don't think it would be called a delimiter. Is there a specific term for this character? Just to clarify, I'm talking the slash here: \frac{1}{2}
5
votes
2answers
82 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 ...
24
votes
2answers
1k views

Why can't caret and tilde be escaped with backslash alone?

I can escape some special characters with a backslash. \documentclass{article} \begin{document} \# \$ \% \& \_ \{ \} \end{document} But why can't I escape ^ and ~ with a backslash alone? For ...
2
votes
1answer
32 views

Forcing $ unescaped to error, not use math-mode

I am copying and pasting paragraphs into a LaTeX document from a report that contains frequent $ signs. I would like any unescaped $ to result in an error and perhaps a reminder to escape them. (Math ...
2
votes
0answers
90 views

Can I Use LaTeX to Convert UK to US Spellings? [closed]

I have written a paper using LaTeX. My supervisor wishes to use US English for our paper to submit to an American journal. However, I'm based in New Zealand and have written the entire paper in LaTeX ...
3
votes
1answer
36 views

Use temporary length \dimen255, temporary count \count255

This Question is mainly important for package writing: I read in the TeX-Book that \count255 and \dimen255 are traditionally used for temporary. Now the number of registers has risen (see this ...
7
votes
1answer
132 views

What are the limited resources in LaTeX/TeX?

I heard, that some resources (or maybe all) are limited. The number of lengths seems to be limited to 2^8 (1 byte). Are there any other limited resources and if yes, which are these or where can this ...
50
votes
1answer
1k views

What are the incompatibilities of pdftex, xetex and luatex?

[Please correct me if my statements are wrong] TL;DR: pdftex, xetex and luatex exhibit different behaviour. What are these differences and why are they present. I know of three engines, which ...
0
votes
0answers
9 views

pdfTeX warning (ext4): destination with the same identifier (name{choice.1}) has been already used, duplicate ignored [duplicate]

when compiling the following document: \documentclass[11pt]{exam} \usepackage{amsmath,amsbsy,amssymb,amsthm,cases,blkarray,mathrsfs,amsrefs,amsfonts,latexsym} \usepackage{enumerate,enumitem,textcomp,...
4
votes
2answers
143 views

\iftrue in \let “swallowing” the following \fi

I already searched for comparable questions, but found none with this problem. I have the following LaTeX formatting section to define inline and multiline comments that can be "in-commented" at one ...
0
votes
0answers
15 views

How to draw lines in matrix? [duplicate]

Can you help me to draw a some lines in matrix? I attached it in image : Thank you!
7
votes
6answers
390 views

Explode arguments in argument list

What does TeX do, when reading an argument? I wanted to write a command that has a comma separated list of arguments (\fun[a@b,c@d,e@f,g,]). Each argument should be exploded in two parts at the ...
14
votes
2answers
181 views

Unicode math at TeX primitive level

I am looking for information how to implement Math OTF font in XeTeX or LuaTeX at TeX primitive level (using XeTeX or LuaTeX primitives). There exist a LaTeX package unicode-math. Unfortunatelly, this ...
9
votes
2answers
53 views

Does \end command issue a \vfill

Does \end command issue a \vfill command? I notice that in plain TeX, you have a \bye that issues it but after some experimentation I think \end also issues a \vfill, which is rather confusing. ...
4
votes
5answers
29k views

Error Latex TeX capacity exceeded, sorry [input stack size=5000]

I want to test this template http://students.engr.scu.edu/~sschaeck/latexforthesis/. when i run the makefile i get this error .Please what does it mean this error here the code : \documentclass[...
72
votes
2answers
5k views

The differences between TeX engines

I am confused about what TeX and its offspring (LaTeX, pdfTeX/pdfLaTeX, e-TeX, ConTeXt, LuaTeX, etc.) are. Some, like LaTeX, seem like add ons to TeX (maybe a change to the eyes and mouth, but not ...
5
votes
1answer
261 views

How does including graphics in TeX work?

How does I include an image (e.g. an eps) in plain TeX without using a package that does so for me? All other questions (like this one) don't actually answer the question how you include an image in ...
132
votes
3answers
25k views

What is the difference between \let and \def?

What is the difference between the \let and \def commands in TeX/LaTeX? Ideally please provide a simple example that will illustrate the difference between them.
6
votes
2answers
105 views

Can two \vtop boxes exist side by side?

So I am trying to see if I can put two \vtop boxes side by side. The below is the closest I have gotten. This is a kind of a "plain-tex in latex" example. \documentclass[fontsize=13pt,letterpaper,]{...
7
votes
2answers
78 views

How does TeX break paragraphs into lines when there is only two element in a pararaph?

Suppose we have the following code: \def\tp#1#2{#1\hskip 300cm minus 300cm\hbox{#2}} \tp{Hello}{World it is} and \def\tp#1#2{#1\hskip 300cm \hbox{#2}} \tp{Hello}{World it is} The first one gives ...
5
votes
2answers
243 views

When does TeX choose to stretch the glue?

Suppose I type \hbox to \hsize{abc} \hbox{abc} \bye Now, since the first \hbox is set at \hsize, I am expecting the abc to be glued with maximum stretched glue. In the second \hbox, I expect abc ...
6
votes
1answer
88 views

The difference between `\the\numexpr` and `\number\numexpr`

I wonder if there is any functional difference between \the\numexpr and \number\numexpr. Some obscure context where they would yield different results? (I'm obviously aware that \the and \number ...
4
votes
1answer
31 views

How to use control symbols using \expandafter?

Suppose I want to typset P\' olya correctly in TeX but suppose my computer does not have the key invoking the character/symbol ' (This is of purely theoretical interest). Now, TeX lets you use \rq to ...
2
votes
0answers
59 views

How to define LaTeX like environment in plain TeX?

How do I define LaTeX like environment using TeX primitives? I have just started learning TeX using Knuth's TeX book and found it hard to implement the LaTeX like environment using TeX primitives. An ...
20
votes
0answers
186 views

Is there a reliable way to get the number of arguments of a command?

While pondering over a test to distinguish two versions of a command I came up with the following example: \documentclass{article} \begin{document} \def\testA#1{\#2->blabla} \typeout{\meaning\...
5
votes
0answers
68 views

LuaTeX tex->dvi conversion code

I'm researching ways to teach computers to generate LaTeX code from Page Description Languages (PDL) like PostScript and PDF, using Machine Translation. For this to work, it would be majorly useful ...
19
votes
2answers
8k views

\llap (or \rlap) at the beginning of an indented paragraph

If I use a \llap{text} command at the beginning of an indented paragraph, the text is not indented and is put on the line above the paragraph. \documentclass{article} \begin{document} \parindent=2cm ...
20
votes
3answers
236 views

Why is a discardable item not discardable?

I have the following code \output={\plainoutput \message{outputpenalty=\the\outputpenalty}} % for debugging \hrule \vskip21.9cm plus1pt % plus1pt because to avoid underfull vbox until output one ...
7
votes
2answers
1k views

Why is the \bye command not used by LaTeX?

Is there a technical reason why the \bye TeX command was replaced in LaTeX by \begin{document} and \end{document}? I suspect there must be a good technical reason behind this, as otherwise it would ...
9
votes
5answers
10k views

Writing Roman numbers in Equation

What is the command for writing roman numerals like I, II, IV etc. in an equation ? To be noted that my requirement is to write them within $$ ...$$ and not as counters or page numbers. Any light on ...
0
votes
0answers
9 views

Compiling a latex file .tex to a PDF File [closed]

I've downloaded a file from this link But i don't know anything about .tex extensions, i've googled it, it turned out to be a latex file. So I've downloaded & installed MacTex, but it doesn't ...