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

0
votes
0answers
21 views

Always creating a second document with slightly different configuration [duplicate]

I work on a document, and I would like to create, simultaneously, another document which has the 'doublespacing' tag on. Until now, every time I needed it, I just copied the TEX file to a ...
4
votes
1answer
61 views

A certain alignment for displaying systems of linear equations

I have several equivalent systems of linear equations that the following code displays. I would like to have them vertically aligned at the equals signs. I found the following code on this web site ...
9
votes
2answers
125 views

Replace every backslash in a string with a forwardslash

I would like to replace every backslash \ inside a macro (string) with a forwardslash /. The macro is intended to contain a filename in Windows notation which should be replaced by a valid (La)TeX ...
1
vote
1answer
48 views

How to parse a macro that contains a \let?

My situation is similar to, but hopefully different from How do I ‘expand’ a control sequence \let to a character?, as that question does not admit a positive answer. I want to parse, not expand, but ...
5
votes
1answer
61 views

Accessing child contents of LaTeX boxes (append/concatenate TeX box material)?

This is somewhat similar to Reading the contents of a box, but with a specifically plain Latex example; I somewhat solved the question while writing the post, so I'll formulate the question like this: ...
3
votes
3answers
119 views

Safe test for an empty expanded macro argument?

How can I test in a safe way (i.e. without reserving tokens as explained here) if an expanded macro argument is empty?
6
votes
1answer
77 views

Empty argument to \string

What is the result from \string{} and why can't we use it in place of \detokenize to check if a macro argument is empty as explained here?
6
votes
1answer
40 views

How to return \count value from \def

I wrote a macro which calculate remainder : \def\remainder#1#2 {% \newcount\dividendcount \dividendcount=#1 \newcount\quotientcount \quotientcount=#1 \divide\quotientcount #2 ...
1
vote
1answer
31 views

Could not use \rule in chapter title in latest texlive

Using XeLaTeX In texlive 2014 (versions before May or texlive 2013 or older), one can use \rule{width}{height} in a chapter title. However, in latest texlive (versions after June) form ctan, use of ...
8
votes
2answers
136 views

Active space character without definition?

In the code below, why does the space character not produce an 'Undefined control sequence' error as the dot character does: \catcode` =\active \catcode`.=\active a b a.b \bye
11
votes
3answers
320 views

Parser for decimal numbers in (plain) TeX

I need help writing a parser for decimal numbers using only TeX and plain TeX. The set of accepted inputs is given by the regular expression: (+-)?(0-9)*(.,)?(0-9)+ The parser need not do anything ...
20
votes
1answer
152 views

How to delay a command execution until the next hmode?

I want to write an environment which adds a marginnote at the begin. The problem is that I can't control the content of the enviroment and so the placement of the marginnote varies a lot. How could I ...
5
votes
1answer
54 views

The value of \hsize in ams classes is 0pt in the preamble

\documentclass{amsart} \showthe\hsize \begin{document} ... \end{document} returns 0pt but \documentclass{amsart} \begin{document} \showthe\hsize ... \end{document} returns 360pt. Is the first ...
4
votes
2answers
41 views

Compensating for multispan boxes wider than spanned columns

The code below produces a horizontal alignment with two columns and three lines (see first image below). The first column has its elements flush right and the second column has its elements flush ...
3
votes
1answer
71 views

Positioning of \hrule and \vrule

I try to construct a symbol from 4 rules, one horizontal and three vertical ones. \showoutput gives me the correct dimensions for all of them (see below). However, the horizontal one somehow ...
14
votes
1answer
232 views

Ligatures and hyphenations: the effect of empty brace groups {}

For the following example, \hsize =2in shelf{}ful shelf{}ful shelf{}ful rot{}ten rot{}ten shelf{}ful shelf{}ful shelf{}ful shelf{}ful shelf{}ful rot{}ten rot{}ten shelf{}ful shelf{}ful \bye The ...
19
votes
1answer
869 views

Why are the latex, pdflatex and pdftex binaries identical?

I apologize if this question is somewhat off-topic but I think that this is the best place to find an answer. This is sort of an oddity that's confused me for years. When I run latex -v I get: ...
14
votes
2answers
455 views

