0

I am using the package lstcustom, it's a kind of listings.

And I get a confusing error "Missing number, treated as zero".

enter image description here

I cannot find what I am doing wrong.. :/ Do you have any suggestions?

The resulting pdf looks fine, I guess..

Thank you a lot for your help!

Edit: That's the code from above

\documentclass{beamer}

\usepackage[utf8]{inputenc}

\usepackage[ngerman]{babel}

\usepackage{lstcustom}

\begin{document}

\begin{frame}[fragile]

Die Zahlen können in verschiedener Form dargestellt werden:
        \begin{itemize}         
            \item Dezimalform
            \item Oktalform

\begin{lstlisting} int i = 011; System.out.println(i); // 9 \end{lstlisting}

        \end{itemize}
\end{frame}

\end{document}

mrbela
  • 1,129
  • 1
    screenshots are quite useless to debug errors. Learn to make a small, complete example that you can post here. – Ulrike Fischer Mar 09 '21 at 11:05
  • 1
    Allright, I understand. Edited and added a mwe. – mrbela Mar 09 '21 at 11:18
  • I cannot compile your MWE as the package lstcustom isn't available on my system. Can it be found online? If I replace \usepackage{lstcustom} with \usepackage{listings}, your test document compiles fine. – Mico Mar 09 '21 at 11:30
  • Hey Mico! Take a look above in my post, there is a link to the lstcustom file (on GitHub). Thank you for your help! – mrbela Mar 09 '21 at 12:26

1 Answers1

2

your style uses a color command in the postbreak key. That is rather fragile as the value is used in a discretionary. You can try to replace this with a box:

\documentclass{beamer}

\usepackage[utf8]{inputenc}

\usepackage[ngerman]{babel}

\usepackage{lstcustom}

\begin{document} \newsavebox\redarrow \sbox\redarrow{\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}} \lstset{postbreak=\usebox\redarrow}

\begin{frame}[fragile]

Die Zahlen können in verschiedener Form dargestellt werden:
        \begin{itemize}
            \item Dezimalform
            \item Oktalform

\begin{lstlisting} int i = 011; System.out.println(i); // 9 \end{lstlisting}

        \end{itemize}
\end{frame}

\end{document}

Ulrike Fischer
  • 327,261