0

I'm composing a text, in which people will have access for some math questions, and their sequent solutions. Thing is, I want to put the whole question texts in italics, and \textit{} doesn't work on math mode (I have to use \mathit{} inside \textit{}). Is there such a command or an environment which turns both normal and math texts into italics?

  • 2
    If you're using \text (from amsmath) to set your text inside the math content, then it should transfer the prevailing text formatting. If not, then you're doing something different. Can you include something that shows what you're currently doing and what you expect the output should look like? – Werner Mar 6 '16 at 19:19
  • For instance, I want to add on this question: "Determine five numbers in arithmetic progression knowing its sum 40 and the sum of the inverse of its extremes, \frac{1}{3}." If I do this \textit{Determine five numbers in arithmetic progression knowing its sum 40 and the sum of the inverse of its extremes, \frac{1}{3}.}, it doesn't turn the \frac{1}{3} into italics. I have to do \mathit{\frac{1}{3}} also. So, I was asking if there is a command in which \command{...} turns the whole ... into italics (or an environment). – Italo Marinho Mar 6 '16 at 19:27
  • 2
    (La)TeX has been specifically designed not to do what you are asking for, because it is typographically wrong: mathematical symbols should stay upright even within italicized text. If you insist on your point of view, I’m afraid that specifying \mathit each time (or an abbreviation thereof, which you can always define) is the easiest solution. (Note: I refuse to suggest using \it! :-) – GuM Mar 6 '16 at 23:19
  • 2
    @GustavoMezzetti -- numerals and punctuation in math are traditionally set upright. letters meant as variables are italic. the shape of integrals may be either upright or sloped, depending on "local" tradition (upright in russia, sloped in the west). for other symbols such as plus and (in)equalities, the shape is fixed, and upright. but a slash for negation may be upright or sloped either forward or backward, each with a distinctly different meaning. don't tinker with the traditions. – barbara beeton Mar 7 '16 at 2:31
  • 1
    @barbarabeeton: You are right, I expressed myself very poorly—my fault. Where I spoke of “mathematical symbols”, I actually meant the kind of symbols the OP mentioned in her/his question, that is, numerals. Please do believe that I did not intend that variables should be set in upright shape! :-) Useful comment, in any case. – GuM Mar 7 '16 at 14:08
1

I can't say I recommend this but it is possible to make the font specified by \mathit{..} "leak out" of that group and apply to the whole math expression.

enter image description here

\documentclass{article}

\newcommand\zz[1]{\textit{\everymath{\mathit{\xdef\zzfam{\the\fam}}\fam\zzfam\relax}#1}}
\begin{document}


1 aaaa $1+\frac{2}{3}$

\bigskip

2 \textit{aaaa $1+\frac{2}{3}$}

\bigskip

3 \zz{aaaa $1+\frac{2}{3}$}

\end{document}
  • Oh God, finally!! Yes, that's what I was looking for at the time. Awesome solution! – Italo Marinho Apr 16 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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