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

28
votes
3answers
617 views

Why doesn't TikZ's \foreach iterate over the last element of the list?

This code \documentclass{report} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[dashed] (1,-1) -- (1,2) node[above] {$1$}; \draw[dashed] (2,-1) -- (2,2) node[above] {$2$}; \foreach ...
11
votes
2answers
131 views

Document equivalence

What is the best way to determine, for two arbitrary input files, if they will result in the same compiled document (disregarding timestamp information and external files)? Context I'm attempting to ...
12
votes
1answer
66 views

Tight connection of \vbox es

I don't understand why TeX put a thin whitespace between my two vertical boxes: \documentclass{article} \begin{document} \vbox to 1cm {\rule{1cm}{1cm}} \vbox to 1cm {\rule{1cm}{1cm}} ...
1
vote
2answers
346 views

How can I ignore latex error while compiling?

When a tex file is compiled, everytime an error is detected, compilation stops and user action (usually hitting return key) is expected through console by user. I would like to ask, how is it possible ...
9
votes
1answer
439 views

Computer Modern font with accented characters (in XeTeX)

I'd like to use Knuth's Computer Modern font with XeTeX in a way where I don't have to type accents in a \'-way and without any gimmick such as making accentuated characters active and then say ...
10
votes
2answers
165 views

How is \unexpanded defined?

I was wondering how \etoolbox's \expandonce does what it does. So I looked up how it was defined and found \unexpanded\expandafter{#1} But no matter where I look, I cannot find a definition for ...
21
votes
1answer
420 views

Use of \relax after \ifnum … \fi construction

I'm reading Malcolm Clark's A Plain TeX Primer. On page 111 there's an exercise to define a macro that prints the current time. I've reproduced Clark's answer below: \newcount\minleft ...
11
votes
2answers
115 views

increase \hyphenation{word1 word-2…} capacity

We use LaTeX to typeset a large collection of books with many proper names. We use the \hyphenation{word1 word-2...} command to specify words that should not be hyphenated and to suggest hyphenation ...
6
votes
2answers
406 views

Left-aligned display math mode

How could one achieve, as primitively as possible, left-aligned display math so that \abovedisplayshortskip would still work as intended? It is my understanding that one can achieve left-alignment ...
3
votes
1answer
309 views

How can I convert a TeX document to Texinfo format?

I have a straight TeX document, and I'd like to produce from it a Texinfo document. Does there exist a tool that does this, or a set of guidelines? TeX and Texinfo seem to be closely related, so it ...
9
votes
1answer
1k views

Origin and formation to the ERROR ‘Dimension too large’

