3

The following MMW ...

\documentclass{article}

\usepackage{fontspec}
\usepackage[backend=biber, style=authoryear]{biblatex}

%\usepackage{libertinus}
%\usepackage{textcomp}

\begin{filecontents}{\jobname.bib}
@book{Doe2017,
title    = {Using straight single quotes properly \textquotesingle},
author   = {Doe, John},
location = {San Seriffe},
year     = {2017},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\cite{Doe2017} shows how to use straight single quotes \textquotesingle{} properly.
\printbibliography
\end{document}

yields this result:

enter image description here

How do I get the single straight quotation mark from the main-text displayed as such in the bibliography?

(I don’t have the option to switch to a regular curved single quotation mark, as I have an instance where the author of the text cited in the bibliography chose the single straight quotation mark for a specific linguistic reason and must be quoted as such.)

I switched the font-package and textcomp on and off, and the result didn’t change.

2 Answers 2

4

Use a different name. I show two possibilities: with \straightquote the current font shape is not taken into consideration; with \varstraightquote it is.

\begin{filecontents*}[overwrite]{\jobname.bib}
@book{Doe2016,
  title    = {Using straight single quotes improperly \textquotesingle},
  author   = {Doe, John},
  location = {San Seriffe},
  year     = {2016},
}
@book{Doe2017,
  title    = {Using straight single quotes properly \straightquote},
  author   = {Doe, John},
  location = {San Seriffe},
  year     = {2017},
}
@book{Doe2018,
  title    = {Using straight single quotes \varstraightquote},
  author   = {Doe, John},
  location = {San Seriffe},
  year     = {2018},
}
\end{filecontents*}

\documentclass{article}
\usepackage{fontspec}
\usepackage[backend=biber, style=authoryear]{biblatex}

\addbibresource{\jobname.bib}

\NewDocumentCommand{\straightquote}{}{\textup{\textquotesingle}}
\NewDocumentCommand{\varstraightquote}{}{\textquotesingle}

\begin{document}

\cite{Doe2016} shows how not to use straight single quotes \textquotesingle{} properly.

\cite{Doe2017} shows how to use straight single quotes \textquotesingle{} properly.

\cite{Doe2018} shows how to use straight single quotes \textquotesingle{} in a different way..

\printbibliography

\end{document}

output

Apparently, Biber is coerced into changing \textquotesingle into ', but happily it knows nothing about \straightquote.

3

You can redefine the character ', but this is dangerous and can become a problem with some other packages, so use at your own risk:

\documentclass{article}


\usepackage{fontspec}
\usepackage[backend=biber, style=authoryear]{biblatex}

\makeatletter\catcode`'=\active\def'{\textquotesingle}\makeatother
\begin{filecontents}{\jobname.bib}
@book{Doe2017,
title    = {Using straight single quotes properly\emph{\textquotesingle{}}},
author   = {Doe, John},
location = {San Seriffe},
year     = {2017},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}

\cite{Doe2017} shows how to use straight single quotes \textquotesingle{} properly.
\printbibliography
\end{document}

enter image description here

2
  • 1
    Thanks for the suggestion. I’ll use egreg’s answer, though. Writing a new command for for one single entry while leaving it untouched otherwise seems the wiser choice for me.
    – Kubo
    Commented Aug 14 at 14:18
  • 1
    @Kubo egreg is one of a Master for all LaTeX users, his suggestion is always perfect, please use his suggestion as always
    – MadyYuvi
    Commented Aug 14 at 14:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .