biblatex icon indicating copy to clipboard operation
biblatex copied to clipboard

\uspunctuation, hyperref link quirk.

Open dcpurton opened this issue 8 years ago • 7 comments

I notice that when \uspunctuation is active along with hyperref, the link for an enquoted field includes the beginning quotation mark, but not the ending quotation mark. It makes the output look a little odd, especially if links are coloured rather than boxed. e.g.,

\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=verbose-note]{biblatex}
\usepackage[colorlinks]{hyperref}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{leyerle:1993,
  author = {Leyerle, Blake},
  title = {John Chrysostom on the Gaze},
  shorttitle = {Chrysostom},
  journaltitle = {Journal of Early Christian Studies},
  shortjournal = {JECS},
  volume = {1},
  date = {1993},
  pages = {159-174}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\pagestyle{empty}
\begin{document}
\cite{leyerle:1993}.
\cite{leyerle:1993}.
\end{document}

test

dcpurton avatar Oct 20 '16 05:10 dcpurton

@josephwright - were you looking at something to do with this previously?

plk avatar Oct 20 '16 05:10 plk

This came up today on TeX.SX https://tex.stackexchange.com/q/550991/35864

The cheap workaround is to swap the problematic field formats

\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=verbose-note]{biblatex}
\usepackage[colorlinks]{hyperref}

\renewbibmacro*{cite:short}{%
  \printnames{labelname}%
  \setunit*{\printdelim{nametitledelim}}%
  \printtext[citetitle]{%
    \printfield[bibhyperlink]{labeltitle}}}

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson}.

\cite{sigfridsson}.
\end{document}

but that does not resolve the underlying issue.

And I'm not too enthusiastic about applying sweeping changes like this to the standard styles.

moewew avatar Jun 24 '20 20:06 moewew

The above workaround does not appear to improve the citation of the shorttitle field for biblatex with style=sbl. @dcpurton, do you know if a similar workaround would be possible with biblatex-sbl?

jjmccollum avatar Jun 24 '20 21:06 jjmccollum

@jjmccollum, the workaround is likely a little more complicated for biblatex-sbl. I'll take a look.

dcpurton avatar Jun 25 '20 01:06 dcpurton

I can't believe I didn't think of doing this myself…

@jjmccollum, try adding this to your preamble and see if it helps:

\makeatletter
\renewbibmacro*{shorttitle}{%
  \iftoggle{blx@useshorttitle}
    {\iffieldundef{shorttitle}
       {\iffieldundef{title}
          {}
          {\ifbool{bbx@inset}
             {\printtext{\bibhyperlink{\strfield{setkey}}
                {\printtext[title]{\printfield[titlecase]{title}}}}}
             {\printtext[title]{%
                \printtext[bibhyperlink]{\printfield[titlecase]{title}}}}}}
       {\ifbool{bbx@inset}
          {\printtext{\bibhyperlink{\strfield{setkey}}
             {\printtext[title]{\printfield[titlecase]{shorttitle}}}}}
          {\printtext[title]{%
             \printtext[bibhyperlink]{\printfield[titlecase]{shorttitle}}}}}%
     \newunit}
    {}}
\makeatother

I haven't tested it thoroughly yet.

dcpurton avatar Jun 25 '20 02:06 dcpurton

@dcpurton, this works perfectly! Thank you so much. And thanks to @moewew for looking into a workaround in response to my TeX Stack Exchange question!

jjmccollum avatar Jun 25 '20 02:06 jjmccollum

@jjmccollum There are some other places that changes need to be made. The revdshorttitle macro also needs to be adjusted if you make use of the @review entry type. And there might be some other changes needed too.

dcpurton avatar Jun 25 '20 02:06 dcpurton