Linked Questions

39
votes
1answer
1k views

The \lowercase trick

We have a number of questions or rather answers using (and explaining) the \lowercase “trick”. \begingroup \lccode`\~=`\. \lowercase{\endgroup\def~}#1{foo with #1} However, after reading on ...
16
votes
3answers
3k views

Can I change the font and colour of a letter permanently?

For my lectures, I like to colour the symbols in the equations to make it easier to follow what's going on - a bit like syntax highlighting. So all vector spaces are one colour, all sets another, e ...
15
votes
2answers
453 views

Macro to take a character as argument, make it active, then \def it.

I have a XeLaTeX document in which I want some unicode symbols to be auto-substituted, like ¼ → 1/4, » → >>, « → <<. But instead of a long list like \catcode`\¼=\active\def¼{1/4} \catcode`\«=\...
13
votes
2answers
1k views

“Activate” active characters in argument passed as macro

Let's say I have some macro (\iPrint in the MWE) that internally uses active characters to interpret its argument: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \...
7
votes
2answers
183 views

Why does the amsmath package define \std@minus and \std@equal?

The amsmath package secures away the original \mathcode of the minus and equal signs, and subsequently uses the saved values in the macros that provide the extensible arrows (e.g., \leftarrowfill@). ...
6
votes
1answer
441 views

How do you define macros to toggle a character active and define a macro for it?

I'm experimenting with core tex in order to learn some basics. My goal is to define a shorthand environment which makes use of active characters. The general idea is to activate the used characters ...
0
votes
1answer
1k views

Redefining asterisk (*) in math mode

I am attempting to use a symbol from a separate font for the centered asterisk (∗) math operator. The font in question only has the heightened (in many fonts) asterisk glyph (*), which I try to use ...
5
votes
2answers
117 views

How to redefine spacing of a symbol inside a macro?

When writing mathematics expression, I would like to remove the space around the symbol +. For a simple expression a+b, I can do it by enclosing + like a{+}b. But it requires more labor work for ...
10
votes
1answer
145 views

Active ! Character Hangs within TikZ

The MWE below makes the ! active in math mode using the solution from Make Characters Active via Macro in Math Mode and uses the tikz \hcancel via Diagonal strikeout starting too low and ending too ...
3
votes
1answer
132 views

Make inline maths break before binary operator

By default, inline maths breaks long expressions in such a way that the line break happens after binary operators, e.g. a + b + c + d Is there any easy way to convince TeX to break before the binary ...