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

0
votes
1answer
15 views

Comma as letter and semicolon as operator in math formulas

Inside document source2e.pdf there are the following two lines \DeclareMathSymbol{,}{\mathpunct}{letters}{"3B} \DeclareMathSymbol{;}{\mathpunct}{operators}{"3B} which treats these two punctuation ...
3
votes
2answers
65 views

Define command to act like \ifvar

I'm trying to manipulate multiple boolean variables which are simply named one, two, three, etc. and since I'm using them with a counter, I have defined some commands to take a numerical input and ...
4
votes
2answers
19 views

How to \show the code of the command \autoref? [duplicate]

Edit: I think this is a duplicate of How can I see the "implementation" of the \LaTeX command? . I wanted to see the code for the hyperref \autoref command, so created this simple document: ...
14
votes
1answer
116 views

formal syntax rules of \dimexpr \numexpr \glueexpr

After looking at various answers on the site and by looking at the documentation of e-tex, I am still wondering what is exactly allowed in the various types of expressions, i.e. \numexpr, \dimexpr and ...
1
vote
0answers
29 views

Different font style on different OS

I use gnuplot for generating eps-figs including text labels which are organized in a separate .tex-file which in turn I include in my main document. With pdflatex TexNicCenter generates the ...
2
votes
1answer
84 views
+50

Alignment in an enumerate environment using “\hspace” and “\hphantom” commands

I give a display of the first three problems from a multiple-choice test in algebra. The choices in the first problem are displayed using a tabbing environment, and the choices in the second and third ...
3
votes
1answer
39 views

Is there any way to read arbitrary part of external tex file?

I am not expert in tex programming, sorry if I am asking a simple question. I need to include an external tex file in a master one but after excluding its preamble and the commands of \begin{document} ...
7
votes
2answers
444 views

Is there a complete modern book which explains how a TeX parser works?

Hi I am reading 'The TEXbook' by Donald E. Knuth. But in my point of view is very didactic for people who want to learn TeX. Most of the pages contain exercises. But many things of how a TeX ...
10
votes
1answer
165 views

Detecting the end of line

