
I 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
$$\mathbf{A},$$

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

\begin{verbatim}$$\vect{A}$$\end{verbatim} prints
$$\vect{A}$$
\end{document}

• 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 :( Nov 30 '21 at 7:16
• Commenting out the frontmatter environment solves the problem, but is of course not a solution for me Nov 30 '21 at 7:17

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

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.

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