Questions tagged [active-characters]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
6
votes
2answers
144 views

Why don't unexpandable active characters work in \csname…\endcsname?

Page 213 of The TeXbook has a definitive explanation of \csname...\endcsname: When TeX expands \csname it reads to the matching \endcsname, expanding tokens as it goes; only character tokens should ...
0
votes
0answers
30 views

What kinds of constructions are `, --, ---, and ``? [duplicate]

A couple of questions of a similar nature: We all know that -- prints an endash, while --- prints an emdash. But - is not an active character, right? So how does TeX process -- and --- and make them ...
3
votes
2answers
137 views

Make equality-sign automatically blue

I know that we can redefine inequality-signs such as \le by simply doing \let\oldle\le and \def\le{\mathrel{...}}. But I have no idea how to redefine the equality-sign =. So if I want to automatically ...
3
votes
2answers
139 views

Characters made active and used the same way to define macros behave differently in verbatim environments

The following MCE shows that Unicode and ASCII characters made active and used exactly the same way to define macros, when compiled with lualatex, behave differently in verbatim environments: & ...
0
votes
0answers
55 views

Adjusting spacing in mathdesign

I like mathdesign package, but spacing between some letters looks pretty awful, for example, look at the letter A: I've found the solution here: Make Characters Active via Macro in Math Mode. So, ...
4
votes
1answer
100 views

What are use-cases for active characters?

The TikZ manual has this little gem of wisdom in its description of the \foreach command (emphasis mine): In the easiest case, ‹variables› is a single TeX command like \x or \point. (If you want to ...
0
votes
0answers
75 views

Polyglossia: babelshorthands stopped working in \title

I'm using polyglossia rather than babel for multilingual documents, with babel's shorthands activated for the German language so I can easily add explicit hyphens to words without breaking hyphenation,...
1
vote
0answers
76 views

Which characters are safe to use in labels?

To my dismay, I've learned that it is unsafe to use the colon (:) in labels if you are using babel-french together with at least one other package, namely, crossreftool, which operates upon labels. ...
1
vote
2answers
110 views

Active apostrophe character in math mode

For some reason, I need a package providing an active apostrophe. For the sake of simplicity, let's say that every apostrophe shall be replaced by ABC in text mode. In math mode, the default behaviour ...
5
votes
1answer
134 views

Apostrophe in math formula prevents luatex compilation for Slovak

The following example can be compiled with pdflatex or xelatex without any problems, but with lualatex, the compilation comes never to an end. \documentclass{article} \usepackage[slovak]{babel} \...
3
votes
1answer
99 views

Getting a list of active characters

There are some characters that are active in plain TeX (e.g. ~) and some packages like babel make additional characters active (e.g. "). Is there a way to get a list of all active characters from ...
1
vote
1answer
88 views

Babel shorthands not working with `beamer` class (quotation mark not recognized as active character)

For the German language the babel package defines a set of shorthand commands that I use quite often. They all start with a quotation mark (") which is redefined as an active character. In detail, I'm ...
4
votes
1answer
354 views

Character choice for csquotes active quotes

We all know csquotes and the multiple facilities it provides for displaying quotations and related content. One feature I'm particularly fond of are the active quotes, using \MakeAutoQuote. That's ...
0
votes
1answer
95 views

Use of \NoAutoSpacing inside a macro

I would like to locally deactivate the colon character (made active by babel package used with frenchb option). But it appears to not work within a macro: \documentclass{article} \usepackage[frenchb]{...
1
vote
1answer
55 views

glossaries and csquotes: how to use autoquotes in gls description?

I am trying to get csquotes's \MakeAutoQuote to work with glossaries - no luck so far. The defined autoquotes are simply not active anymore by the time the description is read. Here is the MWE: \...
4
votes
1answer
89 views

How can I fix active quote mark characters on update to TL 2018? [duplicate]

MWE: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{csquotes} \MakeAutoQuote{‘}{’} \MakeAutoQuote*{“}{”} \begin{document} Hylo \end{document} This code works fine with pdfLaTeX ...
4
votes
2answers
191 views

Code redefining ampersand stops working when put in command

I want to redefine & in a command. I tried to adapt this code that redefines ^ in an environment but couldn't make it work. \documentclass[]{article} \begin{document} \newcommand{\myampersand}{?}...
2
votes
1answer
141 views

Conflict of active strings in WinEdt

I am using WinEdt 10.2. I designed two active strings which do the following jobs. One active string automatically changes "\c?}" into "\mathcal{?}" if ? is a single uppercase letter and does nothing ...
1
vote
2answers
93 views

Remap single character within fontstyle definition

I have created a font from otf using autoinst to typeset some chord symbols in TeX. This font is designed (by its creator) to map character positions to certain musical symbols, like the small latin ...
1
vote
0answers
93 views

Deactivating an active character

How do I deactivate an active character? The following works without the activizations in the preamble, but not with them, in spite of my attempt to reset the catcode of : to 12. \documentclass{...
2
votes
1answer
198 views

How to map special characters in CSV to something else when processing via datatool

The datatool user guide mentions that certain special characters are automatically mapped to the typesetting equivalent when loading a database in raw mode (via \DTLloadrawdb). If you want to change ...
8
votes
1answer
188 views

LuaTeX analogue of \ifcsname for active characters

In pdfTeX or XeTeX the following code runs through active characters and eventually produces an error such as Invalid code (1114112) (but with 256 in pdfTeX). \catcode`*=13 % active \count0=32 \def\...
5
votes
1answer
301 views

