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

6
votes
2answers
329 views

How to not have widows and orphans without using raggedbottom

I know I can set \clubpenalty and \widowpenalty to 10 000 to make them “really bad”, but then TeX sees it equally bad to cut the page short when there is no vertical stretch (i.e. \parskip=0pt), and ...
4
votes
2answers
133 views

Change display style in xlop package

I recently discovered the package xlop to typeset automatically elementary school calculations. Using this for division for example like this, gives the output below. \documentclass{article} ...
20
votes
2answers
910 views

TeX's algorithms for “breaking paragraph into lines” and “setting the glue”

I want to learn more about the implementation of TeX's text-justification algorithm (setting the glue). After scanning through ch.12 of Knuth's TeXbook, I'm guessing that setting the glue must ...
7
votes
2answers
157 views

Deleting an element from a comma separated list

In this answer we learnt how to remove the n-th element from a comma-separated list. How can I remove an element from a list by its value, rather than its position? For example: if my global variable ...
42
votes
3answers
875 views

Why/When should I pay attention to warnings?

I often see warnings in the compilation-log of my tex-files. I searched in the internet and did not find a good answer to this question. And in my opinion there must be a reason why tex warns me about ...
22
votes
2answers
414 views

What is the differences between mathcode and catcode and how can I use mathcode?

The command \catcode is often used to change some internals. E.g. the command \makeatletter changes the catcode @. But what is \mathcode and how does it work? catcodes are well explained here: Wiki ...
7
votes
3answers
137 views

Sorting to match a given list

I am looking for ideas on the following task. I want to sort the entries in \listb to those in \lista. It cannot always be assumed that only the elements of \lista are in \listb; neither can it be ...
10
votes
1answer
145 views

How to get the natural width of the last box in a paragraph?

I want to get the natural width of the last line in a paragraph. For example, the last line of the following paragraph Georg Friedrich Bernhard Riemann (September 17, 1826 – July 20, 1866) was an ...
25
votes
2answers
502 views

What are lccode and uccode used for?

In TeX, each of the 256 bytes has an associated \lccode and an \uccode, integers in the range [0,255] which indicate among other things how \lowercase and \uppercase act. There are of course a bunch ...
11
votes
1answer
488 views

Using \toks registers

I was reading this tutorial for TeX programming: http://pgfplots.sourceforge.net/TeX-programming-notes.pdf recommended in the 2-nd answer here: Where do I start LaTeX programming? It says: ...
38
votes
0answers
673 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 ...
3
votes
1answer
88 views

Suppress output for a group

I have an \item style command where I need to be able to suppress output for the following text. I can do this with \nullfont, but that seems like a poor hack. Is there a declaration that will ...
10
votes
1answer
195 views

How to install or replace fonts in old TeX files?

I got interested in a research paper from 1991, which I cannot get an electronic online version of. The author was kind enough to send me his tex sources, but is himself unable to produce a pdf file ...
2
votes
1answer
83 views

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

A similar question has been already asked here, but has not been answered yet for fragile commands such as eg. \@author? What would be the right way to get detect if \author has been called with a ...
11
votes
3answers
441 views

How could the macro xii.tex be simplified into a better readable form

I was reading some TeX guides from where I have found this source: \let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF PA''FwPA;;FPAZZFLaLPA//71F71iPAHHFLPAzzFenPASSFthP;A$$FevP ...
4
votes
1answer
178 views

representing literal characters in a \newcommand or \def

Consider this short LaTeX document: \documentclass[11pt]{article} \usepackage[T2A]{fontenc} \usepackage[utf8]{inputenc} \usepackage[russian]{babel} \def\name{...} \begin{document} Hello: \name ...
4
votes
2answers
125 views

List of tokens from TeX mouth

Is it possible to get list of tokens which comes from TeX "mouth"? If I understand correctly: in mouth all macros, conditionals and special operations (like \the and \input) are expanded and then goes ...
2
votes
1answer
134 views

How to check if token is a macro?

