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

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Font size changes in tex document after referencing a label

I am trying to reference a label, but when I do so the font size changes as shown below over the unknown measurable on $\R$ vector functions $f(x) = \left( f_1(x), ..., f_n(x) \right)^T$ and $\varphi(...
user avatar
2 votes
1 answer
37 views

After tokenizing, has a letter token already carried typeface info and font size info?

TeX is not very well understood for me, and there are so many details that I have to make some notes so that I can quickly understand what I have learned now when I go over it in the future. The ...
user avatar
  • 2,599
5 votes
3 answers
357 views

The idea behind the \outer primitive

It seems that this primitive was designed for the purpose that in case programmers forgot to put } in the end of the definition of a macro (in this case, TeX thought all characters until the end of ...
user avatar
  • 2,599
4 votes
2 answers
180 views

After changing the catcode of the escape character `\`, why can this code still be compiled successfully?

I read some macros of manmac.tex, when I read this code snippet % (now Appendix E resumes again) % macros for verbatim scanning \chardef\other=12 \def\ttverbatim{\begingroup \catcode`\\=\other \...
user avatar
  • 2,599
5 votes
2 answers
322 views

Why isn't every space between words a feasible breakpoint?

p98 of the TeXbook gives a paragraph trace beginning: []\tenrm Mr. Drofnats---or ‘‘R. J.,’’ as he pre- @\discretionary via @@0 b=0 p=50 d=2600 @@1: line 1.2- t=2600 -> @@0 ferred to be called---was ...
user avatar
7 votes
2 answers
153 views

When does tex do macro expansion?

Having read some chapters of the texbook, I know tex eats input lines from command line or files, then converts them into tokens. When these tokens go into its gastro-intestinal tract, tex prepares to ...
user avatar
  • 2,599
5 votes
1 answer
193 views

the discretionary of the word `difficult'

Is the discretionary of the word difficult di\discretionary{f-}{fi}{ffi}cult equivalent to dif\-ficult (or dif\discretionary{-}{}{})?
user avatar
  • 2,599
3 votes
1 answer
100 views

Why are \showboxbreadth and \showboxdepth set to 2^{30}-1 in \loggingall?

The plain TeX format defines \def\loggingall{\tracingcommands\tw@\tracingstats\tw@ \tracingpages\@ne\tracingoutput\@ne\tracinglostchars\@ne \tracingmacros\tw@\tracingparagraphs\@ne\tracingrestores\...
user avatar
  • 9,268
1 vote
0 answers
33 views

Where is the reference point of a VBOX?

From the TeXbook, Therefore, the actual rules for the depth of a constructed vbox a somewhat TeXnical. Here they are: Given a vertical list that is being wrapped up via \vbox, the problem is to ...
user avatar
  • 2,599
2 votes
1 answer
114 views

Detect delimiter

Is it possible to check whether a token is a delimiter, i.e (, ), |, \vert, \langle, \rangle, etc without directly checking each of them in a condition? The structure of delimiter is well described ...
user avatar
  • 1,849
1 vote
1 answer
37 views

\@abspage@last fails to typeset number in header

I tried to typeset the total pages number in right header by \@abspage@last under pagestyle fancy. Instead of number, the text abspage@last is printed. Why? And how to deal with it? MWE: \...
user avatar
  • 2,189
0 votes
1 answer
39 views

Under what circumstances does TeX produce a series of tokens with space after a control sequence?

On page 39 of The TeXbook, Knuth said, Furthermore, spaces are not ignored after control sequences inside a token list; the ignore-space rule applies only in an input file, during the time that ...
user avatar
  • 2,599
0 votes
2 answers
50 views

calculate length in \newlength with \dimexpr

\documentclass[a4paper]{article} \usepackage{geometry} \geometry{showframe} \geometry{left=1cm,right=1cm,top=1cm,bottom=1cm} \begin{document} (1) \newlength{\ccc}{\dimexpr\textwidth-100pt} % ...
user avatar
  • 2,189
3 votes
1 answer
149 views

How to get length from glue

The objective of the following code is to occupy the rest of a line with a parbox. I know this is a wrong way. So, how to get length from glue? \documentclass{article} \usepackage{geometry} \geometry{...
user avatar
  • 2,189
3 votes
1 answer
129 views

\if compares text literal?

Knuth's tex book introduced \if<token1><token2>. I wrote the following to test it \def\tOne{abc} \def\tTwo{abc} \ifx\tOne\tTwo True \else False \fi \if\tOne{abc} True \else False \fi \...
user avatar
  • 449
0 votes
1 answer
30 views

How to append something to a page style defined by \fancypagestyle

Some other codes can be appended to a macro by tools from etoolbox, for example, \apptocmd. I wonder if there are similar ways to append something to a page style defined by \fancypagestyle from the ...
user avatar
  • 2,189
0 votes
0 answers
11 views

How to display latex math in html output of texinfo document

https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Inserting-Math.html The above link provides an explanation to how to display math in the html output of a texinfo document. It says: ...
user avatar
0 votes
0 answers
30 views

How to remove the repeating header

The "list of figures" appear every two page. How can I remove it? %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[b5paper, 11pt, openany, titlepage]{book} %%%%%%%%%%%%%%%%%%...
user avatar
-2 votes
1 answer
55 views

I don't know how to use 'fill=?' [closed]

It's the first time I write tex profiles,I want to know how to use the style{ fill=}.
user avatar
  • 1
2 votes
1 answer
35 views

Why does the \newhelp toks uses a \csname construct in its definition?

In LaTeX2e there are still remnants of Plain TeX macros. One such macro is \newhelp, which is defined as: \def\newhelp#1#2{\newtoks#1#1\expandafter{\csname#2\endcsname}} This is not used anywhere in &...
user avatar
0 votes
1 answer
43 views

keywords detection in pdf from latex

I recently wrote my first LaTeX cv. once I started to apply for jobs i notice that the tool them using to scan my CV doing some wrong classification like give me wrong name, or missing some skills I ...
user avatar
  • 1
3 votes
1 answer
159 views

LuaTeX treats ^^M in \wlog differently

I am confused by the output of the following code: \documentclass{article} \begin{document} \begingroup \obeylines \typeout{abc^^Muvw} \wlog{ijk^^Mxyz} \endgroup \end{document} With PDFLaTeX or ...
user avatar
  • 7,604
3 votes
0 answers
100 views

How to make a "Computer Modern Medium" font?

In [La]TeX documents printed in the early 1980s, fonts look noticeably thicker than they do today. Something about the advent of modern laser printers and the disappearance of older printing ...
user avatar
1 vote
1 answer
33 views

Table column spacing in Plain TeX with \settabs

In Plain TeX I need to reduce the space between 2 columns in a 2 column table. How to do this? I am simply using \settabs 2 \columns, but one column is at the left of the page, but the second is on ...
user avatar
0 votes
1 answer
35 views

Problem with redefining command and macro parameter character "#" in math mode [closed]

I created a command that prints a formula for the distance between two points in the coordinate system. I used the "#" character to pass arguments. M and N represent some numbers. When I ...
user avatar
2 votes
1 answer
38 views

How to expandably obtain pendant of different (to be specified) category of arbitrary explicit character token?

This question is about categories of explicit character tokens. If you apply \string to an explicit character token, you get the category 12 pendant of that explicit character token. (Exception: If ...
user avatar
1 vote
1 answer
34 views

Distinguish between number and length [duplicate]

In my job, I need a macro to distinguish between number and length. Length here means, for example: (1) \textwidth, \parindent, etc (2) \newdimen\mylena \mylena=10cm (3) \def\mylenb{2in} (4) 5.2in I ...
user avatar
  • 11
1 vote
1 answer
589 views

MikTeX broken after update; compiler seems to be dead

I use the latest Windows 10. One month ago, my TeXnicCenter was working completely fine with MikTeX. Now, it occurred to me that MikTeX was slightly outdated. I had not updated it for about six months,...
user avatar
  • 11
3 votes
1 answer
68 views

how to get value from a list by the index

I build a list by a macro to store some values. I wonder if there is method to get value by its index number from the list. The following code shows my intention. Code example: \documentclass{article} ...
user avatar
  • 2,189
0 votes
1 answer
40 views

Height of \parbox can not be assigned with condition?

I want to assign the height of my \parbox with condition, as I did below, but fail. Why and how to deal with it? Code: \documentclass[a4paper]{article} \usepackage{etoolbox} \usepackage{geometry} \...
user avatar
  • 2,189
0 votes
0 answers
54 views

When writing in English (or other Latin script languages), which is correct (or preferred): TeX or ΤεΧ?

Using FontForge, I was interested to see that they spell TeX with Greek letters (ΤεΧ), as seen below: I had always up to now seen it written out in Latin lettering, but is the style used by FontForge ...
user avatar
4 votes
0 answers
70 views

Can you detect from within TeX how the name of a file accessed by TeX is encoded?

This question is inspired by the question Input dynamically generated file name which basically is about truncating a given filename/the expansion of \jobname by two characters. In utf-8 the byte-...
user avatar
  • 22.9k
0 votes
0 answers
99 views

Hyphenate compound word: What items should go into the horizontal list?

TeX won’t hyphenate a “word” if the word already contains a “discretionary”. As a consequence, compound words such as integro-differential and Rajamahendravaram--Visakhapatnam will not be hyphenated, ...
user avatar
  • 9,268
2 votes
2 answers
108 views

Undefined control sequence when passing 25 arguments

Before I start to ask my question I would like to mention that I am well aware that the following may be non-standard or even frivolous LaTeX. I want to improve it and am open for suggestions. Some ...
user avatar
1 vote
1 answer
34 views

Different effect of "height" arg in \vrule

\documentclass[a4paper]{article} \usepackage{xcolor} \usepackage{geometry} \geometry{showframe} \geometry{left=1cm,right=1cm,top=1cm,bottom=1cm} \begin{document} \parindent0pt \fboxsep0pt \...
user avatar
  • 2,189
0 votes
1 answer
48 views

How to merge cells made by \parbox vertically

\documentclass[a4paper]{article} \usepackage{xcolor,pgf,etoolbox} \usepackage{geometry} \geometry{showframe} \geometry{left=1cm,right=1cm,top=1cm,bottom=1cm} \parindent0pt \begin{document} \fboxsep0pt ...
user avatar
  • 2,189
1 vote
1 answer
34 views

TeXbook - Chapter 12: Glue - Exercise 12.13

Exercise 12.13 (p. 81) makes the following assumptions: \box1 is 1pt high 1pt deep and 1pt wide \box2 is 2pt high 2pt deep and 2pt wide \baselineskip=9pt minus3fil \boxmaxdepth=-4pt The exercise is ...
user avatar
  • 47
1 vote
2 answers
63 views

How to expand a token defined with \let

At the end of the following code, the token list will contains the token \val and not the character a as confirmed by the \showthe. Using a \def instead of a \let gives the result I want but is not an ...
user avatar
3 votes
1 answer
109 views

How to make the value of a lengh macro change with another

\documentclass[a4paper]{article} \usepackage{xcolor,pgf,etoolbox} \usepackage{geometry} \geometry{showframe} \geometry{left=1cm,right=1cm,top=1cm,bottom=1cm} \parindent0pt \begin{document} \newdimen\...
user avatar
  • 2,189
1 vote
1 answer
52 views

Question about TeXBook Exercise 8.6

In exercise 8.6 the characters ^^A, ^^B, ^^C, ^^M are defined to belong to categories 0, 7, 10, and 11 respectively. The question ist what tokens are produced from the input line ‘^^B^^BM^^A^^B^^C^^M^^...
user avatar
  • 47
3 votes
1 answer
75 views

Space oddity: are there spaces that won't end up on the page?

I think the answer to my question is "no," but one could argue that it would be nice if there were. Here's what motivates the question. Define \def\myloop#1#2{\count11=#1#2% \advance\count11 ...
user avatar
8 votes
2 answers
490 views

Parsing oddity: when is a space not a space

Saying \count89=14 \the\count89~{\count89=11 \the\count89~}\the\count89 produces 14 11 14, as one would expect. But, get rid of the space in the middle clause: \count89=14 \the\count89~{\count89=11\...
user avatar
2 votes
0 answers
115 views

TeX as a programming language: examples and design patterns

I'm looking for simple examples of using TeX as a programming language, not LaTeX, and ideally these examples only use the primitive TeX commands. Why? Because the members of a local computer club ...
user avatar
3 votes
3 answers
248 views

How to reliably obtain a control sequence token which is undefined?

How to reliably obtain a control sequence token which is undefined in the current scope? E.g., is there a sequence of tokens ⟨stuff⟩ with which you can do \begingroup\expandafter\endgroup\expandafter\...
user avatar
  • 22.9k
0 votes
1 answer
59 views

How to store/append code for later use

To store some code for later use, I can think of two ways: \appto from etoolbox and \sbox. They both have some problems in use. For \appto, later invoke of a macro will cover the value of the former, ...
user avatar
  • 2,189
3 votes
3 answers
341 views

Are they numbers or dimensions

I wonder if there is a way to tell if a macro is a number or dimension, as shown in the following example. That is to say, if the macro is number, some thing will be done, if it is a dimension, some ...
user avatar
  • 2,189
0 votes
1 answer
65 views

Debuging boxes in LaTeX

I'm trying to read the TeXbook to understand more on the internal of boxes. They say that: \setbox0=\hbox{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125em X} \showbox0 should display how the box is ...
user avatar
  • 5,043
2 votes
2 answers
156 views

display full macro expansion

Intrigued by a strange question (how to produce a [La]TeX representation of a Texinfo source file, under the assumption that the Texinfo source file would yield somehow a lower level document in "...
user avatar
  • 3,983
0 votes
1 answer
66 views

Two horizontal rules made by \hrule in the same line

I make a table by the following code in which a cell of the talbe is consctructed by a \makebox. Cells at the same line are seperated by \vrule. lines are seperated by \hrule. In this example, I want ...
user avatar
  • 2,189
0 votes
1 answer
70 views

How to control the horizontal position of \hrule

Please see my questions in the following MWE. Thank you. \documentclass[a4paper]{article} \usepackage{amsmath} \usepackage{geometry} \geometry{showframe} \geometry{left=1cm,right=1cm,top=1cm,bottom=...
user avatar
  • 2,189

1
2 3 4 5
36