Why is \active defined as \char13 (and not 13)?

In plain TeX, we have \chardef\active=13 \catcode`\~=\active I thought a catcode should be assigned a number between 0 and 15, but \active is \char13. So how does it work? Would \catcode`\~=13 also ...
12
votes
3answers
2k views

How to deactivate % as special character?

Background: I use LaTeX to display data that are automatically produced. I cannot manually change the raw data (since they are frequently updated). But this raw text contains LaTeX's special ...
3
votes
1answer
171 views

redefine caret ^ while using mathtools package

consider the following MWE: \documentclass{article} %\usepackage{mathtools} \newcommand\newCaret{X} \catcode`^=\active \let^=\newCaret \begin{document} $x^2$ \end{document} this works fine, ...
5
votes
2answers
139 views

How to make active characters work differently in mathmode and text mode?

Still learning about active characters, catcodes, mathcodes, and such. I know how to make *hello* produce bold in text mode and $x$ produce a bold $x$ in math mode. I also know how to make *{hello}...
7
votes
2answers
82 views

How can I conditionally designate an active quote in csquotes.cfg?

How can I conditionally designate an active quote in csquotes.cfg so that no error is produced if the same character is made into an active quote in the .cfg and the document's preamble? I have the ...
6
votes
1answer
285 views

How to use comma-separated argument list in Verbatim environment?

When I try this: \documentclass{article} \usepackage{fancyvrb} \usepackage{xcolor} \begin{document} \begin{Verbatim}[commandchars=\\\{\}] \textcolor[RGB]{255,0,0}{test} \end{Verbatim} \end{document} ...
7
votes
2answers
263 views

'Missing \begin{document}' when using the \lowercase trick

Mostly for fun, I'm trying to make % comments manipulatable using the \lowercase trick. For some reason, I'm getting a strange (to me) error: ERROR: LaTeX Error: Missing \begin{document}. --- TeX ...
3
votes
1answer
198 views

How avoid “\T1\ss ” as output from \immediate\write and get ß?

\usepackage[ngerman]{babel} \usepackage[T1]{fontenc} \usepackage[ansinew]{inputenc} ... \newwrite\outfile \immediate\openout\outfile=\jobname.txt % aßbc is a replacement for a long german text-block, ...
4
votes
1answer
126 views

LuaLaTeX : passing test condition n~=3 to lua as macro parameter problem

I try to pass lua test condition as latex macro parameter and have a problem in case of ~= with the next error message. How to avoid that. ! LuaTeX error [\directlua]:1: invalid escape sequence ...
6
votes
2answers
311 views

Replace digits by arbitrary symbols

I want to write some macro that replaces all digits in its argument by previously defined symbols or macros. I envision something like \overrideDigits{1234567890} which should expand to something ...
1
vote
1answer
457 views

Modify catcode in the preamble or in the \AtBeginDocument?

I want to modify the catcode of comma, with the following code \documentclass{article} \AtBeginDocument{% \catcode`\,=\active \protected\def,{...}% } \begin{document} a,b,c $a,b,c$. \end{document}...
2
votes
1answer
201 views

Argument until non-alphanumeric character

Not sure if this is possible or not... I would like to turn (say) + into a command with one argument without braces. This argument should be everything following the + up until the first non-...
2
votes
1answer
568 views

babel's active " making problems in math mode

MWE \documentclass[norsk]{beamer} \usepackage[utf8]{inputenc} \usepackage{babel} \usetheme{Warsaw} \begin{document} \begin{frame} ``forkaster hypotesen om at $P(\text{"mynt"})=0,5$''. \end{frame} ...
4
votes
1answer
173 views

How can I use the ampersand (&) as a delineator for tabs in LaTeX3 (expl3)/xparse syntax?

This idea evolved from the question: How can I get a count of the optional arguments with xparse? Problem I cannot get the ampersand to function as a delineator (for tab stops) inside the \...
3
votes
1answer
752 views

How to make hyperref work with bibitem keys containing a colon and using babel french option?

As seen in this thread, the \cite command bugs when the selected language is French and a bibitem key contains a :, which is an active character in babel french. Indeed, concerned hyperlinks always ...
3
votes
1answer
245 views

Error in some rare circumstances: babel with french option after listings, active character in moving argument, code in listing across pages

Edit: I have edited my question which initially wrongly focused on labels. This question is related to Code in \lstlisting breaks document (compile error). Let us consider the following MWE: \...
10
votes
1answer
321 views

Why does \def@#1\space not work?

The code \documentclass{article} \begin{document} \begingroup \catcode`@\active \def@#1\par{<#1>} @some text \endgroup \end{document} works flawlessly. Why not so when I replace it by the ...
21
votes
3answers
4k views

Use Markdown-style formatting for bold and italic

I rather like the system here where *...* is italic, **...** is bold, and ***...*** is bold italic. Is it possible to do that in (La)TeX? A MWE that implements the first one: \documentclass{article} ...