I am thinking about possibility to parse LaTeX document. What I really need is to track category codes of symbols. As I understand TeX expands all of macros in his mouth and tracks changes of category ...
23
votes
1answer
297 views

What does list mean in relation to skip? (What is David on about?)

In two previous question When is it good practice to use \unskip and What is a token? the default meaning of token in LaTeX and the behaviour of \unskip were asked. However in the first question was ...
16
votes
2answers
2k views

When is it good practice to use \unskip

One sees in source2e the command \unskip used in various places. My understanding in general terms is that the macro is the equivalent of \ignorespacesbehind. Where would it be recommended to use ...
41
votes
3answers
914 views

What is a token?

Please forgive such a basic question, but I did some Google searching and looked around on this site, and while there are many threads and online resources that involve tokens, I can't seem to find a ...
11
votes
1answer
160 views

(Re)definition of commands that use delimiters other than braces (e.g. \underbrace)

How do you go about redefining a command such as \underbrace, which uses an "uncommon" delimiter, i.e. _, between its two arguments, so that the redefined command be usable in exactly the same way as ...
8
votes
1answer
199 views

Why doesn't \mathord work to turn an Acc atom into Ord?

Writing ${\dot X^a}^b$ produces a very cryptic "double superscript" error: this has been explained here on this forum: the reason is that {\dot X}^a generates an Acc atom and that, for a reason that ...
1
vote
0answers
44 views

How to break long expressions automatically in displaymode? [duplicate]

Whenever an expression is too long, it will be broken automatically in inline mode but done nothing in displaymode E.g. MWE: \documentclass[11pt]{article} \begin{document} ...
15
votes
3answers
313 views

Parsing strings containing diacritical marks (macros?)

I apologize that this question may seem very much like several other recent ones I have asked (Parsing leading hardspaces, Parsing a \$ as part of an improved \getargs command). They are all related ...
6
votes
1answer
136 views

Macros in \special

I tried to compute a bounding box in LaTeX and pass the value on to dvisvgm via DVI specials. The resulting code (which I copy-and-pasted together from all over the internet) looked as follows: ...
5
votes
2answers
207 views

Variadic arguments macro

I am trying to make macro with variadic arguments, iterating over them. The final result is supposed to be: \foreach[x]((var = \x )){foo}{bar}{baz}\null evals to var = foo var = bar var = baz My ...
6
votes
3answers
322 views

Why are some characters not allowed in command sequences

From my understanding a control sequence is ended by any non-alphabetic character such that \mycsA is one token, but \mycs1 is two tokens. This means things like starred commands \mycs* are actually ...
2
votes
0answers
853 views

How to edit the LaTeX path in LyX on Windows (x64) [closed]

I was using MiKTeX 2.9 (x64) on my Win 7 machine for some time with TeXnicCenter. Now I tried to install LyX on the same PC. The problem I get is Lyx does find neither latex.exe nor sees all the other ...
7
votes
2answers
114 views

Is there a way of defining a command \nullifyifmoved{arg} that will normally act like its argument but act like a no-op if the macro is “moved”?

I'm interested in a macro \nullifyifmoved that takes one argument arg and acts like arg in normal contexts, except it acts like a no-op wherever it is written to a file. Some background: Martin ...
11
votes
2answers
244 views

How does math mode work?

When writing an a in TeX, it is typeset as an upright "a" by default. When writing an a in math mode it is typeset in italics. Furthermore, in math mode white spaces are ignored and no empty lines ...
5
votes
3answers
147 views

Metacommand for commands that dynamically select a parameter?

Original question I would like to create a metacommand for creating new projection commands. Specifically, \newproj{\cmd}{<n>}{<m>} should create \cmd as a new command of <n> ...
14
votes
1answer
215 views

Am I programmatically tieing my hands behind my back by insisting on a particular engine?

I've read Differences between LuaTeX, ConTeXt and XeTeX, but still have a niggle at the back of my mind that I'd like to ask about. I'm developing a LaTeX package/class/stuff with the aim of making ...
4
votes
3answers
238 views

How are space tokens and empty lines processed by long commands (as their potential arguments)?

