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

10
votes
2answers
89 views

Is it possible to define a dotted version of `\vrule`?

The \vrule primitive has a nice charcateristic: it has the ability of adapting itself to the height and depth of the enclosing box: \documentclass{article} ...
8
votes
2answers
710 views

debug No room for a new \write problem

I have a template with an extensive documentation. (See TemplateDocumentation.pdf). It compiled several month ago. Now with updated packages it does not compile anymore because of the famous No room ...
4
votes
1answer
28 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 ...
4
votes
0answers
59 views

How can I retrieve the number of currently defined macros?

The following will max-out TeX's memory: % arara: pdftex \nonstopmode \input expl3-generic \relax \ExplSyntaxOn \int_zero:N \l_tmpa_int \int_while_do:nn { \l_tmpa_int < 490000 } { ...
50
votes
5answers
7k views

Shortest code causing “Emergency stop.” error

This question is purely academic. TeXing a file containing \valign{\halign#\cr! causes an ! Emergency stop. error. Is that the shortest code which produces a fatal error in TeX?
1
vote
0answers
51 views

Is there an alternative to {} that also expands to nothing?

I have a weird bug in my text editor that causes it to incorrectly indent any lines that start with special characters, such as greek letters. % My editor will indent the leading spaces in this line ...
0
votes
1answer
58 views

Where can I get a LaTeX command explanation? [duplicate]

For example, I do not know the definition of the LaTeX command \ensuremath. Where can I get its accurate meaning? Is there one professional website to offer some information about this?
9
votes
1answer
118 views

Where do arguments of \kern, \hskip etc. end?

In TeX, code like I\kern37ptlike\hskip100ptcake works perfectly well. That makes me wonder how exactly the syntax of primitive commands like \kern, \hskip etc. work? How does TeX determine where their ...
1
vote
0answers
27 views

Is there any organised way by which new LaTeX learners can benefit from previous questions? [migrated]

I am a new LaTeX learner, with what I have read and heard about it, I know its going to be a great tool for researchers in time saving and more, I have also discover that TeX, stack-exchange etc. has ...
3
votes
1answer
40 views

Where can I find documentation on what “\char” does?

I've seen samples of TeX using \char`\\ to produce a literal backslash. Where can I find documentation on what the \char command does? Is it a generic construct to safely produce reserved literals? ...
13
votes
0answers
149 views

What type of Chomsky hierarchy is TeX? [duplicate]

There are four types of chomsky hierarchy (specified for formal languages): Type-0 Recursively enumerable Type-1 Context-sensitive Type-2 Context-free Type-3 Regular I consider that, it should ...
50
votes
5answers
1k views

\let\foo\bar vs \let\foo=\bar

Both uses of the \let primitive often lead to the same result. Is this even true for every case? What was the thought process behind it. And if they are actually not equivalent, are there particular ...
4
votes
1answer
65 views

How to expand control sequence in argument of a macro

Consider the following: \def\foo#1#2 {% \if#1a% \message{#2} \fi} \def\x{abc} \edef\y{\foo\x} \y The result: ! Argument of \foo has an extra }. The expected result: bc
5
votes
1answer
53 views

Equivalent Leaders construction

What is the equivalent construction of \leaders\hrule height 1pt depth 1 pt\hskip 20pt \relax in terms of the following construction or something similar \leaders\hbox{\vrule height 1pt depth ...
2
votes
0answers
30 views

Listings - Getting the colors right for custom language

I have lots of bookkeeping transactions that I would like to typeset in a color coded format. I am using the listings package to accomplish what I want. I tried the following code. ...
26
votes
1answer
301 views

Exercise 17.21 of Knuth’s TeXbook: a (known) error?

Exercise 17.21 of The TeXbook asks a question concerning \delcode: Appendix B defines \delcode‘< so that there is a shorthand notation for angle brackets. Why do you think Appendix B doesn’t ...
27
votes
3answers
496 views

How to define phantoms for depth and height?

In the third "dangerous bend" on page 178 of of The TeXbook there's the following description of \vphantom: Even more useful than \phantom is \vphantom, which makes an invisible box whose height ...
2
votes
1answer
73 views

How do LaTeX macros interact with the TeX engine? [duplicate]

From wiki on LaTeX the basic requirement is to have a TeX compiler (which is used to generate output files from source), fonts, and the LaTeX macro set. Assuming I have a TeX engine and I ...
9
votes
1answer
143 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 ...
2
votes
0answers
22 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 ...
6
votes
3answers
245 views

Non-latin characters with plain TeX

What would it take to output non-latin letters (e.g. cyrillic letters) to a document using just plain TeX (i.e. without using "third-party" macro packages such as LaTeX)?
23
votes
1answer
1k views

Knuth “Some Implementations of TeX”…

In Appendix D of The TeXBook, p. 387, in a discussion about automatic column sizing, Knuth tantalizes us with this: Some implementations of TeX display the output as you are running, so that you ...
2
votes
0answers
24 views

Penalty between paragraphs

How do I modify the penalty given to a pagebreak between paragraphs? I looked everywhere and could not figure out. If I really need to I can redefine \par but I'm unsatisfied with such a hack.
5
votes
1answer
68 views

TeX: Lining up three boxes

This question is really a continuation of my previous question. Basically, I'm wondering why this does not work: \hbox{\vbox{\hbox{This is}\hbox{A line}}\hfil\vbox{\hbox{And so}\hbox{Is ...
9
votes
1answer
140 views

Somewhat versatile usage of \@gobble and \@firstofone found in several macros

I was doing search about my question (see here for more detail) and found a thread commath and \ifinner. In the thread, there is a macro named \spx , the definition and usage of which are extracted ...
4
votes
4answers
327 views

Hiding particular output files: namely, .aux and .log files

Is it possible to hide .aux and .log files? If so, what would be the most low-maintenance/simple way of doing so? They create quite a bit of clutter. I have a folder where I'm tending to a bunch of ...
0
votes
0answers
76 views

Can not update packages in Tex Live Utility after installing Tex Live 2015 [duplicate]

since Tex Live 2015 was released these days, I updated it. I´m using a Mac. Now I wanted to check for package updates in the Tex Live Utility. But that does not work, unfortunately. First strange ...
7
votes
0answers
65 views

Feed fontdimen parameters to TeX

I have decided to use \fontdimen parameters as an array of numbers (to store data about Unicode Character Properties). The question now is to fill in those \fontdimen parameters in the most efficient ...
9
votes
1answer
111 views

Question about exercise 7.5 in TeXbook

Consider this extract from TeXbook: EXERCISE 7.5 Experiment with TEX to see what \string does when it is followed by an active character like ~. (Active characters behave like control ...
55
votes
1answer
1k views

Can TeX generate “heap dumps” to analyze+optimize out-of-memory situations?

As package author of the memory-extensive package pgfplots, I have been asked to analyze some out-of-memory situation. I could identify the "culprit"; it was some call to \pdfmdfivesum in which it ...
7
votes
1answer
37 views

What's the most plain way to define a parametrized macro within an outer macro definition

I often want to pass some arguments into a macro definition that defines an inner macro with parameters. For example \def\outmac #1,#2.{% \def\argone{#1} \def\argtwo{#2} \def\inmac ...
28
votes
1answer
625 views

What does “expanding” mean in (La)TeX?

You can often read about expanding a macro or when a macro does expand, sometimes about expansion. But what does this mean - in English?
4
votes
1answer
122 views

In LaTeX, what is the most efficient way to search for an optional token in given input?

My question is inspired by this comment by Joseph Wright. Let's say we have input strings with varying character combinations, such as: ...
1
vote
1answer
29 views

Writer2Latex table border removal

I'm using Writer2Latex to convert my .odt file, created in Google Docs and downloaded as .odt format, to .tex. It works but because there is no way to create columns of text in Google Docs other than ...
2
votes
1answer
118 views

Alignment in an enumerate environment using “\hspace” and “\hphantom” commands

I give a display of the first three problems from a multiple-choice test in algebra. The choices in the first problem are displayed using a tabbing environment, and the choices in the second and third ...
4
votes
0answers
93 views

Which algorithms does (La)TeX use? [closed]

People often talk about the many "typesetting wonders" (La)TeX can do because of the countless algorithms it uses. But exactly what are these typesetting algorithms? Concrete examples I have gathered ...
4
votes
1answer
63 views

Declaring array of integers

Is it possible to declare in TeX array of integer numbers ? What I am trying to do is to declare new tabular environment for very long tables spanning accross multiple columns and (or) pages. My ...
1
vote
1answer
41 views

Comma as letter and semicolon as operator in math formulas

Inside document source2e.pdf there are the following two lines \DeclareMathSymbol{,}{\mathpunct}{letters}{"3B} \DeclareMathSymbol{;}{\mathpunct}{operators}{"3B} which treats these two punctuation ...
3
votes
2answers
73 views

Define command to act like \ifvar

I'm trying to manipulate multiple boolean variables which are simply named one, two, three, etc. and since I'm using them with a counter, I have defined some commands to take a numerical input and ...
4
votes
2answers
35 views

How to \show the code of the command \autoref? [duplicate]

Edit: I think this is a duplicate of How can I see the "implementation" of the \LaTeX command? . I wanted to see the code for the hyperref \autoref command, so created this simple document: ...
15
votes
1answer
205 views

formal syntax rules of \dimexpr \numexpr \glueexpr

After looking at various answers on the site and by looking at the documentation of e-tex, I am still wondering what is exactly allowed in the various types of expressions, i.e. \numexpr, \dimexpr and ...
1
vote
0answers
37 views

Different font style on different OS

I use gnuplot for generating eps-figs including text labels which are organized in a separate .tex-file which in turn I include in my main document. With pdflatex TexNicCenter generates the ...
7
votes
2answers
469 views

Is there a complete modern book which explains how a TeX parser works?

Hi I am reading 'The TEXbook' by Donald E. Knuth. But in my point of view is very didactic for people who want to learn TeX. Most of the pages contain exercises. But many things of how a TeX ...
5
votes
3answers
250 views

macro who argument is proxy of next page break or beginning of a new slide

QUESTION: How do I write macros that run a control sequence \C (for example print a figure on the page or slide, a) right after the next page break (or new slide), or b) right before the next page ...
10
votes
1answer
178 views

Detecting the end of line

Minimal working example: \documentclass{article} \usepackage{color} \newcommand{\mytextcolor}[2]{\textbf{1}\textcolor{#1}{#2}\textbf{2}} \begin{document} This is \mytextcolor{red}{red color} rest of ...
43
votes
4answers
8k views

How to check if a macro value is empty or will not create text with plain TeX conditionals?

I have a macro which holds some text value, e.g. \macro{some text}. If it is empty, I would like for nothing to appear in the document, but it has some content of any kind which would produce text ...
18
votes
3answers
857 views

What is a “Control Sequence”?

When you get an error in LaTeX, the message "Undefined control sequence" is printed. Why is it called "control sequence" and not "command", for example? How does the sequence work? Is this a TeX or ...
1
vote
1answer
31 views

Table changes distance to preceding line depending on rows

This seems to be such a simple issue, but I still have not found an answer to this question. I am using a non-float tabular environment. Depending on how many rows my table has, the distance to the ...
5
votes
1answer
107 views

Segmenting a Bezier curve into equal lengths in tikz/pgf

I'm trying to draw two curves and then create equal sized segments/arcs using pgf/tikz but for some reason the segments are not equally sized. I want to go on and fill each segment with a different ...
12
votes
4answers
352 views

Ratio arithmetic in plain TeX

I would like to calculate the ratio between two dimensions and produce a dimensionless quantity for use in further calculation in the process. I seem to be unable to do so. Specifically, I run into ...