Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [tex-core]

{tex-core} is for questions for syntax, semantics and expected behavior of TeX primitive control sequences, regardless of extensions (eTeX, etc.) formats (Plain or LaTeX) and macro packages (tikz). 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}.

7
votes
1answer
64 views

Understanding Implicit Delimiters/Terminators

I hear about macros that do things like "expand until they reach an unexpandable token" and this question may (or may not) be related to that kind of thing and the \romannumeral trick. In particular, ...
1
vote
1answer
27 views

Change color number white listings

I want to write c++ code in latex using listing package, the problem is that when I want change the color numbers in code (integers, doubles...) the only solution I found was this: \lstdefinestyle{...
8
votes
2answers
343 views

What tokens are in the end of line?

Consider the following test.tex: \ERROR a If we run tex on it, and start skipping tokens one by one, we get this: (test.tex ! Undefined control sequence. l.1 \ERROR ? 1 l.2 a ? 1 l.2 a ? 1 ) As ...
5
votes
2answers
146 views

Explanation of TeX’s reading rules in TeXbook

What means the following extract on page 46 of TeXbook? TeX goes into state S in case (c), or in case (b) with respect to a character of category 10 (space) Does it mean that space must be skipped ...
0
votes
1answer
17 views

Nomencl Error - Unable to produce 2nd line of nomenclature

\documentclass[9pt,conference,a4paper,twocolumn]{IEEEtran} \usepackage{cite} \usepackage{amsmath,amssymb,amsfonts} \usepackage{algorithmic} \usepackage{graphicx} \usepackage{textcomp} \...
8
votes
2answers
197 views

Can I have a delimited macro with a literal # in the parameter text?

I'm trying to define a macro which grabs everything until the next # (parameter token). My twisted imagination wants something like this: \def\test#1###2{(#1)[#2]} \test hello#{world} to grab hello ...
7
votes
1answer
98 views

Can I get the output of a command line program with TeX (using e.g. \read18)?

Say I want to call some external program using \write18, which returns some text to the command line. Can I get that text from inside TeX? As an example > inkscape -V returns the version of the ...
5
votes
2answers
127 views

Question about exercise 20.7 in the TeXbook

To which specific examples from answer to exercise 20.7 in TeXbook refers the following part of the answer? Category codes are not shown, but a character of category 6 always appears twice in ...
4
votes
1answer
32 views

filecontents strange coding

When looking inside the filecontents environment in the file latex.ltx (or the similar version in filecontents.sty), I have found this code that I can not understand: \edef\E{\@backslashchar end\...
0
votes
0answers
34 views

Is it possible to let TeX produce a list of unexpandable tokens?

That is, can some configuration of TeX convert a file to a list of tokens such as A_{11} and directly redirect it into an output file without any typesetting?
4
votes
1answer
58 views

Expansion of \ifnum creates a weird \relax token

There was I, procrastinating over some TeX code while I should have been writing my dissertation. The code was working more or less fine (better than the writing, at least), until a mysterious \relax ...
2
votes
1answer
76 views

Texlive 2019xetex fatal error: xdvipdfmx:fatal: Unable to find TFM file “cmssbx8”

Yesterday, i.e. a few days after announcement of the release of TeXLive 2019 I downloaded it and installed on my computer and a portable version on my pendrive. And uninstalled TeXLive 2017 version ...
6
votes
1answer
74 views

Does \expanded replace the \romannumeral trick for expansion?

TeXLive 2019 is here :D One of its awaited features is the new \expanded primitive now available in all of the main engines (only available in LuaTeX in previous years) thanks to Joseph Wright. What ...
0
votes
1answer
33 views

Plain Tex | Setting hanging indent

Returning to TeX after too many years away and so the simplest of tasks is throwing me… I have set up a hanging indent so: \hangindent=12pt \hangafter=1 and an example of my input file is \mark{...
3
votes
1answer
57 views

Work of TeX infix operators

I check a work of TeX infix operators and have some questions. For example, it will be \over. The syntax is {<subformula1> \over <subformula2>}. It is ok, but i noticed that in this case \...
5
votes
1answer
115 views

What is the maximum limit of elements in a list (expl3/xparse)?

I have a query with the maximum number of items that can be saved in an expl3 list. Thanks to the response that @egreg gave me in Avoid passing an empty [optional argument] an environment (with ...
2
votes
1answer
133 views

Latex syntax: parenthesis for \makebox(0,0)

Just wondering where I can find documentation for the following syntax, which is shown at https://tex.stackexchange.com/a/34929/187592? \makebox(0,0){} I thought only [] or {} are the valid brackets ...
0
votes
1answer
143 views

How to transform dynamic data into static data

Maybe I asked this somewhere sometime ago. Is there a way to change dynamic data into static data? I have defined the macro \def\date{\the\day.\the\month.\the\year} With every run of TeX the ...
0
votes
0answers
67 views

How set pdf major version in latex

How to set the major version of pdf in LaTeX? For example, in lualatex I can do: \typeout{pdfmajorversion=2} \typeout{pdfminorversion=0} But in latex I found that I can use \...
1
vote
1answer
29 views

language dependent citations and natbib

This is a question about how BibTeX and TeX interact. In this question: Apalike style several languages the OP asks for a way to get citation callouts with French in one part of the document, and ...
0
votes
1answer
41 views

How much negative space needed? To recognizably remove a space by letting something be added? For macros whose argument is another macro?

Suppose that one has brea + (notice the space at the end). brea + is not printed yet. A macro \m{brea +} will replace + with \added ... how then does one define added, imagine it prints a d but only ...
4
votes
3answers
158 views

Extract more than nine arguments that occur periodically in a sentence to use in macros in order to typset

What is a good way to write a definition of the type \fun below \fun{abc1 EDF1 xyz1 efg jkl abc2 EDF2 xyz2 efg jkl abc3 EDF3 xyz3 efg jkl abc4 EDF2 xyz4 ...} where the number of arguments is not ...
2
votes
1answer
42 views

How to get \baselineskip instead of \lineskip when using a stored box?

Consider this code: \documentclass{article} \begin{document} \pagestyle{empty} \def\contents{% \parindent = 0pt \LARGE \strut \raise\baselineskip \vtop {% {\Large\smash{...
2
votes
1answer
163 views

How to find correct version of TexLive for Ubuntu (or debian based OS)?

I am using Ubuntu 16.04 and installed Tex Live following this link on official site and it showed it is version 2018. But when I use tex --version I get the following output : TeX 3.14159265 (...
2
votes
2answers
242 views

How do you write a macro that takes arguments containing paragraphs?

I'm trying to write a macro that takes arguments containing paragraphs. If you write a normal macro and one of its arguments contains a paragraph, it will break: \documentclass{article} \usepackage[...
1
vote
1answer
59 views

TeX and how to not output the footline/headline on specific page

The title page, any page, no head/footline using plain+etex+opmac, on a per page basis. Is there a manual coding solution to a page macro to relax the foot/headline for the page. Below the "idea" not ...
4
votes
1answer
47 views

Use \let with \csname

My basic question (I think) is: How do I use \let together with \csname ... \endcsname. So basically I'm trying to get this to work: \newcommand{\setcolwidth}[2]{ \expandafter\newlength\csname ...
7
votes
3answers
709 views

Use comma instead of & in table

I am new in LaTeX. In tabular, we generally use & for partition. I want to create a .sty for tabular environment. Replace & with comma delimiter, in this case comma should be work as & ...
11
votes
2answers
495 views

LuaTeX and em dashes

LuaLaTeX is not inserting em dashes unless there is space around the triple dash. It works fine when using a unicode em dash, or explicitly using the \textemdash macro. Here is a MWE: \documentclass{...
1
vote
0answers
41 views

What is the TeX at symbol / @ for? [duplicate]

Edit Note: I am trying to research "switches" (like \chapter), which led to this question. It might be helpful to tag this "switches". I have seen a lot of documentation that appears to be using ...
1
vote
0answers
88 views

Is there a little randomization on TeX default font which is not present in LaTeX default font?

It's more pleasing to me to stare at this... ... than to stare at this... One time Knuth commented that he prefers fonts with a little randomization on their design (Knuth, D. E. (1979). ...
7
votes
1answer
91 views

Can \relax be replaced by a space?

LaTeX defines \vec as \DeclareMathAccent{\vec}{\mathord}{letters}{"7E} which eventually is expanded to \mathaccent"017E\relax whereas plainTeX defines it as \def\vec{\mathaccent"017E } replacing ...
2
votes
1answer
38 views

Undo alternate command definition

I'm working with an automated system that injects some code that redefines the paragraph command: % Redefines (sub)paragraphs to behave more like sections \ifx\paragraph\undefined\else \let\...
14
votes
2answers
180 views

A Question About \futurelet

Here is something I don't understand about \futurelet, in this case, into macro \xfl. I can successfully do the archetypal test of \ifx\xfl x... to test whether the next token is an x. When true, ...
0
votes
0answers
50 views

How to \noexpand all its followings in one time

The macro \noexpand can only block expand of its first followings, i.e. for \noexpand\huge\color{red}, \color{red} is not effected by \noexpand. I want get a way to block expand of all in one time, ...
5
votes
1answer
137 views

Unable calculate value of coordinate by macro constructed by \newcommand in tikz

I construct a macro named \mycal(with an optional argument) to calculate value of coordinates which will be used in \tikz\draw. I find that with this optioal arg, the code can not compile. When the ...
7
votes
2answers
179 views

Non-alphabet letter in \csname …\endcsname

Why can't I get what I want in the following code? MWE: \documentclass{article} \begin{document} % \def\aaa*{*} \def\aaaAAA{AAA} |\csname aaaAAA\endcsname|% typeset |AAA| as I desired. |\csname aaa*\...
2
votes
1answer
114 views

What is the difference between badness and penalty?

What in LaTeX is the difference between badness and penalty? Are badness and penalty the same? In what range are the values for both, badness and penalty?
1
vote
3answers
93 views

@nameuse with value \relax in conditionals

This is a follow-up to this question: @nameuse as conditional where i asked about how to use \expandafter if i combine \@nameuse with \ifx. However, in my real-life example, i use \relax as a default ...
4
votes
2answers
139 views

@nameuse as conditional

Please consider the following, non-working, example: \documentclass{standalone} \makeatletter \parindent\z@ \@namedef{blafasel}{foo} \def\foo{foo} \def\bar{bar} \makeatother \begin{document}...
4
votes
2answers
52 views

Interacting with plain-TeX programs

Is it possible to read from stdin in plain TeX? I have seen that it is possible in LaTeX with \typein (See here), however, this is unavailable in TeX. Are there any alternatives? An MWE in LaTeX: \...
26
votes
4answers
1k views

How to properly smuggle (with or even without TikZ)?

I am seeking to find something that allows me to "broadcast" macros outside a group. Concrete examples include paths and scopes in tizpictures. Here is an M(N)WE. \documentclass[tikz,border=3.14mm]{...
2
votes
2answers
62 views

An acute diacritical mark not being typeset

Why is the umlaut over the "i" typeset but not the acute over the "e" typeset? \documentclass[10pt]{amsart} \usepackage[utf8]{inputenc} \begin{document} \noindent \textbf{10.) The author of Passage ...
2
votes
1answer
91 views

Running bashful on Windows

Since the author of the package \bashful claims: The pack­age may use other Unix shells than bash, but does not work with­out mod­i­fi­ca­tion in a Win­dows en­vi­ron­ment. https://ctan.org/pkg/...
3
votes
1answer
273 views

Different file opened by \openin (was: between 2017 and 2018)

Short version: It seems that some trivial behavior of file opening (\openin) changed between TeX Live 2017 and 2018 differs between environment. Only Overleaf one behaves differently. I did not see ...
6
votes
1answer
106 views

Is there an advantage in converting user provided \hfuzz values to sp?

I was looking through the fancyvrb code. At a point it defines a key hfuzz as follows: \define@key{FV}{hfuzz}{% \@tempdima=#1\relax \edef\fv_hfuzz{\number\@tempdima sp}}} \fvset{hfuzz=2pt} ...
4
votes
3answers
229 views

What command should I use to be warned of this collision beforehand?

After a hunt through several subfiles, I've narrowed down what I thought was a bug down to this MWE \documentclass{article} \usepackage{amsmath, amssymb} \newcommand{\R}{\mathbb{R}} \begin{document} $...
1
vote
1answer
30 views

Tree diagram in same line

I'm trying to put the tree diagrams in the same line but they are coming in different lines. \documentclass[12pt,a4paper]{book} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{mathtools} ...
2
votes
2answers
114 views

An error using \par\xdef\tpd

Why do I get an error message with \par\xdef\tpd{\region\prevdepth} but not with \par\xdef\tpd{\the\prevdepth}? \documentclass{amsart} \usepackage{mathtools} \usepackage[dvipsnames]{xcolor} \...
1
vote
2answers
43 views

Getting the proper interline spacing after a minipage environment

I have a TikZ diagram to the right of a minipage environment. I have some text that I want under the minipage environment. The interline spacing is about half of the other interline spacing. I don't ...