2

Could someone post a complete minimal input file for LuaLaTeX to output

"Hallo"

also to get around ,,Hallo´´

In LaTeX I would have written

``Hallo´´


%% Minimal Inputfile for LuaLaTeX
\documentclass[a4paper]{scrartcl}
\usepackage{polyglossia}
\setdefaultlanguage[spelling=new, babelshorthands=true]{german}
\usepackage{fontspec}
\usepackage{csquotes}

\begin{document}

\enquote{Hallo--mit enquote--this is working}

But: how to produce the euivalent Text, based on babelshorthands?

“`Hallo”’  --- is not working

\end{document}
2
  • Hallo. Ich verstehe nicht richtig was Du machen willst. Willst Du "Hallo" drucken oder ,,Hallo´´ ?
    – Trefex
    Apr 17, 2014 at 15:51
  • 1
    Better: \usepackage[ngerman]{babel} \usepackage{csquotes} & Ich schreibe ``Hallo'' so: \enquote{Hallo}.
    – jon
    Apr 17, 2014 at 16:13

2 Answers 2

2

For babel-style shortcuts, don't use "smart" quotes: using "dumb" double quotes is the way to go.

enter image description here

\documentclass[a4paper]{scrartcl}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage[spelling=new, babelshorthands=true]{german}
\usepackage{csquotes}

\begin{document}
\enquote{Hallo} --- with \texttt{\string\enquote}, this works

"`Hallo"'  --- with \verb+"`+ and \verb+"'+, this works too
\end{document}
1

The conversion from ``Hello'' to „Hello“ via a feature file.

Disadvantages:

  • Copy&paste will catch the first form.
  • LuaTeX only.

Example file:

\documentclass{article}

\usepackage{fontspec}
\usepackage{filecontents}

\begin{filecontents*}{germanquotes.fea}
# germanquotes.fea
languagesystem DFLT dflt ;
languagesystem latn dflt ;

feature liga {
  sub \grave \grave by \quotedblbase;
  sub \quotesingle \quotesingle by \quotedblleft;
} liga;
\end{filecontents*}

\setmainfont[
  Ligatures=TeX,
  FeatureFile={germanquotes.fea},
]{Latin Modern Roman}

\begin{document}
  ``Hello'' -- fi fl

  \textit{``Hello'' -- fi fl}

  \textbf{``Hello'' -- fi fl}
\end{document}

Result

Disclaimer: My first experiment with a feature file.

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.