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

3
votes
1answer
27 views

Specifying coordinates with \def in PSTricks

I'm starting with PSTricks. I use the following macro to set cartesian coordinates: \def\newPoint#1(#2,#3) { \expandafter\def\csname x#1\endcsname{#2} \expandafter\def\csname ...
0
votes
0answers
49 views

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

I am trying to compile the first three chapters of my dissertation but I am getting the following error: Errors: ./EQM-TAR.tex:70: Undefined control sequence. [\paginaresumo] ./EQM-TAR.tex:70: TeX ...
5
votes
1answer
123 views

What does mathchar do?

The package cmll defines \with (looks like '&') as $ texdef -t latex -p cmll with \with: \mathchar"2026 \the\with: 8230 When I take a look at \& it is defined as texdef -t latex \& ...
1
vote
0answers
55 views

What is the core of TeX as a programming language? [closed]

Tex (and LaTeX) mix programming elements with typesetting ones. It's often confusing to a beginner to tell them apart. Could anyone show me a list of the very core commands of TeX (and perhaps LaTeX) ...
4
votes
2answers
72 views

plain TeX error. Undefined control sequence. \pgfutil@

I'm trying to compile the fix mentioned by egreg in this thread: Strange behaviour with PGF/TikZ and Plain TeX output routine Here's the code: \input pgf \catcode`@=11 \newbox\pgfutil@@Output@Box ...
19
votes
1answer
356 views

How do I get into XeTeX development?

The support for OpenType fonts has been a great advancement in terms of usability. Unfortunately the microtype package does not offer font expansion for OpenType fonts in XeTeX. I dug a little ...
12
votes
3answers
197 views

Assertions in Latex

I am writing a long latex document and use many macros for defining mathematical symbols. I would like to ensure that there is no clash in the notation. For example, something like ...
3
votes
0answers
43 views

plain TeX and paragraphed notes

The TeXbook proposes, p. 398sq, a system to obtain paragraphed note. That is, instead to obtain Footnote. Footnote. Footnote obtain : Footnote 2. Footnote 3. Footnote. In ...
11
votes
1answer
130 views

Why this output using \string on the empty csname

How does this exactly work? \expandafter\string\csname\endcsname I don't know what I would expect to come from there, but definitely not \csname\endcsname_ where _ is a space. I thought ...
7
votes
1answer
234 views

What is this file and how to compile and tranform it?

I was given some files to update. They were produced in late 1990s and seemed to be related to LaTeX. However, I could not compile them at all. To begin with, there is no \begin{} or \end{}. In ...
2
votes
1answer
64 views

Redefine a primitive parameter

I want to redefine a primitive parameter as a macro, and make the macro behaves the same as the primitive parameter in some situations. \tracingcommands = 1 \the\tracingcommands ...
7
votes
2answers
75 views

Appending active and expansion sensitive characters to a macro

This question comes up pretty often when people want to build tables with empty columns or similarly building up some active characters inside a macro hoping to expand them at the right time right ...
6
votes
1answer
69 views

An insert macro

Once in a while I try to understand how TeX works... Hitherto now success, but sometimes I manage to define a macro. For example, \def\appendto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}% ...
1
vote
1answer
84 views

Can openout handle a filename with spaces?

With pdflatex, can \openout handle a filename with a space in it? (We're using MiKTeX and our users seem to think it's clunky to restrict them in this way. We also have tons of legacy TeX files and ...
3
votes
1answer
49 views

Typesetting text in multiple languages without repeating the text

I am working on typesetting an Indian text in three languages using ITRANS + XeTeX. I have pasted an example below. How do I avoid having to repeat the text for getting three different outputs. Can I ...
1
vote
1answer
81 views

cryptic plain TeX: Twelve days of Christmas

Many years ago, probably in TUGboat, I saw a shortish piece of \TeX\ that immediately deploys catcodes and very quickly becomes completely unreadable, but when typeset produces the old "twelve days ...
1
vote
1answer
105 views

\newcommand in imsart package

I am currently using the imsart package provided by http://www.e-publications.org/ims/support/ims-instructions.html However, it seems the pdfLatex/Latex/pdfTex/pdfTexify compilers cannot read one ...
4
votes
2answers
71 views

loop in tabular that uses \the\count to access current line number

I would like to generate an autmatic table using loop. As suggested here before, it is best to first generate the lines in a toks and then pass them to tabular. However, I have problems with accessing ...
0
votes
0answers
32 views

TeX Usage of the Ampersat (@) [duplicate]

I've had trouble finding easily accessible information on what exactly the ampersat does in TeX- it seems to be used frequently in the implementations of the commands I use, yet I've never had to use ...
2
votes
2answers
82 views

define a macro with two parameters delimited by optional spaces

I want to define a macro with two parameters which delimited by optional spaces. For example, from the following code \def\mymacro #1 #2 {#1:#2 } \mymacro one two others I get one:two others. But ...
2
votes
1answer
161 views

Implementing the Sum Function in TeX

How would I go about implementing a function in TeX to add an arbitrary number of numbers? Reading through the \def notes, it seems it can only take up to nine arguments. How would I make a function ...
0
votes
0answers
45 views

Where is this TeX magic line “%&” documented? [duplicate]

I learned about this magic %& line that is supposed to hint at the flavour of TeX a file is using. Where is this magic documented? I have not been able to find it anywhere.
109
votes
10answers
8k views

Why is LaTeX so complicated? [closed]

I have been using LaTeX professionally almost every day for almost 10 years, so I think I can say that, by now, I more or less know what I'm doing. I also do a lot of ordinary computer programming, in ...
38
votes
1answer
826 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 ...
5
votes
1answer
228 views

TeX at the Command Line

How does TeX work at the command line? More specifically, after having installed LaTeX, I found that typing tex in the command line opened up an interpreter. However, I have no idea what I can do ...
3
votes
4answers
163 views

Conditional \end or \bye in TeX (plain-tex)

Can someone figure out a conditional \end or \bye in TeX-Code? (plain tex) I want to put in several lines into a TeX-file, each ending with \end , to be compiled before the document is complete, to ...
5
votes
1answer
145 views

Macro in Tex Programming

I am confused whether the below macro is for section or what? If yes can anybody help me to explain this piece of code \def\Section #1 \par { \bigbreak\vskip\parskip \need 1.5 in ...
1
vote
0answers
172 views

TeX Programming [duplicate]

I have lot of confusion regarding TeX and LaTeX. What I have understood is TeX is basically macro instructions, and LaTeX uses that macros or we can say TeX is extended to LaTeX. But, really not very ...
12
votes
0answers
133 views

Test if paragraph has an overfull line

I'd like to test if the last paragraph has any overfull line. The naive approach of looking at the \badness once the paragraph is finished does not work, as it will only give the badness of the last ...
2
votes
1answer
76 views

Are there any ways to embed LaTeX source code from a PDF file [duplicate]

I want to the tex files from PDF files. I have the PDF files that I get in Internet and have a lot of mathematics, so I want to convert PDF files into tex files. I researched in these forum, and ...
5
votes
2answers
167 views

Macro expanding to a file's contents?

How can I define a macro so that it expands to a file's contents?
6
votes
1answer
68 views

\unskip and \hskip in \linebreak

I found the definition of \linebreak macro as follows: \def\linebreak{\@testopt{\@no@lnbk-}4} \def\@no@lnbk #1[#2]{% \ifvmode \@nolnerr \else \@tempskipa\lastskip \unskip ...
6
votes
2answers
170 views

How to make latex parse `x` as an argument of a macro definition instead of `#1`

When I define a mathematical function for plotting in pgfplots or pstricks I usually to it in the following way: \def\f(#1){(#1)^3 + 3*exp(#1)} just as suggested by Jake in his answer to a ...
10
votes
2answers
94 views

\prevdepth and \noalign

In The TeXBook it says The value of \prevdepth at the time of the \halign is used at the beginning of the internal vertical list, and the final value of \prevdepth is carried to the enclosing ...
10
votes
2answers
263 views

TikZ/TeX: Minimum line width/maximum resolution

I would like to employ TikZ for some constructive work, namely, programming a FabLab laser cutter. This nifty device gets a 2d drawing (as PDF) and cuts along all hairlines in the PDF. A harline is ...
12
votes
3answers
386 views

TeX command with argument BEFORE the command

Is it possible to do some TeX magic to get a command \mycmd which takes one argument before the command and one afterwards. So something like <arg1>\mycmd<arg2>. I tried ...
6
votes
3answers
141 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 ...
6
votes
2answers
231 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 ...
12
votes
2answers
263 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
45 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
322 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 ...
7
votes
1answer
167 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
99 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
67 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
218 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
139 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
24 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
77 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
179 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
63 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 ...