4

When I write ``something'', I want the output to be one of the following inside the whole document, just changing one setup in the preambul:

  • "something"
  • « something »
  • “something”

One solution is to use « » everywhere in normal text, and use sed to output the different editions. But I wonder if there is a LyX or LaTeX smart solution.

I have had a look at the package csquotes, but I don't figure out if I can do it with it or not.

lalebarde
  • 769

1 Answers1

4

Would this be helpful for you?

% arara: pdflatex

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[english, ngerman, french]{babel}
\usepackage[autostyle]{csquotes}
\MakeAutoQuote{<}{>}

\begin{document}
\selectlanguage{english}
\noindent<Outer and <inner quote>>\\
\selectlanguage{ngerman}
<Outer and <inner quote>>\\
\selectlanguage{french}
<Outer and <inner quote>>\\
\end{document}

enter image description here

In your case, you can just load one language in babel, use the < and > syntax everywhere and select your quotes processing afterwards in the csquotes-options. The quotes will follow each language but you could still manually define different quote styles for each language. Type texdoc csquotes in your terminal, to get more information on this. Page 2 contains all you need.

If you want to set a document in one or more languages and change the editions afterwards, you may use the options for style and language variants. Lets assume, we set the great polyglot text from above for a Swiss magazine. It would look like this:

% arara: pdflatex

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[english, ngerman, french]{babel}
\usepackage[%
,autostyle=false
,style = german
,german = swiss 
]{csquotes}
\MakeAutoQuote{<}{>}

\begin{document}
\selectlanguage{english}
\noindent<Outer and <inner quote>>\\
\selectlanguage{ngerman}
<Outer and <inner quote>>\\
\selectlanguage{french}
<Outer and <inner quote>>\\
\end{document}

enter image description here

LaRiFaRi
  • 43,807
  • Please, load \usepackage[T1]{fontenc} whenever you need guillemets. – egreg May 06 '14 at 17:14
  • @egreg easy task ;-) And thanks for the info. Never using guillemets myself. – LaRiFaRi May 06 '14 at 17:27
  • 1
    To make it a "really Swiss" document, you'd have to use three (or more - don't forget Italian, let alone Romantsch) different languages as well as three different quote styles for the phrase. :-) – Mico May 07 '14 at 05:19