# Add special character in inline expression

I am tring to write this line using latex (on overleaf edit): modalité_classe1 , where classe1 appears as the index of modalité . So I tried this command:

$modalité_{classe1}$


It seems to work, however in my output the é got removed. To me , it is a special character, but i didn't find how to handle it within a $...$ inline expression.

• Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – albert Aug 7 '18 at 12:10
• something like $\text{modalité}_{\text{classe1}}$ (needs amsmath)? – moewe Aug 7 '18 at 12:16

Updated as per @DavidCarlisle's comment and removed the math inline.

With lmodern with fontenc (with T1), you can achieve by using \'

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\begin{document}
modalit\'e\textsubscript{classe1}
\end{document}


to get this output:

But I hope this helps.

• No please don't suggest doing this, you should not use math italic for multi-letter words so $modalite_{classe1}$ is already wrong even though it gives no error. – David Carlisle Aug 7 '18 at 12:30
• @DavidCarlisle May I know how else to achieve this? Since, it did not bump me with errors I thought it was okay :D. – Raaja Aug 7 '18 at 12:32

$modalit\textrm{é}_{classe1}$

• Your solution is not quite good on a typographic point of view. modalit would be math-styled \textrm{é} woud be roman style. Just a quick tip: If you only need this to have classe1 as a subscript, you can use modalité\textsubscript{classe1} instead? – BambOo Aug 8 '18 at 10:24
• Ye sure ! yours is also a solution to the same issue. :) I did use this expression $\textrm{modalité}_{classe1}$ – mouni93 Aug 8 '18 at 10:33