{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
1answer
45 views

What does double backslash in LaTeX mean?

What does double backslash in LaTeX mean ? (please see example below) label 2-1 & label 2-2 & label 3-3 & label 4-4 & label 5-5 \\ \verb= http:\\www.chinatex.org=\\ some line have ...
0
votes
0answers
54 views

LaTeX sudoku not compilling

I want to ask what could be problem with following code: \documentclass{article} \usepackage{printsudoku} \usepackage{solvesudoku} \usepackage{createsudoku} \begin{document} \sudoku{test01.sud} ...
3
votes
1answer
42 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
73 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
88 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
69 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
71 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
156 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
43 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.
108
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 ...
37
votes
1answer
773 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
225 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
153 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
141 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 ...
11
votes
0answers
121 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
74 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
161 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
60 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
167 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
88 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
237 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
382 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
130 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
216 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
261 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
41 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
318 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
94 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
66 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
215 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
136 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
73 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
165 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
58 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
72 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
140 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
88 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
54 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
37 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
149 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
389 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
159 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
55 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
47 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
125 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 ...
16
votes
1answer
274 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 ...