# Italic or not in equations? [duplicate]

I have written two equations for the report of my Master thesis:

$NLL_{k} = - \sum_{j=1}^n \ln(pdf(PD_{k}^{i},skill_{i}^{j}))$

$person_{k}(interest) = \dfrac{1}{n} \sum_{p=1}^n \dfrac{person_{k}(task_{p})}{\alpha_{k}^{i}}$


In math mode everything is italic (except \ln). Is this ok or how should this be correctly formated?

Second, let's say I would like to use part of the equation in text. For example, I would like to write "It is visible that $person_{k}$ has very high interest.". Should $person_{k}$ in this case be in italic?

## marked as duplicate by Mico equations StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jul 2 '16 at 9:43

• For such words I would use \text{person} etc, not in italic font. The reason why \ln is set upright is its definition as \DeclareMathOperator – Christian Hupfer Jul 2 '16 at 9:03
• never use the default math italic font for multi-letter words it is designed to make consecutive letters not look like a word, but as a product of variables. Even if you want the word in italic use \mathit{person} or \mathrm{person} for upright. (compare $difficult$ and $\mathit{difficult}$ – David Carlisle Jul 2 '16 at 9:10
• Whatever you choose, define a symbolic and semantic command, which will make absolutely easy to change the definition later. For instance \var or \mvar (math variable) could look good, but you can choose the name you want. – Manuel Jul 2 '16 at 9:43

Opinion based answer: For variables that have human readable names or are acronyms (somehow), I would prefer \text or a \DeclareMathOperator approach (or \mathit and \mathrm, depending on personal taste)

If the symbols are used more than once, markup macros are a better way

\documentclass{article}
\usepackage{mathtools}

\DeclareMathOperator{\pdf}{pdf}

\begin{document}

Original version

$NLL_{k} = - \sum_{j=1}^n \ln(pdf(PD_{k}^{i},skill_{i}^{j}))$

$person_{k}(interest) = \dfrac{1}{n} \sum_{p=1}^n \dfrac{person_{k}(task_{p})}{\alpha_{k}^{i}}$

With \verb!\text!:

$$\text{NLL}_{k} = - \sum_{j=1}^n \ln(\pdf(\text{PD}_{k}^{i},\text{skill}_{i}^{j}))$$

$\text{person}_{k}(\text{interest}) = \dfrac{1}{n} \sum\limits_{p=1}^n \dfrac{\text{person}_{k}(\text{task}_{p})}{\alpha_{k}^{i}}$

With \verb!\mathit!:

$$\mathit{NLL}_{k} = - \sum_{j=1}^n \ln(\pdf(\mathit{PD}_{k}^{i},\mathit{skill}_{i}^{j}))$$

$\mathit{person}_{k}(\mathit{interest}) = \dfrac{1}{n} \sum\limits_{p=1}^n \dfrac{\mathit{person}_{k}(\mathit{task}_{p})}{\alpha_{k}^{i}}$

\end{document}


• @machinery: Some purists say: yes, but I personally find italics math style for variable names awful – Christian Hupfer Jul 2 '16 at 9:09
• Alright, but what about "NLL" for negative log-lieklihood or "AIC" for the Akaike information criterion? Are these also acronyms? – machinery Jul 2 '16 at 9:11
• @machinery - "NLL" and "AIC" pretty much fit the very definition of acronym, don't they? – Mico Jul 2 '16 at 9:12
• @machinery $NLL$ is the markup for N times N times L, so you want \mathrm{NLL} or \mathit{NLL} or, perhaps \text{NLL} according to taste. (\text picks up the surrounding text font which may or may not be what you want) – David Carlisle Jul 2 '16 at 9:13