Why using character ^^ff before every chapter in the TeXBook source

When viewing the source code of the TeXBook, I find that there is a character ^^ff before every chapter in it. I am wondering why using this ^^ff character which seems useless? The following ...
8
votes
1answer
112 views

Why do I need an \hbox inside \vcenter to make it work?

I want to vertically center an object in an equation. I thought: "Ok, \vcenter is the way to go." But I don't understand (not even from the TeX primitives reference), why I need an \hbox inside my ...
7
votes
2answers
140 views

How to show dimension values in scaled points

TeX stores dimensions internally in scaled points but operation \the expands to the corresponding value in points. Can we avoid the conversion and get the more precise, "original" value instead?
4
votes
1answer
58 views

\halign does not affect \prevdepth?

What is the purpose of restoring the initial value of \prevdepth at the end of a horizontal alignment: \prevdepth=.1234pt \everycr{\noalign{\dimen0=\prevdepth prevdepth in noalign: \the\dimen0}} ...
7
votes
1answer
211 views

How many man-years does it take to implement TeX?

When I first posted messages to comp.lang.postscript about my efforts to write a postscript interpreter I was informed that it takes approximately 5-10 man-years to write a fully-compliant level-3 ...
2
votes
2answers
51 views

Passing the value of a register as a macro argument

I'm looking for a solution to the following problem: \def\m#1{{ \dimen0=200pt \#1=\the#1 % Outputs 200pt rather than 100pt }} \dimen0=100pt \m{\dimen0} EDIT: The code sample above ...
10
votes
4answers
147 views

# in conditionals in alignment tabs?

I am looking for ideas how to make TeX understand that when # appears both in the if-else and in the else-fi part of a conditional in an alignment tab, in the end there will never be more than one # ...
8
votes
1answer
91 views

Incomplete \iftrue is valid input?

Is LuaTeX beta-0.79.1 correct in thinking the following is valid input: \iftrue \bye
4
votes
2answers
144 views

New primitives and grammar for replacing horrible \expandafter

Time and time when I am trying to read or write some macros, I'm always frustrated by lots of \expandafters inside them. Why don't we add some new primitives and grammar into TeX engines to make ...
13
votes
2answers
155 views

ifx, macros and grouping

I do not understand how \ifx interacts with macro definitions. Here is a minimal example: \def\a#1{\b} \def\b#1#2{[#1:#2]} \a ABC The output is [B:C], as expected. If I change the definition of \a ...
7
votes
2answers
111 views

\xrdef and \xref in eplain

I tried to upgrade eplain used in the book "TeX for the Impatient" from version 1.9 to latest version 3.6, but came across the following problem with new eplain. The follwing code could be compiled ...
3
votes
1answer
84 views

Is there a platform-independent way of specifying page dimensions in TeX?

This is partially a follow-up to this question since the answer mentioned tex as executing the "original Knuth TeX". So far, I have seen that the following will work in TeX, but is ignored by ...
5
votes
1answer
61 views

Is it possible to conditionally execute statements based on the translating engine, within Plain TeX?

Note that this question is about Plain TeX, not LaTeX. Consider the following example. \pdfpagewidth 8.5 in \pdfpageheight 11 in foobar \bye Under pdftex, this will work fine. However, this will ...
8
votes
2answers
254 views

Conversion of tex to latex

Quite surprisingly for me, I did not find valuable information on how to convert plain TeX files to LaTeX documents. There is a TeX.SX question, but it was answered with a particular solution. I ...
1
vote
0answers
119 views

List of TeX internal parameters? [closed]

I have come across quite a number of TeX internal parameters, like \clubpenalty, \widowpenalty, \abovedisplayshortskip and so on. Could you provide me with a complete list of them, what they are for ...
13
votes
1answer
305 views

What is the command \span?

I have bumped into the \span primitive a couple of time. I got the impression it is defined in the TeX program, not even in plain.tex. Is that right? And what does that command do and what is it for?
8
votes
2answers
99 views

Why is the character following this macro-defining macro gobbled up?

I have the following plain Tex code: \def\xx{ABC} \def\temp #1 {\def\tempii{#1}} \temp\xx a b c \tempii\tempii I expect to see the following output: a b c ABCABC But I actually see this: b ...
5
votes
0answers
83 views

What is the difference between a typesetting language and a markup language

I remember, I read some article in a technical journal where the author drew the attention on the reader on a lot of people confusing typesetting languages and markup languages. How can I surely tell ...
16
votes
2answers
363 views

Filling gaps by repeating a character

I want to create a macro like \mymacro that has four arguments; first and fourth arguments are any letters, second argument is a character and the third argument is a length. When I say \mymacro{م} ...
5
votes
1answer
41 views

polyglossia + output routine = wrong expansion in file writing (???)

If I use the following custom class: \NeedsTeXFormat{LaTeX2e} \ProvidesClass{upecha}[2014/09/21 v0.8 tibetan modern pecha class] \input{size11.clo} \def\@outputpage{\shipout\vbox{\box\@outputbox}} ...
0
votes
0answers
45 views

Aligning right parenthesis vertically in a multiple-choice test

I am making a test. Some of the problems have choices, and the choices are mathematical expressions. I have included the code for the first two problems; 1.) has six choices, and 2.) has eight ...
8
votes
2answers
81 views

badness for lines without glue?

I want to typeset a special paragraph which have some penalty items inside it but no glue. TeX always produces an overfull box for this paragraph. I have two questions: What is the line badness if ...
27
votes
3answers
261 views

Is there a way to get at the value of \prevdepth from the main vertical list inside the output routine?

To motivate that (admittedly) strange question: When TeX builds a vertical list it keeps track of the depth of the last box added in a special variable called \prevdepth which is used to calculate ...
24
votes
2answers
679 views

Why does a TeX point differ from a Desktop Publishing point?

From this answer to Why does PDFLaTeX and XeLaTeX generates 11.955 font size for 12pt documentclass option?, I found out that PDF and TeX have different ideas about the size of the point (pt). A TeX ...
3
votes
2answers
77 views

How to expand a LaTeX counter when adding to token list

In short: I am trying to append counter values to a token list, but when I print the token list at the end I get the final values of those counters. What I want is the value of the counters at the ...
10
votes
1answer
135 views

Macro parameter delimited by more than one delimiter

TeX user can simply create the macro with a parameter delimited by an arbitrary sequence of tokens. For example \def\macro #1delimiter{...#1...} Is it possible to create a macro with a parameter ...
15
votes
2answers
172 views

\expandafter with \uppercase ordering

As I understand it, the behavior of \expandafter is such that if \a and \b are macros, then \expandafter\a\b will first expand \b then \a. But my understanding must be wrong, because I don't ...
17
votes
4answers
477 views

Scaling a glue in TeX

is there a possibility to scale a glue in TeX? Consider the following example: \newskip\foo \newskip\bar \foo=10pt plus 2pt minus 3pt \bar=2.5\foo\relax \showthe\foo \showthe\bar \bye When ...
1
vote
0answers
58 views

Geometry package in TeX: How to print (or use) the values of geometry properties in document page?

I have problems with geometry package. I would like to find out parameters of my page (layout) such as textwidth, layoutheight etc. I want to have a dynamic layout of my page without number or ...
5
votes
4answers
195 views

A simple line from start of the page to the end

I need on one specific page a line from the very top to the end of the page (it is for folding). Everything I tried so far stopped at the head/foot room. Someone got an idea?
8
votes
3answers
207 views

Arguments possibly delimited by \bgroup and \egroup

I still don't see (and haven't thought about) pros and cons of making available the arguments as \foo{…} or \foo\bgroup …\egroup (or even unbalanced, \bgroup …} and {…\egroup). But I'm curious about ...
6
votes
2answers
152 views

Delimited arguments and using a macro inside of itself

I wanted to play with delimiter sizing without using the \delimiterfactor, -shortfall, etc. and made the following: \newdimen\bigdim \bigdim = 1.9743ex \newdimen\Bigdim \Bigdim = 2.671ex ...
5
votes
1answer
64 views

\par in the parameter text (as an argument delimiter) and \vbox{#1} in an \everypar macro

This is basically a question about TeX's error messages. I am confused by a cryptic error message that TeX gives me when I try to do the above. I have tried to isolate it, but have come no further ...