3

I'm trying to write some text in bold font but some symbols are not set in bold properly. The emphasis is set with \bfseries and is correct for :: and = but not enough for > and -. See below image for details.

Example

I'm working in a lstlisting environment in beamer but in normal latex environment I have the same result.

Is there a way to have the same emphasis on these symbols? A specific font or package to load?

Here is a minimal example :

\documentclass[xcolor=dvipsnames]{beamer}
\usepackage[french]{babel}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\usepackage{listingsutf8}


\begin{document}

\begin{frame}[containsverbatim]
\frametitle{Zip}
\begin{lstlisting}[language=haskell,basicstyle=\bfseries]
zip :: [a] :: => -> [b] -> [(a, b)]  
\end{lstlisting}
\end{frame}

\end{document}

Best regards.

  • 3
    Please post a complete, minimal document with the relevant settings and illustrating the problem. – Gonzalo Medina Feb 24 '15 at 0:37
  • amsmath provides \boldsymbol; compare $\boldsymbol{:-=>}$ to $:-=>$ – Werner Feb 24 '15 at 0:41
3

Listings is using math mode for some characters so you can add \boldmath to the style, but then still in OT1 with cm fonts substitutions make some characters non bold, here I use T1 latin modern which gets a slightly more consistent look:

enter image description here

\documentclass[xcolor=dvipsnames]{beamer}
\usepackage[french]{babel}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\usepackage{listingsutf8}
\usepackage{lmodern}

\usepackage[T1]{fontenc}

\begin{document}
\showoutput
\begin{frame}[containsverbatim]
\frametitle{Zip}
\begin{lstlisting}[language=haskell,basicstyle=\bfseries\boldmath]
zip :: [a] :: => -> [b] -> [(a, b)]  
\end{lstlisting}


\end{frame}

\end{document}

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.