How are spaces and empty lines processed by long commands (i.e., those that do not accept paragraph breaks inside)? Are there different space tokens aside from " " and an empty line? It appears that ...
21
votes
3answers
332 views

If I redefine a command that has a starred variant, will that always disable the starred variant?

If I redefine a command that has a starred variant, will this always effectively disable the starred variant, as a side effect of redefining the unstarred variant? A related question: Do starred ...
3
votes
1answer
105 views

FMT to CLS Creation in LaTeX

A Few years back we have created fmt format through PDFTEX. Now we have need to update some points in the class file. It is possible again to create fmt to .cls or .dtx files?
3
votes
1answer
82 views

font loading via URL for all TeX-en

Firstly, I'm not asking about typesetting URLs. What I am talking about is font resolution via a URL reference. My limited experience is in using XeLaTeX so I'll couch the question accordingly. If you ...
23
votes
4answers
622 views

unexpected interaction between \raggedright and \parshape

While answering Random start of line, I came upon a strange interaction between \raggedright and \parshape. If a ragged-right paragraph ends in a short line, this line will be "the most ragged". ...
8
votes
1answer
155 views

Which commands exist to define new commands?

Which commands are there that one can use to define new commands in (La)TeX? There are: \let, \def, \[re]newcommand[*], \DeclareRobustCommand[*], and ...? (And I've seen things like ...
11
votes
2answers
135 views

Is there any reason to define a zero-argument macro using a starred defining command?

Is there any reason to define a 0-argument (read: zero-argument) macro with a starred command (\newcommand* instead of \newcommand or \DeclareRobustCommand* instead of \DeclareRobustCommand)? After ...
13
votes
2answers
411 views

What is “plain TeX”?

I occasionally see a statement that plain TeX is not the same as TeX, because plain TeX is already a format. What is plain TeX, and what is the difference to TeX proper? Some answers are here (The ...
8
votes
5answers
354 views

What sequence of documents should I read to know “all of” TeX and then LaTeX?

I know that there are a already number of questions on this site about good instructional (La)TeX materials for users at different levels. What I am interested in, though, is what set of documents ...
16
votes
4answers
634 views

Selectively suppress generation of typeset output

Is it possible put TeX into a "mute" mode in which all typesetting is suppressed? \documentclass{article} \pagestyle{empty} \begin{document} \suppress This text will not be seen in the generated ...
4
votes
1answer
451 views

\vbox with some extra space below

I don't understand why when using \vbox of a certain height, there is some extra space added below it. I'm trying - towards grid typesetting - to put for example graphics in the vbox of a certain ...
26
votes
3answers
681 views

When is it better to use \par than \endgraf?

Just yesterday I had to patch a package file (changing the description to indicate that the file had changed) to replace some \par to \endgraf because the code had bad interactions with non-\long ...
15
votes
3answers
2k views

\string command behavior - Plain TeX

I would like to learn Plain TeX and I'm reading Knuth's "The TeXBook". At Chapter 7, Knuth talks about the \string command and how it converts control sequences into lists of characters tokens. Why ...
12
votes
2answers
2k views

What does \relax do? [duplicate]

Possible Duplicate: How can I speed up LaTeX compilation? What is the difference between \relax and {}? The title suggest the question. On and off, I see macros here in TeX.SE and I see ...
3
votes
1answer
218 views

Expanding subscript and subscript capabilities

Well, I liked the idea expressed in the question alternative syntax of subscripts using tex. But I want it to work in a sightly different way. I just want to expand the usual _ and ^. How? So that ...
4
votes
2answers
212 views

alternative syntax of subscripts using tex

I would like to sometimes write subscripts using different syntax, instead of $u_{xx} blahblah$ write something like $u⎵xx blah blah$, or even $u⎵xx+blah blah$ where either space following the x ...
17
votes
3answers
220 views

Is it possible to interact with TeX mid-process?

Quoting from an answer to Typesetting the entire Song That Never Ends I ran this code once, and aborted the process after it reported producing something like 47,000 pages (in a very short amount ...