0

I am trying to get this little matrix to work but I cant seem to find a way to do it.

\documentclass{article}
\usepackage[utf8]{inputenc}


\usepackage{natbib}
\usepackage{graphicx}
\usepackage{german}
\usepackage{mathtools}

\usepackage{bm}

\begin{document}

\begin{align}
    \label{eg:Verstärkungsmatrix}
    \bm{\Bar{K}}_s &= 
    \begin{bmatrix*}[r]
            454.8000 & 8.8000 \\
            -44.8800 & 2.1200
    \end{bmatrix*}
\end{align}

\end{document}

The problem happens if I want to add \bm and \bar at the same time. Each on their on work perfectly fine.

2
  • @Martin-マーチン Yes I stripped the code I am using. I cant seem to find the reason its not working.
    – HWilmer
    May 16, 2020 at 11:33
  • 1
    german is obsolete. Do \usepackage[T1]{fontenc} and \usepackage[ngerman]{babel} instead.
    – egreg
    May 16, 2020 at 12:40

1 Answer 1

2

Not sure why, but the error is caused by the use of the german package. If you remove that package, it works. You can also circumvent the error by switching the \bar and \bm commands.

This:

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{natbib}
\usepackage{graphicx}
\usepackage{german}
\usepackage{mathtools}

\usepackage{bm}

\begin{document}

    \begin{align}
    \label{eg:Verstärkungsmatrix}
    \Bar{\bm{K}}_s &= 
    \begin{bmatrix*}[r]
    454.8000 & 8.8000 \\
    -44.8800 & 2.1200
    \end{bmatrix*}
    \end{align}

\end{document}

gives this:enter image description here

which is not exactly what you want but it may be close enough?

1
  • 3
    It wouldn't be a bad idea to remove \usepackage{german} either way. Nowadays one should prefer babel (\usepackage[ngerman]{babel} - ngerman für Neue Rechtschreibung, german for pre-1996 alte Rechtschreibung, see tex.stackexchange.com/q/67549/35864) or polyglossia over german. Not all modern packages are compatible with \usepackage{german}, but they usually work together with babel or polyglossia (I'm thinking biblatex and csquotes).
    – moewe
    May 16, 2020 at 11:45

You must log in to answer this question.

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