0

Consider the MWE:

\documentclass{memoir}

\usepackage{graphicx}
\captiontitlefont{\slshape}     % All captions slanted

\begin{document}

\begin{figure}
    \centering
    \includegraphics[width=\textwidth]{example-image}
    \caption{Flowchart of a gradient-based optimization algorithm. $ \Delta \alpha_i^{(k)} $ is the change of $ \alpha_i $ from iteration $ k $ to iteration $ k+1 $.}
\end{figure}

\end{document}

resulting in this figure (without the red line):

example_figure

The caption is slated, but numbers in math mode are not. In my opinion it looks weird that the '+1' is not slanted. It can be fixed (badly) by moving it outside math mode, but then the spacing is clearly wrong.

How do I make the entire caption slanted, but with variables like 'k' staying in math mode font?

  • 4
    It is standard convention: italic letters, upright numbers in math. – Przemysław Scherwentke Jun 4 '16 at 17:08
  • The easiest option is to use \mathit{k+1}, but then you'll probably complain that the operator + is not slanted. – Werner Jun 4 '16 at 17:09
  • 1
    \mathit{1} looks weird – user31729 Jun 4 '16 at 17:09
  • @Werner: You are absolutely correct. ;) – Thomas Jun 4 '16 at 17:10
  • 1
    your observation about emphasis is reasonable. i've never seen italicized captions in any math book or journal article, and maybe that has something to do with it. on the other hand, theorems are italicized, but the numerals in math are always upright (and careful publishers will also set "text" numerals, e.g. for dates, upright as well). – barbara beeton Jun 4 '16 at 20:27
3

I think these things are perhaps very sparse, so I'd suggest defining commands to solve your problem:

enter image description here

\documentclass{memoir}

\usepackage{graphicx}
\captiontitlefont{\slshape}     % All captions slanted
\newcommand{\slplus}{\mathbin{\mbox{\slshape +}}}
\newcommand{\slone}{\mbox{\slshape 1}}

\begin{document}

\begin{figure}
  \centering
  \includegraphics[width=\textwidth]{example-image}
  \caption{Flowchart of a gradient-based optimization algorithm. 
    $ \Delta \alpha_i^{(k)} $ is the change of $ \alpha_i $ from iteration $ k $ to iteration $ k \slplus \slone $.}
\end{figure}

\end{document}

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.