3

I am trying to get a listing into my LaTeX document.

A simple listing would be the following XML:

<!-- Lüscher-Weiß with β -->

Then I try to get this into my document.

\documentclass[english]{scrartcl}

\usepackage{babel}

\usepackage[utf8]{luainputenc}

\RequirePackage[charter, greekuppercase=italicized]{mathdesign}
\RequirePackage{berasans}
\RequirePackage{beramono}

\usepackage{shellesc}
\usepackage{minted}

\newmintedfile[listingxml]{xml}{
    encoding=utf8,
    fontsize=\scriptsize,
    style=bw,
    outencoding=utf8,
}

\begin{document}

\listingxml{listing.xml}

\end{document}

What I get is somewhat close, but not good:

enter image description here

There are two issues:

  • The two hyphens are combined into an en-dash, which is not what I want.
  • The literal UTF-8 “beta” is removed. At least the “ü” and the “ß” are there with luainputenc.

With listings instead of minted I get similar results:

enter image description here

listingsutf8 package does the same.

Why is this literal “beta” missing? I thought that LuaLaTeX and everything with UTF-8 would finally free me from encoding problem? 😫

6

I think that beramono does not include Greek character support. Try a different font.

\documentclass{article}
\usepackage{fontspec}
\usepackage{parskip}
\usepackage{listings}
\usepackage{minted}
\setmonofont{DejaVu Sans Mono}[Scale=MatchLowercase]
\pagestyle{empty}
\begin{document}
\lstset{%
  language=XML,
  basicstyle=\ttfamily
}
With listings:
\begin{lstlisting}
<!-- Lüscher-Weiß with β -->
\end{lstlisting}
With minted:
\begin{minted}[fontfamily=tt]{XML}
<!-- Lüscher-Weiß with β -->
\end{minted}
\end{document}

enter image description here

  • Indeed, it is an issue with the font! – Martin Ueding Jul 30 '17 at 13:25

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.