Questions tagged [catcodes]
{catcodes} is about "category codes" — an integer number from 0–15 associated to each of the 256 character codes. The category codes indicate the role of a character.
352
questions
3
votes
1
answer
74
views
Robustness of \peek_analysis_map_inline:n with changed catcode
Background
Following my previous question I try to make compatible the redefinition of the circumflex ^ catcode with the active prime ' defined in vanilla LaTeX or by the package unicode-math.
The ...
1
vote
0
answers
43
views
Redefine commands, changing a catcode
Background
I'm the author of the altsubsup package, which set to 12 (other) the catcode of the circumflex ^ char.
As it, expressions as x''^2 raise a Double superscript error because the latex ...
2
votes
1
answer
120
views
Automatically substitute hyphen(-) with \ensuremath{-} inside of the table environment
Because, in my usage, most of hyphens(-) used inside of the table environment represent the minus sign, I would like to substitute them with \ensuremath{-}.
Here's my try:
\documentclass[10pt]{article}...
0
votes
1
answer
15
views
How can I use escapeinside within a minted environment with the bash lexer?
The escapeinside functionality doesn't work properly with the bash lexer. Is there any way to fix this?
MWE:
\documentclass{article}
\usepackage{minted}
\begin{document}
\begin{minted}[escapeinside=|...
3
votes
2
answers
83
views
Changing a catcode of WolframAlpha output character
Sometimes I exploit WolframAlpha to do some simple calculations and then insert results in my latex code. But I find annoying to adapt the output given by WA to the LaTeX syntax.
When the output is a ...
2
votes
1
answer
54
views
verbatim mode and carriage return character tokens
This question refers to how the program TeX creates tokens after reading a line of a .tex-file. It does actually not refer to writing macros or doing typesetting work which takes place in stages after ...
2
votes
3
answers
180
views
Can't compare clist item with string
I can't compare comma list item with string. \clist_a is a temp var.
\documentclass[12pt]{article}
\usepackage{expl3}
\begin{document}
\ExplSyntaxOn
\clist_new:N \clist_a
\keys_define:nn { mymodule }
...
0
votes
1
answer
36
views
Preserving newlines and spaces while writing argument to a file
I am making a function that should write its argument to a file (for further processing by Python)
From the following question I get something that mostly works.
Adding newlines while writing text to ...
2
votes
1
answer
102
views
htlatex breaks down when using siunitx
I have a manuscript that is written in LaTeX. After a couple of rejections and modifications, the new journal seems to only accept .docx files. I plan to convert my manuscript to a .odt as the editor ...
0
votes
0
answers
71
views
Starting command using “/“ instead of “\”
This seems like a very random question, but I just got the Apple Magic Keyboard for iPad Air 5th generation. The key “\” is half of the size of that of “/“. The “\” key is placed also in the edge and ...
0
votes
3
answers
158
views
How can I change the catcode within a command, then reference input using the new catcode?
pdfTeX: I am attempting to define a command which
takes an input,
redefines the catcode and function of a character, and
prints the input using the new character definition.
I recognize that this is ...
4
votes
2
answers
386
views
Show carriage return by changing its catcode in TeX?
On page 46 of The TeXbook, there is
TEX deletes any space characters (number 32) that occur at the right end of an input line. Then it inserts a return character (number 13) at the right end of the ...
0
votes
1
answer
73
views
"\escapechar" vs category 0 in TeX
In TeX, \catcode`\|=0 will make escape character to be |, to |TeX will output
But at the penultimate paragraph of page 40 of The TeXbook, it says that \escapechar is normally TeX's internal code for ...
1
vote
1
answer
116
views
To make "\" to category 12, why should convert it to category 13 in TeX?
Exercise 7.5 on page 40 of The TeXbook asks to make \ to category 12. The answer of this question is
{\catcode‘/=0 \catcode‘\\=13 /message{/string\}}
Why should assign the \ to 13 not 12?
The ...
0
votes
2
answers
73
views
Need add a space before character in changing category of character?
At the bottom of page 307 of The TeXbook, it says
TEX always reads the token following a constant before evaluating that constant.
So,
{\catcode‘\>=2 >
is different from
{\catcode\`>=2>
...