In the case of nested quotations, we have the following rule in French typography: if two or more closing quotation marks follow one another, we will write only one closing quotation mark.
Thus:
« Bla bla « bla bla bla « bla bla »»»
will become
« Bla bla « bla bla bla « bla bla »
But
« Bla bla « bla « bla bla » bla » bla »
stay
« Bla bla « bla « bla bla » bla » bla »
How do you do that in LaTeX?
Here's where I'm stuck: I can't implement the "quotation marks must follow each other" condition.
\documentclass{article}
\usepackage[french]{babel}
\usepackage{ifthen}
\makeatletter
\newcounter{nesting@depth}
\providecommand{\guillemets}[1]{%
\addtocounter{nesting@depth}{1}%
\og%
#1%
\ifthenelse%
{\value{nesting@depth}>1}%
{}%
{\fg{}}%
\addtocounter{nesting@depth}{-1}%
}
\makeatother
\begin{document}
\guillemets{Bla bla \guillemets{ bla bla bla \guillemets{bla bla}}}
\end{document}
csquotes
package: github.com/josephwright/csquotes/blob/…, although I am pretty sure they are already aligned with the Lexique.