Minimal working example: \documentclass{article} \usepackage{color} \newcommand{\mytextcolor}[2]{\textbf{1}\textcolor{#1}{#2}\textbf{2}} \begin{document} This is \mytextcolor{red}{red color} rest of ...
1
vote
1answer
24 views

Table changes distance to preceding line depending on rows

This seems to be such a simple issue, but I still have not found an answer to this question. I am using a non-float tabular environment. Depending on how many rows my table has, the distance to the ...
18
votes
3answers
796 views

What is a “Control Sequence”?

When you get an error in LaTeX, the message "Undefined control sequence" is printed. Why is it called "control sequence" and not "command", for example? How does the sequence work? Is this a TeX or ...
5
votes
1answer
74 views

Segmenting a Bezier curve into equal lengths in tikz/pgf

I'm trying to draw two curves and then create equal sized segments/arcs using pgf/tikz but for some reason the segments are not equally sized. I want to go on and fill each segment with a different ...
12
votes
4answers
324 views

Ratio arithmetic in plain TeX

I would like to calculate the ratio between two dimensions and produce a dimensionless quantity for use in further calculation in the process. I seem to be unable to do so. Specifically, I run into ...
2
votes
0answers
47 views

Where is screed.tex? [closed]

In TeX for the Impatient, Chapter 2, Page 9, it asks to try compiling screed.tex. Where is screed.tex and why did the author not explain what it is?
11
votes
3answers
266 views

Treating the contents of a TeX-style group ({\blah …}) as macro arguments

I am trying to make adjustments to a large document that uses TeX-style macros, like this: {\defun SomeFunctionName arg1 arg2} The \defun macro is defined as \newcommand{\defun}{\tt}. Can I ...
0
votes
0answers
60 views

How to go about learning to program in Tex? [duplicate]

I have been using Tex for a few years now and enjoyed the work of others (e.g., ctan packages, templates, styles). My question sees to practical code to learn from. What would be a good primer, or ...
8
votes
1answer
65 views

Is it possible to adjust the “quantization” of allowable skip lengths?

In plain TeX and derivative formats, the concept of stretchable/shrinkable length, AKA a glue or a skip or a rubber length exists, in general defined as <dimen> plus <stretch-dimen> minus ...
3
votes
1answer
62 views

TeX expert needed: how to \setto(optimal)width?

there is a problem I have been trying to solve for a while but without success so far. As far as I know, TeX is very good at appropriately breaking text lines with respect to a fixed container width. ...
2
votes
0answers
53 views

Rendering text as image to protect e-mail address

I want to protect my e-mail address against spammers by including it as image instead of a (parsable) text. Normally I would have to create the image (with text) by myself and include this as figure. ...
8
votes
5answers
319 views

A more elegant version of the \ifnot macro

A TUGboat article of 15 years ago mentions an \ifnot macro by David Kastrup whose implementation is: \def\ifnot#1{#1\else \expandafter\expandafter\fi \iffalse\iftrue\fi} However, this macro ...
14
votes
2answers
223 views

How can own commands be aware of \global?

When I define a command that defines commands \def\makefoobar{ \def\foo{foo} \def\bar{bar} } and prefix it with \global { \global\makefoobar } it is treated like { \global\def\foo{foo} ...
7
votes
1answer
109 views

How do counts differ from numexpr

To do basic arithmetic on numbers, one can utilize TeX counts, \newcount\c \c=2 \advance\c 3 \typeout{\the\c} LaTeX counters \newcounter{c} \setcounter{c}{2} \addtocounter{c}{3} \typeout{\thec} ...
1
vote
1answer
48 views

How could I write a Latex tag in source form in section name?

I tried to use \verb|| and \lstinline[language={[LaTeX]TeX}]{} and they failed. I just want to write a name of latex tags in section names for internal purposes. For example, I couldn't compile a ...
11
votes
2answers
86 views

split off function for variable as separator

How/Possible to change this implementation of \xSplit so that the separator is a variable filled in at the time of definition (\edef somehow?) or at the actual use of the command?? %based on the ...
12
votes
1answer
144 views

Inserting tokens at end of math mode

One can use \everymath and \everydisplay to insert tokens at the beginning of math mode, but what about inserting tokens at end of math mode? Lets say I want to enclose the math mode material in a ...
3
votes
2answers
105 views

Redefining line break (double backslash) for align environment

I am trying to figure out if it is possible to (locally) redefine \\ (double backslash) within amsmath's align environment. On the one hand, I'd like to be able to dynamically insert extra columns, on ...
3
votes
1answer
76 views

How to avoid typesetting any cell if a table is empty

Following How can I define a macro that adds a row to a table that has not yet been printed?, I came up with a macro (\AddToTable) that “builds” a table, i.e. appends its argument as the last row of ...
11
votes
5answers
468 views

Basics of scanning

I'm trying to master the art of scanning text one character at a time. The following is what I've discovered so far. Is this as good as it gets? I would really prefer not to do all those \edefs as ...
0
votes
0answers
19 views

widesplit macro explanation [duplicate]

Could you please explain how this macro function ? \def\widesplit#1{% \cleardoublepage \def\row##1##2{##1}% #1% \clearpage \def\row##1##2{##2}% #1% \clearpage } OK, some things are clear to me. def ...
10
votes
1answer
93 views

assign penalty to one discretionary (not all paragraph)

For a quite complex problem that would be too long to describe, I need to set different penalties for different discretionaries in the same paragraphe. It doesn't seem to be possible with pdfTeX (and ...
19
votes
2answers
410 views

\expandafter and \aftergroup: where do the 2n+1 and n^2-1 rules come from?

Both TeX primitives \expandafter and \aftergroup have "rules of thumb" stating that \expandafter should be used 2n+1 times to look n tokens ahead (is this correct?). A similar "rule of thumb" holds ...
1
vote
0answers
88 views

Memory overload due to pgfplots / tikz

first of all, I need to mention that there are 2 related threads, that I found usefull: 1, 2. I am working with TeXstudio 2.8.8 on Win 7 64bit (i5 @3.3GHz, 8GB RAM - if this matters). My goal is to ...
1
vote
1answer
56 views

Passing values from PythonTeX to LaTeX

I have read in the PythonTeX manual about how to pass LaTeX values to PythonTeX, but I cannot find any documentation (or a way) to do the reverse. For example, in the LaTeX package datenumber, one ...
3
votes
1answer
49 views

Specifying coordinates with \def in PSTricks

I'm starting with PSTricks. I use the following macro to set cartesian coordinates: \def\newPoint#1(#2,#3) { \expandafter\def\csname x#1\endcsname{#2} \expandafter\def\csname ...
0
votes
0answers
84 views

TeX capacity exceeded, sorry [input stack size=5000]

I am trying to compile the first three chapters of my dissertation but I am getting the following error: Errors: ./EQM-TAR.tex:70: Undefined control sequence. [\paginaresumo] ./EQM-TAR.tex:70: TeX ...
7
votes
1answer
178 views

What does mathchar do?

The package cmll defines \with (looks like '&') as $ texdef -t latex -p cmll with \with: \mathchar"2026 \the\with: 8230 When I take a look at \& it is defined as texdef -t latex \& ...
1
vote
0answers
72 views

What is the core of TeX as a programming language? [closed]

Tex (and LaTeX) mix programming elements with typesetting ones. It's often confusing to a beginner to tell them apart. Could anyone show me a list of the very core commands of TeX (and perhaps LaTeX) ...
4
votes
2answers
129 views

plain TeX error. Undefined control sequence. \pgfutil@

I'm trying to compile the fix mentioned by egreg in this thread: Strange behaviour with PGF/TikZ and Plain TeX output routine Here's the code: \input pgf \catcode`@=11 \newbox\pgfutil@@Output@Box ...
19
votes
1answer
376 views

How do I get into XeTeX development?

The support for OpenType fonts has been a great advancement in terms of usability. Unfortunately the microtype package does not offer font expansion for OpenType fonts in XeTeX. I dug a little ...
12
votes
2answers
217 views

Assertions in Latex

I am writing a long latex document and use many macros for defining mathematical symbols. I would like to ensure that there is no clash in the notation. For example, something like ...
3
votes
0answers
60 views

plain TeX and paragraphed notes

The TeXbook proposes, p. 398sq, a system to obtain paragraphed note. That is, instead to obtain Footnote. Footnote. Footnote obtain : Footnote 2. Footnote 3. Footnote. In ...
11
votes
1answer
147 views

Why this output using \string on the empty csname

How does this exactly work? \expandafter\string\csname\endcsname I don't know what I would expect to come from there, but definitely not \csname\endcsname_ where _ is a space. I thought ...
7
votes
1answer
243 views

What is this file and how to compile and tranform it?

I was given some files to update. They were produced in late 1990s and seemed to be related to LaTeX. However, I could not compile them at all. To begin with, there is no \begin{} or \end{}. In ...
2
votes
1answer
75 views

Redefine a primitive parameter

I want to redefine a primitive parameter as a macro, and make the macro behaves the same as the primitive parameter in some situations. \tracingcommands = 1 \the\tracingcommands ...
8
votes
3answers
111 views

Appending active and expansion sensitive characters to a macro

This question comes up pretty often when people want to build tables with empty columns or similarly building up some active characters inside a macro hoping to expand them at the right time right ...
6
votes
1answer
73 views

An insert macro

Once in a while I try to understand how TeX works... Hitherto now success, but sometimes I manage to define a macro. For example, \def\appendto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}% ...
1
vote
1answer
118 views

Can openout handle a filename with spaces?

With pdflatex, can \openout handle a filename with a space in it? (We're using MiKTeX and our users seem to think it's clunky to restrict them in this way. We also have tons of legacy TeX files and ...
3
votes
1answer
67 views

Typesetting text in multiple languages without repeating the text

I am working on typesetting an Indian text in three languages using ITRANS + XeTeX. I have pasted an example below. How do I avoid having to repeat the text for getting three different outputs. Can I ...
1
vote
1answer
90 views

cryptic plain TeX: Twelve days of Christmas

Many years ago, probably in TUGboat, I saw a shortish piece of \TeX\ that immediately deploys catcodes and very quickly becomes completely unreadable, but when typeset produces the old "twelve days ...
1
vote
1answer
111 views

\newcommand in imsart package

I am currently using the imsart package provided by http://www.e-publications.org/ims/support/ims-instructions.html However, it seems the pdfLatex/Latex/pdfTex/pdfTexify compilers cannot read one ...