Questions tagged [latex-base]

{latex-base} is about the inner workings of the LaTeX kernel. Do not use this tag for general questions about LaTeX or {macros}.

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

classification of basic latex commands

Related to but not duplicating Standard pre-defined macros in LaTeX: where to find them all, based on how and where they are defined, what is a top-level classification of all commands, separate from ...
2
votes
1answer
47 views

How does \let effect when combined with \@gobble?

I read everywhere (e.g. https://en.wikibooks.org/wiki/TeX/let) that \let copies the content of a command into a new command. My question is, why do we expect \let\comdwithtwoargs\@gobble makes \...
0
votes
0answers
25 views

Is is possible to convert an image to a tex formula? (Free vs paid) [duplicate]

Is it possible to convert an image to a tex formula? I would like to know free and paid solutions (which of them free and which of them paid). Thank you!
1
vote
1answer
65 views

Variable argument minimum with \@ifnextchar

I attempted to make a generic variable argument macro based off of what I saw here that can prepends text before each argument, append text after each argument, and adds text after all arguments have ...
2
votes
0answers
70 views

Why is \DeclareRobustCommand[*] still used by LaTeX?

As LaTeX requires eTeX now it would be much easier to replace all the definitions of robust commands with \DeclareRobustCommand[*]... by \protected[\long]\def..., wouldn't it? Which advatages come ...
0
votes
0answers
38 views

What is the current preferred method for enabling Unicode characters in mathematical formulas in LaTeX that runs on the unmodified TeX engine?

I am trying to make LaTeX recognize Unicode characters in mathematical formulas. The symbols used are already present in the original Computer Modern fonts and are completely standard (e.g., \alpha, \...
0
votes
2answers
58 views

When using amsmath, can the spacing between the letters “l ” and “n” resulting from calling \ln be widened?

The ln resulting from using \ln is too tightly spaced.
2
votes
1answer
45 views

When do curly braces disappear in macro definitions? (e.g. \documentclass expansion)

I've been looking into how \documentclass and friends are actually defined, and I noticed something peculiar which I'd like to understand. Let's say I have \documentclass[11pt, titlepage]{article}. ...
1
vote
1answer
39 views

Common numbering for figures and tables

How can I make a common numbering for my figures and tables? For instance, I want to obtain in Section 1 something like: Table 1.1, Figure 1.2, Table 1.3, Table 1.4, Figure 1.5
4
votes
1answer
90 views

Math accent at line start in align causes error

The following code no longer works after the LaTeX2e 2019-10-01 kernel update (error occurs using XeLaTeX). \documentclass{article} \usepackage{fontspec,ulem,amsmath} \begin{document} \begin{align} \...
1
vote
1answer
33 views

Both, header and footer are missing in the first page when I use longtables or landscape environment in multiple pages

I have a problem when I use longtables and landscape environment in my text, the header and footer is missing in the first page that begin longtable (or landscape environment). Is the first time that ...
1
vote
1answer
79 views

How do I read the LaTeX kernel code source? [duplicate]

I'm embarrassed to ask this. At one time I knew the answer and even had a printed copy of the code. I have tried texdoc with various options but was unable to come up with the one I needed. At the ...
6
votes
1answer
104 views

LaTeX2e 2019/10/01 update changes \lbrace vs \lcbrace test result

Prior to the LaTeX2e 2019/10/01 update, the following test with mtpro2 gives % Intended output: True False True Now it gives % After LaTeX2e 2019/10/01 update: False False False Code: \...
1
vote
1answer
311 views

MikTeX: Cannot fix the \includegraphics error by rebuilding formats (format still says LaTeX2e <2018-12-01>)

I was hit by the recent problems with \includegraphics and followed https://tex.stackexchange.com/a/512049/130867 in order to fix it. However, rebuilding my formats in the MikTeX console does not help....
0
votes
1answer
31 views

Old answers don't work - XeLaTex fontspec crash on Texmaker [LaTeX error: “kernel/invalid-variant”]

I'm reviving an old issue which I have come across. There are many similar questions but dated from a few years. Basically using Miktek 2.9.7100 with everything up to date and Texmaker 5.0.3. I can'...
3
votes
1answer
79 views

Where's the mandatory argument of sectioning commands?

I was looking in the file book.cls and I noted there is no mandatory argument in the definition of \section, \subsection, and \paragraph commands \newcommand\section{\@startsection {section}{1}{\z@}% ...
2
votes
2answers
93 views

How to modify \everypar safely in a package?

This is a follow-up to What does the \the\everypar do? and TikZ Overlay: Inject content at the start of the next paragraph? From a quick grep -R '\\everypar' texmf-dist/tex/latex I can see that \...
30
votes
2answers
825 views

What is “latex-dev”?

no answer needed, I'm adding the question as reference The package/update manager of my TeX-system installed in the last weeks a number of packages called latex-XX-dev, and CTAN too shows a number ...
6
votes
2answers
175 views

What's going on with an item that starts with an hbox?

I've been using LaTeX for years and never saw this before: if an item (in enumerate) starts with an \hbox, then the \hbox is placed before the label! \documentclass[12pt]{article} \def\Blank#1{\...
1
vote
0answers
66 views

Error in make htmldocs Linux kernel

I am trying to compile make htmldocs in linux kernel 5.2.2 version. Facing some issues restricted \write18 enabled. entering extended mode Latexmk: Index file 'networking.idx' was written Latexmk: ...
0
votes
0answers
28 views

Multi-page verbatim env changes catcode in footer [duplicate]

If a LaTeX2e environment verbatim spreads two pages, then in the footer of first page, catcode of symbols like $ and _ are changed to 12 (other), as if the whole footer is inside the verbatim env. \...
19
votes
2answers
2k views

Are all commands with an optional argument fragile?

Here is a discussion of fragile command in LaTeX. And it says that any commands that have an optional argument are fragile, for instance \footnote[2]{myfoottext} and \footnot{myotherfoottext}. I have ...
0
votes
1answer
63 views

What is the basic definition of \newcommand?

Awkward it is! I can not find the basic definition of \newcommand, though it is used a million times. I suspect it needs improvement.
15
votes
1answer
201 views

Understanding LaTeX 2e's \@esphack

I'm reading source2e.pdf and I have problems in understanding the sense of the definition of LaTeX 2ε's \@esphack: Commands like \label{...} , which themselves do not/shall not produce ...
1
vote
1answer
548 views

Importing entire R Script file into Latex

Is there a way to import an entire RScript (.R) file into Latex directly without manually using listings and copying the code into Latex?
16
votes
2answers
824 views

Why do people specify date as an option for \usepackage?

In LaTeX code written by other people, I sometimes see a date specified as an optional argument for \usepackage: \usepackage{iftex}[2013/04/04] Intuition tells me that this is some way to ensure ...
0
votes
1answer
759 views

I installed MiKTeX but I can't compile the file

I installed MiKTeX but I can't compile the file. This file worked perfectly on another computer This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6840 64-bit) entering extended mode (...
3
votes
1answer
912 views

how does '\maketitle' work?

I would like to know how the \maketitle command works since I am creating my own class and I want to use my own commands. For example, I already create certain commands like \a, \b and \c and I want ...
6
votes
2answers
386 views

LaTeX newcommand limitation

I want to know the possibilities and the limitation of LaTeX's \newcommand regarding the definition and the use/call of new macros. I know some of these examples are primitive but they can help to ...
1
vote
1answer
39 views

What do the labels (such as <*dircheck>) mean in `source2e.pdf`?

I am studying source2e.pdf and I have encountered something such as <*dircheck>, <*initex>, <*2ekernel>,<latexrelease>. I thought that they might be some sort of label to mark ...
6
votes
1answer
347 views

How does \verb* set the visible space?

I'm trying to understand how \verb* works under the hood, especially where the mapping for the visible space character comes into play. Let's have a look at the definitions first: \verb: macro:->\...
17
votes
3answers
600 views

What macros should be used as 'scratch space'?

The LaTeX kernel provides the 'scratch' macros \@tempa, etc., and \reserved@a, etc. These are used for a variety of purposes. Which should be used as temporary space by general users/programmers?
5
votes
1answer
305 views

Kernel deprecation warning with fnpct

I recently upgraded to TeXLive 2018 (and pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018/W32TeX)) and now I notice that package fnpct generates the following warnings: **************************...
0
votes
1answer
58 views

Circumvent missing dot in hierarchical listing numbering

I'm trying to deal with the same problem as described here. But the accepted answer does not really help in my case since the problem occurs when I try to add hierarchical numbering to listings and I ...
0
votes
1answer
238 views

Error in compiling a file with its own document class using MiKTeX 2.9.6643

I had to re-install MiKTeX version (2.9.6643) after formatting my pc, but when I compiled the file of my dissertation I received these error messages: ! Undefined control sequence. \UseTextAccent ......
0
votes
1answer
373 views

Corrupted nfss table, overfull hbox and undefined control sequence when testing fonts

I just installed texlive and I am running a series of tests recommended in section 3.5 of the official documentation. The tests are working as expected but when I get to testfont.tex I am getting !...
16
votes
1answer
144 views

L(a/ua)TeX kernel/package solution incorporating the globally optimised float placement/pagination

It was interesting to read Frank Mittelbach's articles on globally optimized pagination and float placement. https://www.latex-project.org/publications/ But, there is no mention of these proposed ...
2
votes
1answer
46 views

Comparing package version dates

Is it safe to use the LaTeX commands \@ifpackagelater, \@ifl@t@r and/or \@parse@version to compare/parse dates in the format used with \ProvidesPackage (YYYY/MM/DD)? Or is there a package providing ...
2
votes
1answer
95 views

What does svsec in \@svsec stand for?

Most of the following text you could probably skip. I just put it down there to show my effort. What does it do? Pretty sure I understand this already... In the LaTeX kernel, the generic heading ...
0
votes
2answers
239 views

gdef with @ifnextchar

I am trying to create a command with two or three arguments, that creates a new command. In my classfile I have: \def\foobar#1#2{\gdef\foo{#1, #2, \@ifnextchar\bgroup{foo}{bar}}} If I call \foobar{...
3
votes
1answer
84 views

When defining a new section command/macro, what is causing the \@startsection text to be repeated?

When I try producing a new section command \orangesection, which utilizes the LaTeX kernel command \@startsection, I end up with duplicated text. Where is it coming from? As a bonus, how could I track ...
4
votes
2answers
1k views

Dot between chapter number and figure number disapear after update

After a recent update the dot between chapter numbers and figure numbers disappeared. Here is a minimal example. \documentclass[]{memoir} \begin{document} \frontmatter Some text \mainmatter \chapter{...
8
votes
1answer
362 views

Problem with dtx file after LaTeX kernel upgrade (2018/04/01)

Today, the generation of one of my dtx files stopped with the error: ! Undefined control sequence. \UseTextAccent ...up \@firstofone \let \@curr@enc \cf@...
8
votes
3answers
3k views

What is the difference between \paperheight, \paperwidth and \pdfpageheight, \pdfpagewidth?

I couldn't find any existing answers to this question. So, what's the difference? Are there any advantages to using one duo over the other?
23
votes
1answer
7k views

! LaTeX Error: Command \counterwithout already defined

After updating MikTex up to 09.04.2018 (MikTex 2.9.6637, Win 10, 64bit) I've got the error: (F:\...\texmfs\install\tex\latex\chngcntr\chngcntr.sty ! LaTeX Error: Command \counterwithout already ...
3
votes
2answers
98 views

listings highlight 'escapeinside' causes unexpected line break of user code

I just want to highlight digits for variable initialization, to avoid colored number in equation und variable name,I have used the approach of Jubobs How to highlight all words of the form [0-9][A-Za-...
3
votes
1answer
626 views

How is “! LaTeX Error: Something's wrong--perhaps a missing \item.” produced (technically)?

Lists in LaTeX test for \item before their \end{list}. I want to know the chain of events leading to this error. From my analysis, I came to the following, but got lost at \@noitemerr. Sources ...
11
votes
1answer
291 views

Why does equation environment not give an error without the amsmath package?

As far as I understand the equation environment is defined in the amsmath package so one would expect an error while trying to compile the following document with pdflatex: \documentclass{article} \...
5
votes
1answer
738 views

Definition of \protect in \edef

Update: With the release of LaTeX2e 2018-04-01 Patch level 2, the following sentence has been added in the paragraph cited below to make the documentation clearer: More precisely, whenever the ...
17
votes
4answers
2k views

Why, in 2017, does LaTeX not use tree-like structures? [closed]

Short version Why, in 2017, does LaTeX not use a tree-like structure, and prefer to deal with ugly token rewrite rules? Long version LaTeX was created nearly 35 years ago. Maybe at that time, ...