Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\enquote is not guarding againsts internal font changes #29

Open
FrankMittelbach opened this issue Nov 13, 2019 · 6 comments
Open

\enquote is not guarding againsts internal font changes #29

FrankMittelbach opened this issue Nov 13, 2019 · 6 comments
Assignees
Labels

Comments

@FrankMittelbach
Copy link

If there is a font change inside \enquote it affects the right quote!

Example:

\documentclass{article}

\usepackage{csquotes}

\begin{document}

\fontfamily{Overlock-LF}\selectfont

A \enquote{test}.

And another \enquote{\fontfamily{cmr}\selectfont test}.

\showoutput

\end{document}

Which gives

enquote-bug.pdf

@josephwright josephwright self-assigned this Nov 13, 2019
@josephwright
Copy link
Owner

Suggestions? I'm not clear what would be a 'good' fix for the font situation.

@FrankMittelbach
Copy link
Author

FrankMittelbach commented Nov 13, 2019 via email

@FrankMittelbach
Copy link
Author

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.

@FrankMittelbach
Copy link
Author

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.

@schlcht
Copy link

schlcht commented Sep 10, 2022

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}

@FrankMittelbach
Copy link
Author

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}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants