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

-1
votes
0answers
88 views

Two variants this same character

I have a text that uses a specific font and some letters in it that appear in two or three variants. Is possible to use all this letters in one document? Every variant has a different size. Maybe TeX ...
6
votes
3answers
117 views

How can I display the possible hyphenation points for words in a language other than US English?

This is a follow-up to tohecz's question, which I'm asking at the suggestion of Mico. The original question asks how to discover the hyphenation points for particular words, and the answers explain ...
5
votes
2answers
187 views

Input/Output primitives of TeX

I'd like to write some simple macros for handling things like cross-reference, to use them in plain TeX. (I know there are already macros devoted to this, like the ones present in Eplain, but I would ...
11
votes
2answers
250 views

How are dashes implemented in TeX?

How does LaTeX implement the differences between the dashes? -, --, and --- all print different dashes, but - is not an active character: it has catcode 12, the same as digits like 2.
0
votes
0answers
27 views

Problems with bibliography and references in TexWorks

I am writing a report in Latex, and I have the references in a seperate bib file and I reference them in my main document as \cite{xxx} I am using Texworks on Windows. After compiling the bib to ...
16
votes
2answers
301 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 ...
6
votes
1answer
165 views

When to use {} to address an argument

When is it necessary to use {} to squeeze an argument to a command? Example: In TeX we see a lot of calls like \vskip\onelineskip while this macro (\vskip) is defined to take one argument. Would it ...
9
votes
1answer
88 views

line breaking mystery in `\@dottedtocline`

I'm trying to understand why some entries in a table of contents are overfull even if a sensible break points exist. I pulled down the problem (and the definition of \@dottedtocline) to this example: ...
3
votes
1answer
55 views

Why does \the\day not work in my macro?

(TeX-Code!) I have defined a TeX-macro to compare date and time values. Everything works well, until I put in \the\day, to call the current value of it. Can someone imagine, why this works with all ...
9
votes
3answers
209 views

Why in the discussion of the definition of \newif are the following things true

This is a couple of questions that stem from the answer to Problems understanding definition of \newif by @egreg. In that @egreg says Let's look at \expandafter\expandafter\expandafter ...
5
votes
3answers
128 views

Delimiting-a-macro-with-itself-chain

Reading this question and the answer of @Werner made me think about if it is possible to have chains of self-delimiting macros like \XX abc \XX def \XX xyz or lets say \begin{someenv} \XX abc \XX ...
0
votes
0answers
23 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
65 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
142 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
55 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
66 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
124 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
80 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
50 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
33 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
142 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
342 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
157 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
44 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
85 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
233 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
877 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
457 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
118 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
143 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
219 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
148 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
94 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
147 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
156 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
121 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
257 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
124 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
365 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
87 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
367 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
43 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
84 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 ...