{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
2answers
152 views

Allowing first undelimited argument to be empty

Consider the following macro definitions: \def\mymacro#1{\mymacroii#1\nil} \def\mymacroii#1#2\nil{% \ifx\\#1\\% empty% \else #1% \fi }% \mymacro{foo}% -> f \mymacro{} \bye This is ...
3
votes
1answer
58 views

Alignment problem or the height of one text line for \footnotesize text

I want to align the arrows so that it goes directly through the "x". How can I do this? It works if I use \normalsize font. The background is that I want to separate my Tikz document in text rows ...
138
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 ...
8
votes
1answer
79 views

Hyphenation of the word “paraboloid”

It seems like my TeX does not hyphenate the word "paraboloid" on its own. After adding \hyphenation{para-boloid} (I hope that's the right hyphenation...) to the preamble everything is fine. My ...
4
votes
6answers
396 views

A meta-language for LaTeX

Whenever I write TeX/LaTeX documents, I always find that annoying because I can't really focus on the content, It's not that I don't like TeX or what it does for me, it's just the fact that the ...
5
votes
1answer
226 views

Changing page margins in {pdf-,Xe-}TeX

In TeX, changing the \hsize and the \vsize changes the main text size and the page size of the dvi output. When I compile a document with pdftex or xetex, the page size remains at A4. How can I change ...
12
votes
2answers
381 views

All about \shipout

While reading about packages that allow to hook macros to certain events, I came across this command, \shipout. Searching on the internet didn't help a lot but if I'm not so wrong it's somehow related ...
6
votes
1answer
75 views

Getting the page breaks right for a \beginsection macro

I've found this code in the question No indent in the first paragraph in a section in Plain TeX \def\mysection#1{% \goodbreak \vskip2\baselineskip \noindent #1\par \nobreak ...
5
votes
1answer
67 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 ...
6
votes
2answers
371 views

Can you do all what you want with TeX?

With LaTeX, I know you can put pictures in the documents, use different fonts, ... and practically do whatever you want (except the fact that your document must have a predefined style, imposed by the ...
4
votes
5answers
666 views

Continuously-sizable fonts?

Why are we stuck with a finite number of font sizes in LaTeX? Modern fonts are fully vector-based and scalable - why can't LaTeX do this? Or maybe it can, and I just don't know how. Also see the ...
13
votes
3answers
2k views

How to use \valign?

I just bumped into a interesting command called \valign. It seems to be the sister of \halign, but the TeXbook seems to be rather shy on explaining its use. As is the TeX by Topic. They only mention ...
7
votes
3answers
185 views

How can I parse the first word in a token stream, token by token?

Some programming editors and IDEs highlight legal and illegal variable names in different ways. I wish listings easily allowed for such syntax checking and highlighting, but it doesn't, at least at ...
38
votes
2answers
495 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 ...
11
votes
1answer
142 views

XeTeXpicfile in vertical mode

Given a minimal like \line{% \vtop{\hsize=.6\hsize Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse tempor lectus sit amet laoreet convallis. Quisque at est lacinia, porttitor ...
0
votes
0answers
37 views

How can the following table be created in LaTeX [duplicate]

I have asked this question here, and asking it once again, as it was marked as duplicate, although it is different from the links that were pointed to be the same as the question. So, how can I ...
6
votes
3answers
135 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 & ...
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} ...
9
votes
3answers
317 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 ...
5
votes
2answers
146 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
118 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 ...
12
votes
1answer
182 views

Array functionality in TeX?

I've been using LaTeX for a while, but only recently I made myself a mission to create a class. I needed to learn the details of TeX, and I couldn't find answers to some of my questions. One of them ...
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 ...
12
votes
1answer
270 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 ...
0
votes
0answers
174 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} ...
10
votes
1answer
107 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
78 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 ...
9
votes
2answers
695 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
172 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 ...
5
votes
1answer
131 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 ...
0
votes
1answer
137 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] ...
26
votes
3answers
666 views

When is it better to use \par than \endgraf?

Just yesterday I had to patch a package file (changing the description to indicate that the file had changed) to replace some \par to \endgraf because the code had bad interactions with non-\long ...
7
votes
1answer
797 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
237 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
133 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 ...
18
votes
1answer
257 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 ...
4
votes
1answer
79 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
134 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. ...
10
votes
1answer
82 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
194 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
70 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 ...
2
votes
0answers
146 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. ...
8
votes
1answer
114 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 ...
12
votes
2answers
229 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
134 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
75 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}} ...
3
votes
2answers
844 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
470 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 ...
11
votes
2answers
242 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 ...
23
votes
1answer
603 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 ...