TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using \mathcode"69"69 in the preamble, as proposed in a comment in this question, to automatically typeset e and i upright in mathematical equations.

The question is, is there a way to get an italics i f.ex. as an index in math mode later? If so, how?

I tried $\mathit{i}$, which doesn't work.

share|improve this question
up vote 5 down vote accepted

Commands can be defined using the old mathcode settings for i and e:

\documentclass{article}

\mathchardef\iti=\mathcode`\i
\mathchardef\ite=\mathcode`\e
\mathcode`\i=`\i
\mathcode`\e=`\e

\begin{document}

\begin{displaymath}
4 + 7i = 4e^{10} + b_\iti^\ite
\end{displaymath}

\end{document}

Upright and italics for e and i

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.