3
votes
1answer
147 views

How to override TeX dollars?

I've read about \renewenvironment and \let commands but they are intended to work with classic commands TeX commands that start with a slash. And I cannot find any example of overriding $ and $$ any ...
4
votes
1answer
67 views

Breaking inline equation at several punctuation characters

I am trying to define a command which automatically allows linebreaks inside inline equations at several punctuation characters — I am aware of \allowbreak but don’t want to manually insert it; here, ...
19
votes
4answers
1k views

Underscore in textmode vs mathmode

I use _ character often in text mode, so I changed category of underscore: \catcode\_=12, but that applies also to mathmode and now I'm unable to make subscripts with underscore in mathmode. Is there ...
14
votes
2answers
354 views

Removing double negative signs in equations

Intro: I am attempting to write a macro which can remove any extra negative signs in a general equation: 15.2 + -3.1 would be changed to: 15.2 - 3.1 when using the commands: ...
5
votes
2answers
556 views

Force LaTeX to obey spaces in math mode

I have experienced a very frustrating feature of LaTeX. I have used bnf.tex to be able to write a BNF grammar definition. As I found the notation <some text> very convenient, I decided to use ...
7
votes
1answer
153 views

Printing a character that has been made active in text and/or math mode?

I am not very familiar with TeX's category codes. If I use \catcode`\|=13 \renewcommand{|}{hello world} then every use of | in my document will be replaced by hello world. However, how would I be ...
7
votes
2answers
342 views

Active characters after \begin{document}

I'm using XeLaTeX and I want to do automatic repeating of plus sign after breakline. I've found the unoffical package for this but it seems to me a bit overkill (although didn't try it). I tried to ...