Questions tagged [active-characters]
57 questions
6
votes
1 answer
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 work?
Gradient
- 489
4
votes
2 answers
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}{?}
%…
xavierm02
- 787
3
votes
2 answers
Active character can be defined, but not within \def?
This is a follow up to my earlier question here: Detect catcode of next character?
What I want to do: Count the number of " used in the document body. I am not using " for purposes such as math, babel shortcuts, or Unicode characters. Just dialog…
rallg
- 2,379
2
votes
1 answer
Make <: ... :> acts like one macro
I use jinja to write templates. This makes me work with files like the one below.
\documentclass[a4paper, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\newcommand\devtool[1]{\fbox{#1}}
\begin{document}
$f(x) = <:f:>$…
projetmbc
- 13,315
1
vote
1 answer
What characters are active by default in TeX?
Since the character ~ has a catcode of 13, it is considered active. I can (ab)use this by executing something like the code
\let~\catcode ~`a8 which assigns the character a a catcode of 8 (for subscript), without having to do \catcode`~13…
btshepard
- 680
1
vote
1 answer
\lccode to be activate in latex command
Why does \lccode`~=`, with an active , work only in an environment definition but not in a LaTeXcommand? We are using an active , to produce bullets:
Here is an…
Rajesh N
- 829