5

I have a question on reverting a bold math font to the 'normal' math font style. Following is an MWE:

\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{bm}

\DeclareMathOperator{\ricciPerm}{\bm{\mathcal{E}}}
\newcommand{\idx}[2]{{\mathrm{#1}}_{\scriptsize{#2}}}

\begin{document}

    \begin{equation}
        \begin{split}
            \idx{\ricciPerm}{ijk} A_{jk} &= x_i\\
            \ricciPerm : \bm{A} &= \bm{x}
        \end{split}
    \end{equation}

\end{document}

The compiled version looks so: enter image description here

In the context of my dissertation, I need to consistently convert between bold-faced and 'normal' math font styles. In the example, in the indexed notation, the calligraphic E should be in the non-bold font style, like the 'A' next to it.

I would like the \idx command to be able to convert any bold-faced symbols into light-faced ones. As you see in this MWE, I tried the \mathrm command to try to do this, but doesn't work.

I hope someone can help me with this simple problem.

Thanks,

Kavi

5
  • 2
    If both calligraphic E mean the same, they should also look the same - in math look matters. If they mean something different, define a dedicated command for the light variant. Jul 10, 2018 at 10:21
  • BTW: your use of \scriptsize should give you warnings, this is a text command not suitable for math mode. Thre really should not be any need to explicitly change the size there (BTW2 \scriptsize does not take any arguments it is an on switch)
    – daleif
    Jul 10, 2018 at 10:22
  • Thanks for the \let\bm\relax tip. While it worked for the calligraphic E, it also affected a variable (r) where it should have not. I've updated the code.
    – kane
    Jul 10, 2018 at 10:33
  • @UlrikeFischer It is convention in computational-mechanics to distinguish between bold- and light-faced fonts when referring to the tensors in the matrix and index notations.
    – kane
    Jul 10, 2018 at 10:36
  • Then your commands should reflect this meaning. It is not good to have a confusing mix of commands like \mathrm and \bm and some commands with meaning. Get a better logic in it. @egreg's answer shows what I mean. Jul 10, 2018 at 10:44

1 Answer 1

5

Define a proper alias for \bm, but which changes its action when in the scope of \idx:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{bm}

\newcommand{\tensor}[1]{\ifidx#1\else\bm{#1}\fi}

\newcommand{\ricciPerm}{\tensor{\mathcal{E}}}
\newcommand{\idx}[2]{\begingroup\idxtrue #1\endgroup_{#2}}
\newif\ifidx

\begin{document}

\begin{equation}
\begin{split}
\idx{\ricciPerm}{ijk} \idx{\tensor{A}}{jk} &= x_i\\
\ricciPerm : \tensor{A} &= \bm{x}
\end{split}
\end{equation}

\end{document}

enter image description here

Note that \DeclareMathOperator is not the right way to define \ricciPerm, which is just an ordinary symbol.

4
  • Thanks for the tip, but I still have a problem with your suggestion failing to typeset the r bold-faced in the new example. I've edited the MWE. Please have a look.
    – kane
    Jul 10, 2018 at 10:46
  • @kane Why are you using \DeclareMathOperator? Moreover, I didn't suggest \let\bm\relax, did I?
    – egreg
    Jul 10, 2018 at 10:55
  • Aha! I got that wrong! Your suggestion works with replacing the DeclareMathOperator with newcommand. Thanks. I'll accept your answer. BTW, should I change the MWE replacing the 'declare' command with the 'newcommand' for other viewers? I'm kinda new here.
    – kane
    Jul 10, 2018 at 10:58
  • @kane You shouldn't have modified the question to add a “working” solution. Please, roll back.
    – egreg
    Jul 10, 2018 at 11:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .