2

I'm using the struktogram environment from the struktex package to draw structograms in my report. The problem is that the package apparently changes some font definitions, so the formulae in equation environments and in math-mode don't match with the text anymore. Changing the position of \usepackage{struktex} doesn't help and I couldn't figure out a way to reverse the effect. Please note that I need to use the scrreprt class and the font according to the MWE provided below. I'm using pdflatex to compile the sources.

Here is an example of the desired result: desired

And here is what it looks like when using struktex: wrong

  • How do I redefine the correct math-fonts after the package is included?
  • Is there a way to use the package only locally, so other parts of the document won't be affected?
  • Do you have an even better suggestion to achieve the desired result?

Here is a minimal working example to reproduce the behavior:

\documentclass{scrreprt}

\usepackage[standard-baselineskips]{cmbright}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{ae}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{struktex}     % <-- comment out to get the proper math-fonts

\begin{document}

    \section{Structogram}
    \begin{struktogramm}(120,7)
        \assign{A very simple structogram}
    \end{struktogramm}

    \section{Math}
    \begin{equation*} \label{eq:mel_approx_log}
        X(f) = 1234 \cdot \log_{10} \left(1 + \frac{f_s}{2}\right)
    \end{equation*}

\end{document}
2

See section 4.1 in the documentation of struktex: you have to issue \MathNormal if you want to get the “normal” math font.

\documentclass{scrreprt}

\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[standard-baselineskips]{cmbright}

\usepackage{struktex}
\MathNormal % <----------- ADD THIS

\begin{document}

    \section{Structogram}
    \begin{struktogramm}(120,7)
        \assign{A very simple structogram}
    \end{struktogramm}

    \section{Math}
    \begin{equation*} \label{eq:mel_approx_log}
        X(f) = 1234 \cdot \log_{10} \left(1 + \frac{f_s}{2}\right)
    \end{equation*}

\end{document}

enter image description here

By the way, avoid loading ae: it's been obsolete for several years.

  • This works perfectly, thanks. The documentation of struktex is not clear on the real effect of \MathNormal and its usage to prevent what has happened in my case. A really good finding. – Matt Jan 18 '16 at 23:46

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.