# Tag Info

Accepted

### Use Markdown-style formatting for bold and italic

The nice thing here is that you can turn the feature on with \starON and turn it off with \starOFF (the default condition). Here is the MWE. \documentclass{article} \makeatletter \def\starparse{\@...
Accepted

### How to deactivate % as special character?

You can make % punctuation character by \catcode\%=12
• 668k

### How to deactivate % as special character?

In ConTeXt you can use ASCII mode by saying \asciimode. This will disable the special meaning of #\$%&^_|~ for the whole document from that point. You can still have comments with double percent ...
• 105k
Accepted

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

There are three issues here, two about performance and one about 'safety'. A \chardef'd token is parsed slightly faster than TeX looking for the end of a number, so \active is a little better in that ...
• 243k

### Use Markdown-style formatting for bold and italic

The following solution uses LuaLaTeX's capabilities to define a function, called allstars, which converts instances of pairs of groups of asterisks -- ***...***, **...**, and *...* -- into "...
• 439k
Accepted

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

\def@#1\space{<#1>} doesn't work, unless TeX finds the token \space before the current paragraph ends. Recall that TeX doesn't do expansion when absorbing the parameter text of a macro looking ...
• 993k
Accepted

### In LaTeX3, how do I peek ahead for an active character?

You're almost there. \exp_last_unbraced:NV expands \c_catcode_active_tl only once, then \exp_last_unbraced:NV \peek_catcode_ignore_spaces:NTF \c_catcode_active_tl { true } { false } becomes \...
• 67.6k
Accepted

### Replace digits by arbitrary symbols

Changing category codes is the worst method, in my opinion. Here's a simple implementation with xparse: \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\overrideDigits}...
• 993k
Accepted

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

\documentclass{article} \usepackage{amsmath} \usepackage{bm} \catcode*=13 \def*{\relax\ifmmode\expandafter\bm\else\expandafter\bstar\fi} \def\bstar#1*{\textbf{#1}} \begin{document} *this bold* ...
• 668k
Accepted

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

The '\lowercase trick' relies on you having a char that is already active. The usual one in a document is ~ as it is active in plain, LaTeX and ConTeXt for creating a non-breaking space. However, ...
• 243k
Accepted

### LuaTeX analogue of \ifcsname for active characters

The manual says Active characters are internally implemented as a special type of multi-letter control sequences that uses a prefix that is otherwise impossible to obtain. Poking around the ...
• 668k

### Replace digits by arbitrary symbols

Here's a LuaLaTeX-based solution. I deliberately didn't optimize the Lua-side code, to make it easy to modify the output of each substitution operation even if you're not at all not familiar with Lua. ...
• 439k

### Apostrophe in math formula prevents luatex compilation for Slovak

slovak.ldf loaded by \usepackage[slovak]{babel} is from 2008, it has not be adapted to the unicode engines and is imho completly useless and unsuited. An alternative is to use the new ini-files from ...
• 294k

### What are use-cases for active characters?

The classic example is ~ which in plain tex and latex is a macro (also known as \nobreakspace in LaTeX) that makes a non breakable space. In LaTeX every character (byte) above 127 is active to ...
• 668k

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

A \chardef token is not a character, but a command to print a character. As such, it is not allowed inside \csname...\endcsname where only character tokens (after macro expansion) are permitted. The ...
• 993k
Accepted

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

Yes, you're right: the comma is made active in order to break ligatures (,, is a ligature defined in the T1 encoded fonts). Since this is done as part of the initialization of verbatim environments, ...
• 993k
Accepted

### Make equality-sign automatically blue

You need to make = math active. \documentclass{article} \usepackage{amsmath} \usepackage{xcolor} % set up = to be math active \begingroup\lccode~==\lowercase{\endgroup\def~}{\mathrel{\textcolor{...
• 993k
Accepted

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

Here in short whats going on. The colon is defined as \active@prefix :\active@char:. This definition is so that under certain conditions (e.g. in a protected@write, or when \if@safe@actives is true (...
• 294k
Accepted

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

Upon seeing \MakeAutoQuote or \MakeAutoQuote*, csquotes defines \csq@string@<number> for both arguments in a suitable way. The <number> represents the decimal ASCII codes of the UTF-8 ...
• 993k

### Use Markdown-style formatting for bold and italic

If you have not objection to use ' instead of *, then the wiki package is the easy solution. This way there are not collision with starred macros. Moreover, it use the common Wikipedia syntax and ...
• 73.3k
Accepted

### Modify catcode in the preamble or in the \AtBeginDocument?

In the argument of \AtBeginDocument, the comma is not active. The comma becomes active, when the argument with the category code setting is executed later in \begin{document}. Also keep in mind, that ...
• 262k
Accepted

### babel's active " making problems in math mode

This is described in the babel documentation as a typical error, see section 1.5 on Shorthands. The problem is caused by the combination "}; the solution given is to add an empty pair of braces so ...
• 92k

### How to deactivate % as special character?

A category code assignment is of the form \catcode <number> = <number> (spaces and = are optional). The first <number> is the character we want to assign the category code (so ...
• 993k
Accepted

### Code redefining ampersand stops working when put in command

This will work: \documentclass[]{article} \begin{document} \newcommand{\myampersand}{?} % https://tex.stackexchange.com/a/392770/82912 \begingroup% \catcode`&=\active% \gdef\redefineampersand{\...
• 67.6k
Accepted

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

Every verbatim environment (also fancyvrb's descendants) explicitly sets & to category code 12 before starting to read the material. The fancyvrb package has a facility to state category codes of ...
• 993k

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

Currently I use texlive of debian-linux. After updating the debian-package luaotfload-tool, compiling the following via lualatex \documentclass{article} \usepackage{iftex} \ifPDFTeX \usepackage[T1]{...
• 23.5k

### In LaTeX3, how do I peek ahead for an active character?

An alternative way to extract the active character token from \c_catcode_active_tl is to use \exp_args:Ne: \documentclass{article} \ExplSyntaxOn \NewDocumentCommand\zzMath{}{ \...
• 668k
Accepted

### Conflict of active strings in WinEdt

Q. I would like to know whether there is a solution still using the original active strings "\c?}" and "\f?}" A. No, there is no solution. As you've noticed already, when you type "}" the first ...
• 120k
Accepted

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

You're trying to start a loop in a cell, ending it in another one. This can't work, because alignment cells form groups. You want to use \clist_use:Nn \documentclass[draft]{article} \usepackage{...
• 993k