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

6
votes
3answers
146 views

Why cannot the word in the last column be centered

I have the following table: \begin{tabular}{|p{3cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|} \hline \centerline {image} & \multicolumn{2}{c|}{ABC} & \multicolumn{2}{c|}{DEF} \\ \hline & ...
14
votes
2answers
192 views

What is the easiest way to modify catcodes in a string?

Assume that a token register contains a sequence of letter tokens, each having a catcode of 12. I want to store in a second token register the same sequence of letter token, altering some catcodes on ...
0
votes
0answers
29 views

Inserting a line break in a formula [duplicate]

I have the following formula in LaTeX: \begin{equation} =\sqrt[m]{\mid C_{new}\left(pi\right)-f\left(pi\right)\mid^{m}-\mid C_{k}\left(pi\right)-f\left(pi\right)\mid^{m} ...
5
votes
2answers
194 views

How to get character code defined with \let (! Improper alphabetic constant)

Here's a example with the "! Improper alphabetic constant" error: %% this is ok \newcount\mychar \mychar=\number`a\relax \showthe a % shows You can't use `the letter a' after \the ...
4
votes
2answers
119 views

How to define a command \exponent that transforms $\exponent^e$ to $a^eb^ec^e$?

I have tried to define a command $\exponent$ that would look for next exponent and would put a copy of this exponent after a, another after b and a last one after c. $\exponent^e$ would transform to ...
9
votes
3answers
325 views

How to force LaTeX only commands?

Recently, I learned that for a long time I have been doing all of my mathematics in LaTeX incorrectly! I was using the $ TeX commands instead of the \( and \) LaTeX commands! I immediately went back ...
3
votes
0answers
56 views

Tex document that displays its own source code [duplicate]

Just out of curiosity, I was wondering how it is possible to write a LaTeX document which, when compiled, generates a document that contains exactly its own source code (i. e. a quine). Since LaTeX ...
39
votes
2answers
514 views

How to implement (low-level) arrays in TeX

Update: I have revised my question based on the comment by Bruno Le Floch and some further research. As some may know, I'm implementing a huge TeX macro package which has to do a lot of internal ...
12
votes
1answer
330 views

What does \empty do? [duplicate]

What does it do and what are its applications? I am currently testing the subtitle of my beamer presentation for its string length to decide about line spacings. Could it be simpler using \empty? If ...
10
votes
1answer
117 views

TeX doesn't recognize built-in control sequences?

I'm trying to learn to build things from the ground-up with TeX (not LaTeX---I've used LaTeX before, so I know how easy a solution "\usepackage{amsthm}+\begin{theorem}" is) and I'm trying to build my ...
6
votes
0answers
79 views

Testing if inside \halign [closed]

I am trying to write a macro that has a different behavior when called from text mode, math mode, display math, and math tables. The first three are easy enough with \ifmmode and \mathchoice. But the ...
0
votes
0answers
212 views

Weird behaviour in Texmaker (Changing the papersize)

I'm trying to change the page size in a tex document (I want a letterpaper size). I'm using Texmaker and the sequence Latex -> Dvips -> ps2pdf and my code is \documentclass[letterpaper]{report} ...
11
votes
2answers
1k views

\llap (or \rlap) at the begining of an indented paragraph

If I use a \llap{text} command at the begining of an indented paragraph, the text is not indented and is put on the line above the paragraph. \documentclass{article} \begin{document} \parindent=2cm ...
1
vote
1answer
187 views

ConTeXt: How to display last page number (Page # of #) in header/footer?

In LaTeX, I could do something like: \fancyhead[R]{\HeaderFont{\thepage{}/\pageref{LastPage}}} and/or \fancyfoot[R]{\FooterFont{\thepage{}/\pageref{LastPage}}} How to achieve the same with ...
0
votes
1answer
154 views

ConTeXt: How to maximize width of column depending on fixed sizes of other columns?

In LaTex, I could do something like: \newcolumntype{C}[1] {>{\centering\let\newline\\\arraybackslash\hspace{0pt}}p{#1}} \newcolumntype{L}[1] ...
7
votes
1answer
984 views

\newcounter vs \newcount [duplicate]

What are the differences between \newcounter vs \newcount? So far as my knowledge goes \newcounter is from LaTeX and \newcount is from TeX. Also, I find that \newcounter has an optional automatic ...
11
votes
1answer
352 views

What is the function of \noalign?

The use of \noalign is quite common. For example here \noalign is used with \vskip{}to control the height of a table cell. How does \noalign work in general, and how does it work with \vskip? ...
5
votes
2answers
145 views

Obtaining “greedy” pattern-matching in macros

Consider the following input to TeX: This is TeX, Version 3.1415926 (TeX Live 2013) **\def\a#1\par{[#1]} *\def\b#1\par{(#1)} *\a\b five\par\par *\end Two definitions have the same delimiter, so ...
4
votes
1answer
85 views

Expanding a variable within a protected label

I have some trouble with expanding variables within a protected label. I need a automatisated caption with a label all inside a command. Within the caption I want to have a two digit number ...
9
votes
1answer
141 views

How can I create a better cryptogram environment?

I put together a macro that takes two arguments. The first argument is a string of letters which defines a cipher. The second argument is a message to be encrypted using this cipher. ...
11
votes
1answer
87 views

\toks register expansion issue - or is it?

I am trying to assemble a table that occurs multiple times throughout a document. It always consists of some fixed columns, followed by a set of columns that appear in one table but are not needed in ...
11
votes
2answers
197 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
75 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
156 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
117 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
155 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
79 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
239 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
137 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
871 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
274 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
1k 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
756 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
77 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
2k 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
118 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
61 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
56 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
74 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
178 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
678 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
182 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
81 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
287 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
178 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
393 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 ...
7
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
202 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}} ...