4

If I try to type -- or >> (resp. <<), LaTeX puts them together and makes one big -, respectively guillemets. How can I change that behavior? I have to use LuaLaTeX to compile my source.

\documentclass{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{minted}

\begin{document}
\begin{minted}{shell-session}
$ cat <<EOM >> ./test.txt
> Text
> Text
> EOM
$ application --file ./test.txt
\end{minted}
\end{document}
  • 2
    Welcome to TeX.SX! I cannot reproduce the issue. Can you please add a full (but short) example, from \documentclass up to \end{document}, that shows the problem? – egreg Dec 15 '18 at 11:05
  • please provide a complete example including font configuration and tell us if you use pdflatex or lualatex. I can not reproduce issue with up-to-date latex. – user4686 Dec 15 '18 at 11:06
  • ii edited my questions and added hopefully all informations you need. – cortesis Dec 15 '18 at 11:22
  • 2
    if you are using luatex why \usepackage[T1]{fontenc} so disabling most of luatex's font handling? – David Carlisle Dec 15 '18 at 11:52
  • 1
    David's question was not why you are using lualatex, but why you are using \usepackage[T1]{fontenc} and so breaking the font setup of lualatex. – Ulrike Fischer Dec 15 '18 at 12:08
4

It is best if you don't load fontenc with LuaLaTeX. If you really need to, then you can disable ligatures for the monospaced font.

\documentclass{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{minted}
\usepackage{microtype}

\DisableLigatures{encoding = T1, family = tt* }

\begin{document}

This has ligatures: fi fl ffi ffl,
en-dash --,
em-dash ---,
guillemets <<>>


\begin{minted}{shell-session}
$ cat <<EOM >> ./test.txt
> Text
> Text
> EOM
$ application --file ./test.txt
\end{minted}

\end{document}

enter image description here

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.