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

44
votes
4answers
2k views

What is “expansion”?

I'm relatively new to (La)TeX, but I have a reasonable amount of experience with computational programming languages. Until I began learning (La)TeX, I'd never heard of "expansion"... So, what is ...
2
votes
0answers
90 views

Why does LaTeX impose a memory limit of 8,000,000 and can I circumvent it? [duplicate]

A few people have already asked the question of how to increase the maximum memory LaTeX is allowed to use (see here and here) because it is quite common for LaTeX to run out of memory when using, for ...
19
votes
3answers
1k views

Obfuscating TeX

Given TeX's system of catcodes, I imagine that one can obfuscate TeX to a remarkable degree. With a view to learning more about the internals of TeX, I ask: How might I go about adding a block of ...
23
votes
1answer
350 views

The \lowercase trick

We have a number of questions or rather answers using (and explaining) the \lowercase “trick”. \begingroup \lccode`\~=`\. \lowercase{\endgroup\def~}#1{foo with #1} However, after reading on ...
5
votes
0answers
61 views

Namespace in luatex

Is it possible from luatex access registers where all names of command sequences are stored. Is it possible to pull out this list of names? I am looking for a way to trace how namespace changes during ...
3
votes
1answer
75 views

What can I do if I want to have a system for compilation to (AMS) LaTeX regarding restrictions to user-defined macros?

So I want to have a system where some user document is fully processed by TeX engine (full TeX engine!) and some data is collected to some helper file (saying "helper" just not make you think it's ...
76
votes
2answers
6k views

What's new in TeX, version 3.14159265?

The new Knuth TeX has been released in early this month, and its version number is 3.14159265 now. It can be downloaded here. What's new in this release? And a further-more question, where can one ...
8
votes
1answer
136 views

Cut last word from sentence one by one

I want to execute particular command for some space separated list as argument. And then execute the same command for the same list without last element and do it until list is empty. As extra point ...
6
votes
2answers
172 views

Counters and macros?

Not sure how I should post my question but here it is: I've seen that in plain TeX, \newcount is illegal inside a macro \definition. Is there a way to allocate a register inside a macro? Also, if I ...
23
votes
2answers
511 views

Backward definition of (La)TeX commands

Again and again I see, that TeXnicians define commands and do several things with them in the reverse order, I would do this as amateur. See this example: In his answer to scrpage2: Three ...
3
votes
0answers
144 views

Can (La)TeX be a compelling technology for the humanities, journalism, and other non-technical disciplines? [closed]

All over the web, I see how LaTeX has been successful as a way of describing mathematical notation, which makes it pretty easy to argue that it is a compelling technology for science, technology, ...
6
votes
2answers
154 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
80 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 ...
5
votes
6answers
409 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
245 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
407 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
76 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
68 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
375 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
669 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
194 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
499 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
145 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
139 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
321 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
163 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
183 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
295 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
188 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
112 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
899 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
179 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
142 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
144 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
681 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
875 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
277 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
137 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
261 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
81 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
138 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
85 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 ...