{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}.
5
votes
1answer
264 views
A \typeout (or expandable command) that can expand once - or with variable levels of expansion?
Consider the following MWE:
\documentclass[12pt]{article}
\begin{document}
\def\aaa{something}
\typeout{=1==\aaa==}
\typeout{=1==\meaning\aaa==}
\typeout{}
\def\bbb{else \aaa, else}
...
3
votes
2answers
584 views
Output ASCII code as character on terminal in Latex?
If I have a letter/character, I can output its ASCII value using \number and backtick command:
*\typeout{\number`a}
97
What do I do if I have "97", and I want to show "a" in terminal? I have ...
2
votes
1answer
190 views
Generating a catcode table in Latex (with \typeout to terminal)?
I often need to look up a catcode table, and quick searches on the web are rarely satisfying.
So I thought, it must be (in the long term) easier to use a Latex function of sorts, to loop through all ...
6
votes
1answer
167 views
TeX equivalent to #line
In C there is #line which allows stating the origin of a particular line of code. This is useful for autogenerated C source files: The (unreadable) code in the generated file is mapped back to the ...
5
votes
1answer
86 views
Preventing atoms from changing kind
In the example below, the presence of \mycommand changes the first minus sign into a binary operation atom, so that the spacing between - and 1 is increased.
\documentclass{article}
...
9
votes
2answers
175 views
Missing baselineskips?
Here are some cases where when there is stuff inside a vbox, the baselineskips are sometimes there and sometimes not. Or maybe it's something else that is producing the differences?
\setbox0\vbox{% ...
3
votes
0answers
130 views
Passthrough TeX input [closed]
I need to convert a document that was written in TeX to some other format.
The other format supports a TeX style mathmode, so I would like to turn every mathmode formula into verbatim.
I tried ...
2
votes
1answer
127 views
Use the catchfile package to preprocess an input file character by character?
Is it possible to read a file using the \CatchFileDef or \CatchFileEdef commands from the catchfile package and then output its exact copy to another file? What about input and output encoding? Do ...
8
votes
1answer
485 views
Handling \ifnum's “! Missing number, treated as zero.”
Let's say I have a variable, which may - or may NOT - be a number; how can I handle the cases when it isn't a number, without crashing with "! Missing number, treated as zero." ?
In practical terms, ...
2
votes
1answer
653 views
Font is not embedded
I need to create pdf file with all fonts embedded (from tex source).
But, as I understood, the most common fonts are not embedded by default. Therefore I have problems:
? 8 Error Font Times-Bold is ...
3
votes
2answers
118 views
Testing if a token list can be assigned to a \dimendef'd quantity
Given an arbitrary token list (say 01abpt), how does one check that it can be assigned to a dimension (say \@tempdima)? LaTeX \@defaultunits wasn't made for this type of test. If the token list is of ...
29
votes
4answers
1k views
A critique of TeX?
Is there any informative critique of TeX along one or all the lines below:
TeX, the typesetting engine (including its algorithms)
TeX, the typesetting language
TeX, the programming language
TeX, the ...
9
votes
2answers
136 views
Local allocation of registers
I saw the following code in an issue of TUGboat (Volume 9, 1988, No. 3). I have modified it slightly. The motive was to avoid allocating registers globally. My questions are (1) How safe is it for ...
7
votes
1answer
165 views
Using tokens derived from \let
It seems that tokens that are derived from \let command can't always be used literally. The following fails. I want to test if the next character is a numerical constant. Of course, the test is not ...
5
votes
1answer
242 views
Outputting a spread at a time
I think I remember Stephan Lehmke writing here somewhere in a comment about outputting a spread at a time instead of page.
That got me thinking; does that mean something like:
\output={\shipout\vbox ...
5
votes
2answers
168 views
Output routine and \box255
The \box255 referred to in this question applies only to the container of the latest chunk of the MVL, as cut by the page builder. Now the question: I read somewhere that
\setbox0=\vbox to ...
50
votes
9answers
2k views
Are there any disadvantages of TeX being Turing complete?
I have read that TeX is Turing complete. I was wondering if making TeX Turing complete gave raise to unwanted effects.
3
votes
2answers
2k views
How to install custom sty files where the LaTeX compiler can find them?
I created a custom beamer style. For this I have several .sty files. I am able to install this custom theme on my Ubuntu 12.04 with the standard tex-live provided distribution by putting it my home as ...
2
votes
2answers
178 views
An expandable 'character scanning' command?
Please consider the following MWE, for a "character scanning" command "\looper" which utilizes \@tfor:
\documentclass{minimal}
\usepackage{trace}
\makeatletter
\newcommand\looper[1]{%
% ...
3
votes
1answer
136 views
Showing expanded `\let` command with `\typeout`
I have already seen the related page macros - What is the difference between \let and \edef?, but I'm afraid it still doesn't expain to me the following MWE:
\documentclass{minimal}
...
16
votes
2answers
228 views
What is \box255?
I'm just reading the everyshi manual, and it says:
This package provides the hooks \EveryShipout and \AtNextShipout
whose arguments are executed after the output routine has constructed
...
8
votes
2answers
226 views
Normal \relax vs. frozen \relax
With
\edef\x{\ifnum0=0\else\fi}
being \relax and with
\def\y{\relax}
we see that \ifx\x\y is false. Why?
See also \ifcsname when it isn't apparent that the command is \relax'ed.
6
votes
3answers
265 views
\ifcsname x\endcsname when it isn't apparent that \x was made \relax
A few days ago I tried to point out to Will Robertson one of the pitfalls of eTeX’s \ifcsname and \ifdefined but he didn’t seem to get the message. Please am I right in saying that the following ...
5
votes
2answers
239 views
On unprotecting (expanding) \protected macros (or, “the space after command name”)
I quite often come into a situation, where I need to obtain some text produced by a package macro as a string, like in say:
Expanding (edef) a lipsum command?
How do I "unprotect" an ...
7
votes
2answers
84 views
Changing the refpoint of splittopskip?
The following example has the setting:
\splittopskip=.3cm
However in the output I can't see any vertical space. It seems that \vsplit starts the computing of the height at the baseline. How can I ...
1
vote
2answers
348 views
String equality in \ifx conditional using output from concatenating macros
Please consider the following MWE - where I try to test for string equality between an parameter, and a test string prepared by a macro:
\documentclass{article}
\def\testStr#1{IOIO#1}
...
4
votes
1answer
251 views
String parsing macro fails within a minipage environment? [closed]
I am trying to work with a string parsing macro, found in the answer of TeX capacity exceeded while parsing a date string - TeX - LaTeX.
Basically, I have strings num01, num02... num09 - from these, ...
2
votes
2answers
111 views
Generating pages in response to iterated parameter on engine level?
Just to jot this down here, while I have the thought: The method I used for the .gif animations in Why does \vspace, after section heading, sometimes jump/snap in discrete steps? was basically have a ...
4
votes
1answer
93 views
How can I remove a vertical skip added by splittopskip?
The following example splits a box with the setting \splittopskip=2cm. Everything works as expected. However I want to remove the vertical skip add by \splittopskip=2cm some steps later.
Is there an ...
5
votes
3answers
189 views
\settowidth problem in tikz and in groups
I just came to the following problem - using \settowidth on a length in a tikzpicture resets that length to 0? Here is a (totally command-line) MWE, compiled with pdflatex test.tex:
...
3
votes
2answers
174 views
Flush latex file io buffers
Is there any way to flush latex's file io buffers. Because of something I'm trying to achieve I have to copy/modify the outputted pdf after it is created(but in the same compile run). The problem is, ...
4
votes
1answer
166 views
Luatex os.execute not working
I've hooked luatex's stop_run callback so I can do some processing on the output pdf after it is generated.
To process the pdf I need to call os.execute. When doing so I an error saying "All command ...
19
votes
3answers
439 views
Display hyphenation options for a specific word
When TeX produces Overfull box, is puts something like this in the log:
Overfull \hbox (15.47195pt too wide) in paragraph at lines 7--9
[]\OT1/cmr/m/n/10 I re-ally re-ally want to get dis-played the ...
0
votes
2answers
184 views
TeX Programming questions (and stuff about parcolumns)
I'm trying to modify the inner workings of parcolumns. I'm starting to understand the TeX macro "programming" language a bit but I have some issues.
In paracolumns there are three issues I want to ...
10
votes
2answers
289 views
Starting point for getting more familiar with TeX/LaTex etc
Background: I've been using what I would call LaTex for ~4 yrs to typeset assignments, reports, essays and tutorial notes. I have been using "TexShop" (for Macs) - mostly because it was simple when I ...
6
votes
2answers
337 views
How to check if a value is not equal using TeX conditionals?
I have a value defined in a macro, e.g.:
\mymacro{apple}
I need to check if a value does not equal a string, e.g.:
IF #1 NOT EQUAL TO "apple" THEN
PRINT "It is not a apple, it is #1."
FI
I ...
15
votes
2answers
2k views
Difference between setting parindent and hangindent
Is there a difference between setting
\parindent to 1em
and to setting
\parindent to 0em, \hangindent to 1em, and \hangafter to -1
that shows in practical use? The nodes created by TeX are ...
4
votes
2answers
170 views
Active character and delimited argument
Say I have a macro \foo that takes one argument, delimited at start and at end by a !. The problem is that I don't know at the time of the call of \foo if ! has been made \active by, say, french ...
4
votes
0answers
181 views
TeX-run-Tex wrong type argument in emacs
I use such a function for compiling LaTeX in emacs (AUCTeX) taken from here (accepted answer by Jouni K. Seppänen):
(defun run-latexmkk ()
(interactive)
(let ((TeX-save-query nil)
...
1
vote
1answer
159 views
Unexpected scoping issue using \XeTeXinterchartoks
Minimal example (compile with xetex):
\XeTeXinterchartokenstate = 1
\newXeTeXintercharclass \classa
\XeTeXcharclass `\a \classa
\XeTeXinterchartoks 255 \classa = {\begingroup}
\XeTeXinterchartoks ...
3
votes
3answers
1k views
Compile Tex inside Microsoft C#.net
I know there are some command-line applications like pdflatex that can help me to compile a LaTex document from C#.Net (using the System.Diagnostics.Process class) .
I wanna know that what's the ...
1
vote
0answers
68 views
How to print the newline character “\\” from a macro so that it is recognized as newline in tabular [duplicate]
Possible Duplicate:
How to programmatically make tabular rows using \\whiledo ?
I have a problem that may have an interesting answer. I am writing a macro whose output I would like to be a ...
5
votes
3answers
156 views
How to set two or more paragraphs to use the same amount of vertical space?
Given several paragraphs in ConTeXt or plain TeX, how can I ensure that all paragraphs use the same amount of vertical space, by adding white space to the end, as the longest paragraph in the set? ...
9
votes
1answer
226 views
What documentation thoroughly explains how to use TeX conditionals?
I have a document which needs a large variety of plain TeX conditionals, e.g.:
IF #1 >= 1 AND #2 >= 10
IF #1 != “tree” OR #2 == “mountain”
IF 10 > #1 > 2
I have found limited ...
24
votes
4answers
2k views
How to check if a macro value is empty or will not create text with plain TeX conditionals?
I have a macro which holds some text value, e.g. \macro{some text}. If it is empty, I would like for nothing to appear in the document, but it has some content of any kind which would produce text ...
5
votes
4answers
179 views
Meta definition of diacritical marks
Could someone tell me at least approximately where in the bowels of TeX I could find the definition of various accents/decorations going on letters, such as the cedilla?
8
votes
3answers
330 views
How to make a plain TeX conditional which checks if some specific numbers are present?
I need to make a simple conditional in a macro. If #1 is "1", "2", "3", "4", "5", or "6", then print Text: #1, otherwise, do nothing, even if it is empty. I tried this code:
\ifnum#1=1
Text:~#1
...
9
votes
2answers
501 views
What is the plain TeX equivalent of \settowidth?
The \settowidth command, which sets a width equal to the width of some text, is described at Get width of a given text as length and How to set the width of the label of a description to the width of ...
1
vote
1answer
160 views
What Linux operating system contains patgen for hyphenation?
This question follows previous one. In TexLive, patgen command prompts error of "No such file or directory". I found at About.com that Linux contains patgen. I have Linux Red Hat 9.0 in my system. Can ...
5
votes
1answer
281 views
What is the proper way to prevent text from splitting across columns and pages?
I have some description environments which I do not wish to have split across columns or pages. Is there some command which can be placed around an item to ensure that it will never be split across ...