When I tried to compile: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[very thin, red] (0,0) circle (2); \foreach \i in {0, 1, 2, ..., 46} \draw[very thin, ...
7
votes
1answer
122 views

Could significant speedups be gained from package code minification?

Wikipedia: Minification is (also minimisation or minimization), in computer programming languages and especially JavaScript, is the process of removing all unnecessary characters from source code ...
3
votes
0answers
45 views

How do I create a reading list, and a bibliography in the same document? [closed]

I'm using a latex, bibtex and pdflatex to organise my dissertation. I need to create a references heading for all the texts I have cited in my work. I also need to create a reading list containing all ...
2
votes
3answers
99 views

Conflict with packages in printing out ƒ in \begin{equation} mode

The initial thread solved the main problem, but there is now some conflict with packages that I do not understand. My tex code \documentclass{article} \usepackage{amsmath, amsfonts, amssymb, ...
2
votes
0answers
69 views

Has anyone combined marginfix and tikzmark yet?

I am working on a big book project, and up until today I refrained from using glue. But now I had to, and, lo and behold, suddenly my margin notes' position is broken :( The reason is that marginfix ...
4
votes
1answer
53 views

Syntax for macro arguments not behaving as expected

I'm trying to build some macros for parsing arguments of other macros in which I'm smuggling in hidden arguments. The following code works perfectly: \documentclass{article} \makeatletter ...
0
votes
1answer
130 views

Problem at editing page [closed]

I can't edit this style and I don't know why ? how can help me ? http://naturalspublishing.com/show.asp?JorID=7&pgid=28
9
votes
1answer
79 views

\centering breaks fragile command (is there a fix?)

Many on this site know (and perhaps find slightly annoying) that I will try to solve any LaTeX problem with the use of my stackengine package. My motto is like one of the overnight delivery services: ...
14
votes
1answer
148 views

How to actually close a write-stream

I don't know too much about writing and reading to and from files. But I managed to create a nice command for me where I need to write something into a text-file and later-on read it again. ...
10
votes
1answer
72 views

How to define a command using \lowercase in \csname

I was being lazy and had a lot of commands of the form \def\foo{...Foo...} So I was thinking about taking an approach like ...
8
votes
1answer
283 views

Can I make TeX completely free-form?

I'm bothered about the language format of TeX. I mean I want to know why the CR is converted into a space and % must be at the end of a line to avoid the matter. To make matters worse, a blank line ...
4
votes
1answer
157 views

Tracing group-level and position in LuaTeX

I am absolutely new to LuaTeX and I have few questions about it. First of all I learned that in LuaTeX it is possible to trace all TeX tokens with `token filter' callback. Is it possible to get some ...
10
votes
3answers
380 views

Why is tex designed to render spaces around brackets?

When I wrote following lines: \section{Introduction}{ Content in introduction ... } Unwanted space comes before Content as warned. I understand it's due to some technical decision in tex. But I ...
6
votes
1answer
560 views

TeX capacity exceeded (save size)

I am generating a fairly large index of .txt, .tex, and .pdf files. This process has worked for a long time, and the size of the index is not the issue. I have added logic to insert additional links ...
4
votes
2answers
187 views

Some misunderstanding about macro expansion

I have the following code which doesn't work: \documentclass[12pt]{article} \tracingcommands=2 \tracingmacros=2 \tracingall \makeatletter \let\sep\relax \def\put@stack@#1#2{\edef#2{#1\sep#2}} ...
13
votes
2answers
201 views

How to set tikzmarks with \noalign at the edge of tabular rows

I'm trying to improve the lines in a tabular with colored rows (lines above a colored row can disappear in the adobe reader at some zoom levels) by redrawing the line above a row after the row itself ...
2
votes
0answers
81 views

Is there a way to partially evaluate TeX files? [duplicate]

I am looking for tools or techniques that can partially evaluate (e.g. inline definitions) a TeX source file into an equivalent, simplified TeX file with some parameters fixed. Specifically I would ...
11
votes
4answers
220 views

How can I compare two (not necessarily integer) variables?

After experimenting and researching for hours, I still cannot figure out how to perform a simple equality test between two numbers. More specifically, here, the two numbers in question are the ...
3
votes
1answer
66 views

Moving arguments inside group

I have a setup similar to the MWE below in which I have a macro that needs to be called in the document, and also regularly becomes a moving argument (in this case, inserted into the index, though it ...
7
votes
3answers
135 views

Defining tabular rows with macros using `\ifnum` leads to `Incomplete \ifnum`

I am trying to define tabular rows using a macro which shall perform an conditional definition of the tabular row according to a given parameter. Please consider the following MWE: ...
11
votes
4answers
102 views

A question about macro matching

Consider the following macro definition, and subsequent invocation: \def\foo #1 #2 \bar{stuff with #1 and #2 goes here} \foo arg1 arg2 \bar The \bar simply acts as the terminator for \foo. This all ...
20
votes
2answers
208 views

Has a command access to its own name?

Can two commands where the one is a copy of the other so that \ifx gives true have different behaviour depending on the actual name used for a call? \documentclass{article} \newcommand\red{some code ...
21
votes
2answers
339 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 ...
13
votes
4answers
452 views

How does one change the math style to one of the “primed” styles?

Background TeX typesets each portion of a mathematical expression in one of 8 styles: display, display', text, text', script, script', scriptscript, or scriptscript'. Knuth calls them, D, D', T, ...
3
votes
1answer
117 views

Are there more to applications of \iftrue and \iffalse?

While reading "TeX for the impatient" on the topics of iftrue and iffalse, I encountered this example, \def\isbigger{\let\bigger=\iftrue} \def\isnotbigger{\let\bigger=\iffalse} \def\test#1#2{\ifnum ...
23
votes
5answers
574 views

Can one define a '\superexpandafter{n}' that would expand to 2^n-1 '\expandafter's?'

This question was inspired by comment banter in this question. See title.
9
votes
1answer
136 views

What can and can't occur as macro argument?

The documentation of the environ package says The advantage to using environments is that their contents is not treated as a macro argument, so there are less restrictions on what can exist ...
7
votes
1answer
367 views

Is there likely to be an xpsTeX?

The 2007 TUG April Fools' announcement was pretty funny, but does this idea have any traction whatsoever? From a design point of view, XPS may be the starting point for future document formats beyond ...
26
votes
9answers
666 views

When is it appropriate to use \outer?

\outer is a strange beast. Any control sequence declared \outer cannot be used as either the parameter text or replacement text of a macro, at least if the control sequence is declared \outer at the ...
5
votes
1answer
59 views

tex using the wrong macro

Out of curiosity I tried to weave the bibtex.web source code and compile the resulting bibtex.tex with tex. I got some errors which led me to investigate; I'm sure my confusion stems from incorrect ...
2
votes
1answer
38 views

superscript issue in latex [duplicate]

I have 2 superscripts in 1 equation but one of these is floating higher than the other making it look messy. The code I have used is: $\hat{\boldsymbol\beta}^T X^T$ The T is higher for the beta ...
3
votes
1answer
77 views

only expand next macro if its depictable content is placed at a specific place on the page

I'm looking for a conditional that checks if the visual processor puts the depictable content of the macro that is going to be expanded at a specific place on the page where the content is placed. ...
9
votes
2answers
173 views

Is it possible to use $ as a macro delimiter?

Experimenting with macro definitions that use strange delimiters (see e.g. this or this question), I thought it would be fun to have a macro that takes an argument of the form "a/b" and turns this ...
43
votes
2answers
2k views

Electronic version of Knuth's “TeXbook”?

I have a printed copy of the TeXbook (from D.E. Knuth) at home. Now that I travel a lot, I don't want to take my library with me every time. Question: Is there a legal way to obtain (=purchase) a PDF ...
9
votes
3answers
139 views

Problem with ^^<HEX>

I have small problem with ^^<HEX>. If I have a <HEX> part of the ^^<HEX> in the macro \def\attemp{<HEX>}, I cannot write ^^<HEX> as ^^\attempt or ...
22
votes
1answer
246 views

Is \def sensitive to spacing?

In the code below, it took me a long time to figure out that the space in the second line below beginning with \def generates an error. I'm new here. Where is the documentation of \def that would ...
3
votes
1answer
192 views

Tex Custom Arrow with oplus symbol

I'd like to create the kind of arrow that shows inner classes in UML, that is, an arrow that starts with an \oplus symbol as it can be seen here: ...
3
votes
1answer
80 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 ...
13
votes
1answer
146 views

What is considered a token for non-standard input encodings?

When I use an input encoding to (La)TeX that allows me to directly input characters such as é and ä (such as by declaring \usepackage[utf8]{inputenc}), how is a token defined? Specifically, is it ...
2
votes
1answer
248 views

How to render LaTeX in programs?

Recently I'm writing a calc program, on android. As a frequent LaTeX user, it comes to be compelling to use LaTeX rendering in displaying the inputs and outputs. Is there any possibilities to use a ...