Open cebamps opened 7 years ago
There are two possible solutions here: add a space (as you say) or force a string colon (still an issue with LuaTeX, I guess).
I've thought about this, and really it's a problem beyond biblatex-phys
: the active colon needs to be disabled within the bibliography. Fixing it 'here' would at best be a hack: in particular, LuaLaTeX is a real issue.
@moewew Any thoughts here? I'm not sure what to say here beyond 'French babel
set up is a PITA'.
Actually it's not only babel-french
biblatex
's french.lbx
is actively PITA-ing too
I don't think the actively/spacey colon should be disabled elsewhere in the bibliography. I assume that for all other uses people would expect the normal French behaviour.
Something like
\documentclass{article}
\usepackage{csquotes}
\usepackage[french]{babel}
\usepackage[style=phys,articletitle=false,eprint=true]{biblatex}
\makeatletter
\DeclareFieldFormat{eprint:arxiv}{%
\let\FDP@colonspace\empty
\csuse{NoAutoSpacing}%
\ifhyperref
{\href{https://arxiv.org/\abx@arxivpath/#1}{%
arXiv\addcolon
\nolinkurl{#1}%
\iffieldundef{eprintclass}
{}
{\addspace\UrlFont{\mkbibbrackets{\thefield{eprintclass}}}}}}
{arXiv\addcolon
\nolinkurl{#1}%
\iffieldundef{eprintclass}
{}
{\addspace\UrlFont{\mkbibbrackets{\thefield{eprintclass}}}}}}
\makeatother
\addbibresource{biblatex-examples.bib}
\begin{document}
\nocite{baez/article}
\printbibliography
\end{document}
should hopefully work (unless someone other than babel-french
defines \NoAutoSpacing
).
I guess we could define a \addunspacedcolon
(or something like that) in biblatex
that automatically does this and could be used by package authors who definitely know that they don't want the French colon behaviour.
@moewew Sounds good: something at the core level would 'feel' right
Tracked at https://github.com/plk/biblatex/issues/925. I'll be busy for the next two weeks, so I will probably forget about this short-term. Comments for the name and implementation issues are highly appreciated.
I removed an earlier post which showed \addcolonnonfrench
, since I'm not sure about how to proceed.
@josephwright Given the issues mentioned in https://github.com/plk/biblatex/issues/925 (namely that not only French messes with punctuation spacing but other languages might do so as well and that there is no unified interface to turn off the spacing changes) do you still think that this is something that we should try to implement in biblatex
? At the moment I tend towards scrapping the idea of implementing an \addcolon
that tries to work against the various language modules that might try to influence colon spacing.
@moewew Agreed: this needs action 'elsewhere'
Thanks for the comment. I backed out of \addcolonnonfrench
for now.
I realise that this leaves the issue here with no great solution, but an overall approach that works for all languages seems tricky.
In biblatex,
\addcolon
typesets the colon according to the selected babel language. The issue is that the french colon has some spacing prepended to it, which makes eprint formatting look wrong compared to the spaceless version:I believe the lack of
\addspace
after\addcolon
is meant to mimic the usual formatting of arXiv references (as in REVTeX, i.e., arXiv:1234.5678 with no spaces around the colon)? In any case, the spacing ends up making it look likearxiv :1234.5678
. In comparison, the default biblatex styles typeset it in a more conventional way using\addcolon\addspace
, which looks likearxiv : 1234.5678
in french andarxiv: 1234.5678
in english.MWE: