23

The recommended way of solving nested quotations in Norwegian is to use «» for the outer level and then alternating between ‘’ and “”. (Source)

Is it a large undertaking to do this with csquotes?

1 Answer 1

23

Define a new quote style and add appropriate level tests for the outer quotation marks:

\documentclass[12pt]{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[maxlevel=3]{csquotes}

\makeatletter
\DeclareQuoteStyle{threelevel}
    {\ifnum\csq@qlevel<2 \guillemotleft\else\textquotedblleft\fi}% opening outer mark
    {\ifnum\csq@qlevel<2 \guillemotright\else\textquotedblright\fi}% closing outer mark
    {\textquoteleft}% opening inner mark
    {\textquoteright}% closing inner mark
\makeatother

\ExecuteQuoteOptions{style=threelevel}

\begin{document}

\enquote{Jeg (temmelig hånlig): \enquote{I setter uvanlig pris på Dürer --
først kommer \enquote{Som jeg vil fryse etter solen} og nå sanduret fra Melancolia.}}

\end{document}

enter image description here

4
  • 4
    I've added two spaces in the definition; while in this case they're not strictly necessary, in other situations they may be crucial. When TeX is looking for a constant, it expands tokens until finding something (unexpandable) which can't be part of a number. So in your initial code, \guillemotleft would be expanded before the \ifnum\csq@qlevel<2 test is performed. Happily, the expansion of \guillemotleft doesn't start with a digit: you can guess what would happen. The spaces I added will be ignored.
    – egreg
    Jul 23, 2012 at 14:24
  • 1
    @egreg Is it correct that no spaces would be necessary if I had used \tw@ instead of 2?
    – lockstep
    Jul 23, 2012 at 14:31
  • 4
    Correct: \tw@ is unexpandable and TeX just fetches its value.
    – egreg
    Jul 23, 2012 at 14:34
  • 1
    Adding something like \MakeAutoQuote{«}{»} in your solution makes it easier to use since you can write «some text» instead of \enquote{some text}.
    – lalebarde
    May 7, 2014 at 7:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .