2

enter image description hereI am trying to define a command called \vec{} that prints a bold and non-italic symbol in math environment.

\renewcommand{\vec}[1]{\mathbf{#1}}

usually works for me, but not in the documentclass ifacconf. Instead,

\newcommand{\vect}[1]{\mathbf{#1}}

works here. Can someone please explain the difference to me?

Thank you! :-)

MWE:

\documentclass{ifacconf}
\usepackage{natbib}        % required for bibliography
%% own packages
\usepackage{amsmath}
\usepackage{amssymb}

%% own commands
\renewcommand{\vec}[1]{\mathbf{#1}}
\newcommand{\vect}[1]{\mathbf{#1}}

\begin{document}
\begin{frontmatter}

\title{Title, preferably not more than 10 words}

\begin{abstract}                
Abstract of not more than 250 words.
\end{abstract}

\end{frontmatter}
\begin{verbatim}
\mathbf{A}
\end{verbatim} prints
\begin{equation}
\mathbf{A},
\end{equation}

\begin{verbatim}
\vec{A}
\end{verbatim} prints
\begin{equation}
\vec{A},
\end{equation}

\begin{verbatim}
\vect{A}
\end{verbatim} prints
\begin{equation}
\vect{A}
\end{equation}
\end{document}
4
  • what error do you get, and where is ifacconf.cls ? Nov 30 '21 at 7:11
  • I do not get any error, but the result confuses me :(
    – Annika
    Nov 30 '21 at 7:16
  • Commenting out the frontmatter environment solves the problem, but is of course not a solution for me
    – Annika
    Nov 30 '21 at 7:17
0

I think the problem is simple: frontmatter overwrites your command. Solution: Just copy your line

\renewcommand{\vec}[1]{\mathbf{#1}}

and paste it after you ended frontmatter or even inside the frontmatter environment to get your command inside this environment there.

I hope this helps!

Cheers, Nick

4

Using

https://raw.githubusercontent.com/worc4021/ifac2017/master/ifacconf.cls

The class defines a command \undo@AMS specifically used in \frontmatter that redefines \vec to be bold italic.

So the simplest things are either go with the flow and use bold italic, or to define your own command as you show.

1
  • I got it, thank you very much!!! :)
    – Annika
    Nov 30 '21 at 7:21

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.