Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 18 down vote accepted

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

share|improve this answer
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 '12 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 '12 at 14:31
4  
Correct: \tw@ is unexpandable and TeX just fetches its value. –  egreg Jul 23 '12 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 at 7:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.