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
67 views

Fully expand an argument before using it in latex

I'm trying to make a function that takes an argument and returns the number of words in the argument, once it is expanded. Something along the lines of \wordcount{Some text goes here with \macros{abc} ...
2 votes
2 answers
274 views

Avoid line stretching automatically

I would like to avoid at all cost line stretching, without forcing it manually. I will provide you with an example to clarify what I mean. Here it is the code: \documentclass{article} \begin{...
12 votes
2 answers
344 views

Measure total glue in a box

Someone gives me a box, and my goal is to know as much as possible about the amount of glue inside that box. I can assume that the box is not huge, but it may contain arbitrary stuff (so I cannot ...
16 votes
2 answers
3k views

Breakable vboxes

In Plain TeX how can I make vboxes breakable, and can I handle/measure them separately? What I'm trying to do, is that I have a portion of text, that is treated separately (no indention, narrower, ...
2 votes
2 answers
2k views

Parameter in newcommand like part of name in newcommand

i wanna in newcommand in new command use like part of new command \newcommand{\megakommand}[3]{ \newcommand{#1One}{#2#3} \newcommand{#1Two}{#3#2} } \megakommand{\ciferki}{1}{2} \ciferkiOne -> 12 \...
14 votes
3 answers
2k views

Minimum length of last line of a paragraph

There is a more or less equivalent question to this: Ensure minimal length of last line, but I absolutely need a TeX solution. I more or less stumbled upon the problem mentioned in the discussion of ...
16 votes
2 answers
475 views

How many different concepts of "token equivalence" are there in TeX?

I was living in the delusion that the "token equality" tested by \ifx was the only thing you need to remember about this subject, but this week I learned otherwise (thanks to David Carlisle). Now I'...
0 votes
0 answers
41 views

Moving embedded math symbols relative to line text

Is there a way to manually move some symbol set in latex? I did a manual example in paint brush and painted some red horizontal lines to put some perspective. All my attempts at Tikz were terrible, as ...
5 votes
1 answer
269 views

Instructing TeX to use an editor of my choice

When I run TeX on a file containing an error (e.g. an undefined control sequence), I receive this message Type <return> to proceed, S to scroll future error messages, R to run without stopping, ...
5 votes
3 answers
185 views

Why is \char not expandable?

\char<number> is a TeX primitive that results in the character of ASCII code <number> with category code 12. However, it isn't expandable, unlike it's many cousins \romannumeral, \number, ...
26 votes
5 answers
3k views

Why does TeX remove braces around delimited arguments?

On pp. 203–204 of the TeXbook, Knuth describes how TeX absorbs macros' arguments: delimited go until the first appearance of the delimiter, and undelimited go until the next token, in both cases ...
10 votes
3 answers
454 views

'a^^Mb' isn't equivalent to 'a<return>b'; instead throws pdftex into an extended mode

I'd expect (see background material below) the following Plain TeX manuscript a^^Mb\bye to be equivalent to a b\bye and therefore to typeset thus: a b Instead, pdftex pauses mid-compilation, and ...
0 votes
0 answers
37 views

Accurately aligning a letter top to the top of the page

I do not understand why I am not succeeding in accurately aligning the top of a capital letter to the top of the page. I am experimenting with: \documentclass{article} \parskip=0mm \topmargin=-1in \...
2 votes
1 answer
204 views

Texlive's TeX vs Knuth's TeX

From texmf.cnf: % But don't parse the first line if invoked as"tex", since we want that % to remain Knuth-compatible. The src_specials and % file_line_error_style settings, as well as the ...
1 vote
3 answers
88 views

How to get value of a macro immediately

The following code does not work. I think maybe it is because of \f. So my question is: how to get the value from a macro immediately(in my case I want \f get abc immediately)? And is it possible to ...
2 votes
1 answer
112 views

Unwanted line break with \raggedleft, \centering or \raggedright

In the following example, I get unwanted line breaks for text "Dest-Addr". The result is correct for text "Hello-World". The result is also correct if I change font size to 10pt or ...
1 vote
0 answers
38 views

Problem about the argument of macro defined by \def [duplicate]

I construct a macro named \mymacro, and this macro would be used in two ways: first: \mymacro, which would typeset 1 second:\mymacro*, which would typeset 2 Here is my code: \documentclass{article} \...
9 votes
4 answers
823 views

Detecting which version of the LaTeX format is in use

ltxcmds provides \ltx@ifpackagelater, \ltx@ifclasslater, \ltx@iffilelater and there is \@ifpackagelater - but is there any "if TeX later" or some other way to (automatically) get the used TeX version (...
10 votes
1 answer
314 views

What is kcatcode in pTeX and upTeX?

The Japanese TeX engines pTeX and upTeX treat separately Latin and Japanese characters, in a way I don't fully understand. They introduce a notion of kcatcode of a Japanese character, which takes ...
0 votes
1 answer
89 views

Latex drawing of the following screen shot

Can anyone help with the drawing of this pic in latex? I have included what I have done: \documentclass[12pt]{article} \setlength{\topmargin}{-1cm} \setlength{\oddsidemargin}{0in} \setlength{\...
1 vote
2 answers
27 views

cell showing up as "-c-" in table?

Where did I go wrong to have the -c- show up in the cell? I just want the text "bar" there. sorry I am new \documentclass{article} \begin{table} \centering \rowcolors{1}{}{lightgray} \begin{...
1 vote
1 answer
34 views

Help with understanding: how does amsart class store the content of abstract for later use in \maketitle?

I wish to understand how the amsart class managed to store the content of abstract for the later \maketitle, and why they demand the abstract environment to precede \maketitle (i.e. is there any ...
0 votes
1 answer
321 views

Manually numbering with \tag in double dollar signs

I want to manually numbering in non-numbered displayed equation environment and try the following steps \documentclass{article} \usepackage{amsmath} \begin{document} \[ \bar{D}=\frac{1}{n} \sum_{j=1}^...
1 vote
1 answer
92 views

What's the function of the @ symbol? [duplicate]

I'm sure that this is TeX basics and I'm just being a fool, but I can't figure out for what/how the @ symbol is used. All I can tell is that to make sure it works you have to put it between \...
0 votes
0 answers
115 views

Problem with installing Tex Live for LaTeX workshop

I was hoping to turn my VS Code into a TeX / LaTeX editor. I came across an extension called LaTeX workshop which told me I had to install Tex Live. Once I downloaded the installer my AV told me it ...
3 votes
1 answer
77 views

Is there a token which neither can be redefined to be \outer nor can be affected by \uppercase/\lowercase?

This is more an "academical" question: Is there a token which neither can be redefined to be \outer nor can be affected by \uppercase/\lowercase no matter what \lccodes/\uccodes are current? ...
6 votes
2 answers
119 views

Different Behaviors Digesting \csname x\endcsname and Digesting \x (expansion issue)

This question has been significantly EDITED, as I learned more of the problem. If I was good, I would be able to create macros with multiple optional arguments, but not only can't I, but in this case,...
1 vote
0 answers
101 views

Will LaTeX compile Plain TeX? [duplicate]

I'm really new to TeX and I'm trying to learn how the different levels of TeX relate to each other. As far as I understand LaTeX is a set of macros for Plain TeX with the purpose of making life easier,...
3 votes
2 answers
3k views

"! You can't use `\raise' in internal vertical mode" error

I used the command \raise to superimpose a title to a writing. I got the error ! You can't use `\raise' in internal vertical mode which puzzled me for a while. For those interested, here is my ...
1 vote
1 answer
111 views

plain tex. beginsection doesnt break line

I'm typing a math article for someone. He asked me to type it in plain TeX (rather than LaTeX) because he is used to plain TeX and would like the option to edit my typing, I think. Anyway, I am new to ...
188 votes
5 answers
446k views

Escape character in LaTeX

I need to output the below text but since \ is a special character, I cannot: [RegularExpression(@"\d+")] Also sometimes I need use dollar sign $ as well but it seems to be a special char, too. ...
0 votes
1 answer
68 views

(xe)tex: How do I apply \ifodd\pageno logic (\special) to image, based on page the box is set on, rather than when file is read

Working in (plain) XeTeX, I would like to apply a certain transformation (mirror on vertical axis) to an image if it appears on an odd-numbered page. I'd like a fairly general solution, as in some ...
0 votes
1 answer
118 views

Are there things that TeX can do but LaTeX3 can't?

Sorry for this general question but to be honest I hate more and more coding in TeX and even if I am a very beginner coder in LaTeX3, I really appreciate using it.
4 votes
5 answers
311 views

Prevent hash doubling with \message

Assume a token sequence: Token 1: Explicit hash character of category code 6. Token 2: Explicit 1 of category code 12. Token 3: Explicit hash character of category code 6. Token 4: Control word token ...
0 votes
1 answer
98 views

graph on latex with too many data points, giving me timeout [closed]

So, I am writing a report which contains graphs, graphs are with a huge amount of data points. one graph only could contain more than 32,000 points, and I am using tikzpicture and adding coordinates ...
0 votes
1 answer
58 views

How to keep my Tex interpreter running?

I'm coding with Vscode and XeLatex. When running the code below, it worked and cost approximately 20s \documentclass[border={0pt}]{standalone} \usepackage{tikz,} \begin{document} \begin{tikzpicture}...
5 votes
1 answer
577 views

How to typeset ordered pairs?

I'd like to typeset ordered pairs with comma-separated components while \langle and \rangle as their delimiters. I want line breaks at commas for an ordered pair in inline math mode. So I came up with ...
20 votes
3 answers
953 views

Why does plain TeX set \tolerance larger than \pretolerance?

When TeX breaks a paragraph into lines, it makes three passes. In the first pass, TeX tries to break the paragraph without hyphenation, during which it makes sure that no line has a badness (from glue ...
11 votes
3 answers
957 views

Four TeX processors (as described in TeX by Topic)

I started reading TeX by Topic by Victor Eijkhout. He starts from describing four engines: The input processor. This is the piece of TeX that accepts input lines from the file system of whatever ...
28 votes
3 answers
4k views

Where is source code of TeX, LuaTeX, pdfTeX

Today, TeX is a big program, LuaTeX, PDFTeX, METAPOST etc. Where is the public accessing source code for hacking LuaTeX or other implementations. For example, I need to embed TeX into C program or ...
2 votes
0 answers
457 views

/usr/bin/pdflatex (file fa5free0solid): Font fa5free0solid at 54 0 not found for LIPICS-2021 [closed]

I am using the LIPICS template and compiling using pdflatex on Ubuntu-18.04. I have the fontawesome5 installed and all, but the compilation fails with the error in the subject. I wonder, first, how to ...
0 votes
2 answers
75 views

Table doesn't want to appear in the text boundaries

I am trying to make table as wide as the text, but I can't figure it out. I used \usepackage[pass,letterpaper]{geometry} to make left and right margin equal. Also, I would like to center text in the ...
1 vote
3 answers
261 views

How to center text in merged cell?

I have this table and I want to have the text from merged cell in the middle of it, I marked the place where I want it. How can I do that? \begin{table}[h] \def\arraystretch{1.5} \begin{tabular}{|*{3}{...
12 votes
2 answers
1k views

Why doesn't TeX have hkern and vkern?

We have \hskip, \vskip, and \mskip, but only \kern and \mkern. Why doesn't TeX distinguish between horizontal and vertical kerns like it does for skips?
5 votes
3 answers
225 views

Create a hbox that fills the rest of the line + some questions on boxes in general

I'm trying to understand how boxes work in TeX, and I've some question, all related with boxes in general (if you think it's better to create 3 questions, let me know, but I think they are quite ...
0 votes
0 answers
225 views

Again: ! TeX capacity exceeded, sorry [save size=500000] (LuaLaTeX, MikTeX)

I'm getting the following error message compiling my PhD-file (used: LuaLaTeX, MikTeX 2.9): ! TeX capacity exceeded, sorry [save size=500000]. <to be read again> \relax l.90 \include{...
4 votes
0 answers
103 views

Does anything of this 1988 “TeX in CWEB” still exist?

In TUGboat 9:2 (1988), there is an interesting article titled “TeX adapted to CWEB”, written by David Kennedy of Micro Publishing Systems, Inc. [Literate programming historians should note that the ...
2 votes
1 answer
182 views

The hash function used by new_trie_op

In §944 of TeX, The Program (Volume B of Computers & Typesetting) DEK describes the hash function used by new_trie_op in order to store hyphenation tables efficiently. Quoting him: The hash ...
2 votes
0 answers
71 views

Remaking the Stack Overflow logo [closed]

I want to build the Stack Overflow logo, but not just the stack, also the text. If it looks like this: How do I recreate it using TeX?
7 votes
1 answer
561 views

Plain TeX vs. “primitive” TeX

I'm using LaTeX for my day-to-day needs, but in order to avoid cargo-cult document creation, I'm trying to gain a better understanding of the TeX engine itself. As part of this I'm experimenting with ...

1
3 4
5
6 7
37