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

11
votes
2answers
204 views

Creating new primitives

Consider the following TeX: \tt ~~~[def]: \meaning\def \par ~~~[let]: \meaning\let \par [define]: \meaning\define \par ~[macro]: \meaning\macro \def\macro#1{some ...
4
votes
1answer
76 views

Can I expand a macro argument once without using a scratch register?

I'm still trying to get my head around how expansion works in TeX. One thing I can't figure out is how to expand a macro argument once without having to use a scratch register as an intermediate. As ...
5
votes
1answer
190 views

Using \show in nonstopmode causes TeXmaker to raise false alarms. Any fix?

I'm currently reading the TeXbook, and I use \show a lot to see how Knuth defined plain-TeX macros in terms of TeX primitives. For instance, to have access to the definition of \centerline, I would ...
8
votes
1answer
120 views

How do ligatures work?

The TeXbook doesn't explain ligatures more than presenting the existing ones, the same for TeX By Topic. So, how are they defined? Is there a third way besides active characters and control sequences ...
2
votes
0answers
163 views

Adding vedic accents in sanskrit in devanagari script in red color using Context - not working in all cases

Using the techniques described in Coloring combining characters without changing color of a base character I have been able to color red the vedic accents in sanskrit typesetting using ConTexT MIV. ...
12
votes
1answer
85 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}} ...
12
votes
2answers
250 views

Define a shortcut (-> to \rightarrow) in plain TeX

I'ld like to make -> a shortcut for \rightarrow. Is that possible with Plain TeX or has it to do with the loaded font?
12
votes
2answers
138 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 ...
49
votes
5answers
899 views

\let\foo\bar vs \let\foo=\bar

Both uses of the \let primitive often lead to the same result. Is this even true for every case? What was the thought process behind it. And if they are actually not equivalent, are there particular ...
11
votes
2answers
316 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 ...
4
votes
2answers
2k 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 ...
6
votes
2answers
866 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 ...
5
votes
1answer
86 views

How can I create active hyperlinks for cross references in Texinfo DVI/PDF?

The Texinfo PDF manual has cross references as hyperlinks through the document. The cross references are presented in an attractive dark red colour. When I create a PDF from my own Texinfo source ...
11
votes
1answer
3k 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
128 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 ...
2
votes
3answers
126 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, ...
3
votes
0answers
71 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 ...
5
votes
1answer
57 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 ...
2
votes
0answers
76 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 ...
0
votes
1answer
194 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
84 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: ...
23
votes
1answer
733 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 ...
14
votes
1answer
189 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
83 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
290 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
183 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
395 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 ...
9
votes
1answer
2k 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
206 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}} ...
14
votes
2answers
252 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
88 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 ...
3
votes
1answer
80 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 ...
18
votes
1answer
271 views

Plain TeX online documentation/references?

I am a non-beginner plain TeX user, mostly typesetting cheat sheets for computer science. I own The TeXbook and have seen some TeX manuals for the compilers, such as pdfTeX manuals and so forth. My ...
11
votes
4answers
336 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 ...
7
votes
3answers
209 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
115 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 ...
25
votes
3answers
298 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 ...
3
votes
1answer
154 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 ...
9
votes
1answer
143 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 ...
5
votes
1answer
61 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
47 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 ...
143
votes
23answers
7k views

Are there any open research problems in the world of TeX?

For a year-long capstone project in computer science, I have to do some 'original research.' I'm still not entirely sure what this entails, but it just struck me that perhaps I can do research and ...
3
votes
1answer
91 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
3answers
153 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 ...
9
votes
2answers
197 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 ...
22
votes
1answer
260 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 ...
34
votes
3answers
4k views

Difference between \if and \ifx

I try to understand the subtleties of TeX programming, but it is not always easy. For example, in the following code : \def\first{abc} \def\second{abc} \ifx\first\second OK!\else false \fi I ...
2
votes
1answer
550 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 ...
11
votes
2answers
134 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 ...
3
votes
1answer
239 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: ...