1

I have ben using the \xcapitalisefmtwords from the mfirstuc package (mentioned in the questions in the References section). However, that fails if the content contain any math content.

Is there any easy way to disable the parsing of any math?

References:

Code:

\documentclass{article}
\usepackage{amsfonts}

\usepackage{mfirstuc}
\newcommand{\TitleCase}[1]{\xcapitalisefmtwords{#1}}%

\begin{document}
    \TitleCase{hello world}

    %\MFUnocap{$\mathbb{C}$}%
    \TitleCase{hello $\mathbb{C}$ world}%  <-- How do I get this to work

    Desired Output: Hello $\mathbb{C}$ World
\end{document}
Peter Grill
  • 223,288

1 Answers1

3

enter image description here

\documentclass{article}
\usepackage{amsfonts}

\usepackage{mfirstuc}
\newcommand{\TitleCase}[1]{\xcapitalisefmtwords{#1}}%

\protected\def\Cb{$\mathbb{C}$}
\begin{document}
    \TitleCase{hello world}

    %\MFUnocap{$\mathbb{C}$}%
    \TitleCase{hello {\Cb} world}%  <-- How do I get this to work

    Desired Output: Hello $\mathbb{C}$ World
\end{document}

Original image that Barbara asked about

enter image description here

David Carlisle
  • 757,742