Open FrankMittelbach opened 5 years ago
Suggestions? I'm not clear what would be a 'good' fix for the font situation.
Suggestions? I'm not clear what would be a 'good' fix for the font situation.
assumption you want the same "outer" font for both left and right quote,
so save the current font away roughly in \csq@bqgroup (I guess) and restore it just before you typeset the right quote.
Might need some stack handling but perhaps not.
Might actually be enough to add an inner group around the argument use, e.g., \enquote{{\fontfamily{cmr}\selectfont test}}
already works but of course that should be done internally by \enquote
and not something the user needs to do.
Any update on this? I would presume that all this is in fact needed is to ensure that the argument is processed locally by surrounding it with a brace group inside the definition, i.e.,
\long\def\csq@quote@i#1#2#3{%
\csq@bqgroup#1\csq@oqopen@i{#3}\csq@qclose@i{#2}}
\long\def\csq@quote@ii#1#2#3{%
\csq@bqgroup#1\csq@iqopen@i{#3}\csq@qclose@i{#2}}
to localize any font changes in #3
.
This fix doesn't seem to be a good idea as the kerning around quotation marks will no longer be restored:
\documentclass{article}
\usepackage{csquotes}
\DeclareQuoteStyle{test}{V}{V}{v}{v}
\ExecuteQuoteOptions{style=test}
\begin{document}
\enquote{A}
VAV
\makeatletter
\long\def\csq@quote@i#1#2#3{% original definition
\csq@bqgroup#1\csq@oqopen@i#3\csq@qclose@i{#2}}
\enquote{A}
\showoutput
\end{document}
Ah, good point, then perhaps it has to be somewhat more convoluted, e.g.
\long\def\csq@quote@i#1#2#3{%
\csq@bqgroup\expandafter\let\expandafter\myfont\the\font#1\csq@oqopen@i#3\expandafter\ifx\the\font\myfont\else\myfont\fi\csq@qclose@i{#2}}
If there is a font change inside \enquote it affects the right quote!
Example:
Which gives
enquote-bug.pdf