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}.

0
votes
1answer
61 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
60 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
28 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
0answers
54 views

Expand one more time as needed? To compose with a macro that requires a maximally expanded argument?

Consider the case below as a minimal example. But the questions concerns understanding nonfragile composition of macros each which parse using something like xparse. (code below thanks to egreg) \...
0
votes
1answer
38 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
155 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
34 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
90 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
231 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
55 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
40 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
683 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
480 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
38 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
86 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
88 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
29 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\...
15
votes
2answers
175 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
47 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
130 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
177 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
99 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
85 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
138 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}...
3
votes
2answers
49 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: \...
25
votes
3answers
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
88 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 ...
7
votes
1answer
105 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
29 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
113 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
42 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 ...
5
votes
3answers
131 views

Iterate over tokens

Assume I have a macro like \def\myMacro#1{<some stuff>} And I am calling it like this \myMacro{There are \some arguments \in \here g} How can I iterate over each single token in the #1 ...
3
votes
1answer
177 views

Check if macro is fully expandable

Question Is there a way to check whether a macro is fully expandable (or rather "safe in an expansion-only context" [1])? Consider this code: \def\a{Just a string} \def\b{\a} \def\c{\def\unsafe} \...
2
votes
1answer
23 views

Is it possible to write a class file that loops over the documentbody?

What I would like to achieve is a repeat.cls such that I could write a .tex file \documentclass{repeat} \begin{document} foobar \end{document} and then the document would contain 'foobar' a certain ...
1
vote
0answers
58 views

Is there any way to free up the TeX memory?

As described in this quesion TeX memory is very limited due to the limitation of the computer in time of TeX invention. I want to know is there any way to free up the TeX memory before reaching its ...
2
votes
1answer
217 views

Problem with | (\vert) in LaTeX

I am using a stylesheet to convert MathML to LaTeX. When I try to convert: <mrow> <mo>|</mo> <mi>a</mi> <mo>|</mo> </mrow> In latex that ...
0
votes
1answer
39 views

Defining colors in style file by forcing immediate expansion

I am writing a template for a poster (using beamer/beamerposter) package for students that I intend to distribute as a folder. It will contain a .tex file that the students can start editing, and a ...
3
votes
1answer
137 views

Write TeX Engine

What do I required if I want to write a TeX engine. Now I am reading The TeXBook, when I finished, I will read source2e next. Thus I am pretty curious about how to write a TeX engine myself, and what ...
3
votes
1answer
40 views

Overfull in vbox inside hbox with hsize of the same width

While learning with Plain TeX, I am trying to create a framed paragraph. I have started with the following code, which is supposed to limit the paragraph width but still enable the line breaking ...
6
votes
1answer
239 views

How to use packages in Plain TeX?

How to use packages in Plain TeX? Are there any packages for Plain TeX at all or are packages a feature only for LaTeX?
1
vote
1answer
92 views

TeX macro/primitive vs Plain TeX macro

I know there are TeX primitives and Plain TeX macros created (directly/indirectly) by TeX primitives. My question is are there TeX macro? E. g. I can use \break in pdfTeX without defining it and \...
2
votes
1answer
121 views

Documents written in TeX (no LaTeX, no Plain TeX) [duplicate]

LaTeX and Plain TeX are formats for TeX and they ease creating document. But can we create documents using only TeX? I couldn't find any pure TeX sample.
3
votes
0answers
118 views

How does Tex layout engine work

Would it be correct to say that somewhere within Tex, there is a layout algorithm? If there is, is a description of the algorithm and abstractions it consumes and produces available? A question and ...
6
votes
1answer
124 views

Subtleties when using \def and \ifnum conditionals

I am having some difficultly comparing two numbers passed as arguments using \ifnum. Consider the command \def\comparenum[#1,#2] { \def\x{#1} \def\y{#2} \ifnum\x=\y TRUE \else FALSE \...
7
votes
1answer
192 views

token register vs. macro register

Consider the following simple code: \def\@ifundefined#1#2#3{% \cs{UNDEF}{DEF} \def\reserved@a{#2}% \def\reserved@b{#3}% \ifdefined#1 \let\reserved@c\reserved@b \else \...
3
votes
1answer
54 views

How to get core dump from VIRTEX?

Just out of curiosity, I stripped TeX source to a minimum from TeXLive build tree and compiled it successfully (it works in conjunction with texlive-lang-english package installed on Debian 10). You ...
4
votes
1answer
56 views

\mathop applied on colon

I thought I knew when \mathop centers its argument on the math axis and when it does not, but apparently I'm wrong (admittedly, that happens rather often :-)). \documentclass{article} \begin{...