-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Correct handing of ampersands in bibliography entries #2050
Comments
Slightly relates to #1860 (as minimal TeX-like stuff people might expect in a bibTeX file, the |
Along the same line of thinking, |
This is definitely not something we should expect to be in the input, we need to apply XML character escaping ourselves. I'm not familiar with other issues with inputs, but if TeX-isms like |
Food for thought:
The crux of the matter is that the bibtex format was design with TeX in mind, hence it cannot be made completely portable. (The original need to escape I think that the safest approach (to start with) is to consider by default that the input does not contain any markup. (We are not going to be able to support TeX/LaTeX, or IMHO, the best course of action is to assume the bib file is self-defined, written in a minimal "portable" subset, i.e. not containing any TeX, XML, SIL or whatever constructs, exception made of the really common ones ( FWIW, as of other most "common" input issues (I might comment on them separately at some point) are likely:
|
BTW, For the record, Typst does support some minimal interpretation of TeX-like input. The problem I see there is that we'll never know what's really minimal... |
Accept `\&` for compatibility with legacy BibTeX, but do not mandate it to be escaped for compatibility with other engines. Support unescaped `~` as a non-breaking space for compability with TeX, this is often found in existing bibliography files. Support `\~` to render a tilde. XML-escape the input so it can safely be wrapped in a `<sile>` construct. Closes sile-typesetter#2050 Closes sile-typesetter#1860 (replaced by this implementation)
Accept `\&` for compatibility with legacy BibTeX, but do not mandate it to be escaped for compatibility with other engines. Support unescaped `~` as a non-breaking space for compability with TeX, this is often found in existing bibliography files. Support `\~` to render a tilde. XML-escape the input so it can safely be wrapped in a `<sile>` construct. Closes sile-typesetter#2050 Closes sile-typesetter#1860 (replaced by this implementation)
Accept `\&` for compatibility with legacy BibTeX, but do not mandate it to be escaped for compatibility with other engines. Support unescaped `~` as a non-breaking space for compability with TeX, this is often found in existing bibliography files. Support `\~` to render a tilde. XML-escape the input so it can safely be wrapped in a `<sile>` construct. Closes sile-typesetter#2050 Closes sile-typesetter#1860 (replaced by this implementation)
Accept `\&` for compatibility with legacy BibTeX, but do not mandate it to be escaped for compatibility with other engines. Support unescaped `~` as a non-breaking space for compability with TeX, this is often found in existing bibliography files. Support `\~` to render a tilde. XML-escape the input so it can safely be wrapped in a `<sile>` construct. Closes sile-typesetter#2050 Closes sile-typesetter#1860 (replaced by this implementation)
For strings such as On some stuff & other things, we currently have to format our bibtex files as follows for use with SILE:
If we don't XML-escape the
&
, we get an error...This is dues to SILE supporting XML entries in bibliography, which is non-standard... albeit interesting, e.g. if one wants to markup parts of entries in SIL XML. (The true use case however is not the user inserting markup, it's for the internal logic of rendering titles in italic, etc.)
It's not completely obvious, as:
{On some stuff \& other things}
(and the big picture here is that it allows any (La)TeX constructs in field values, but also suffers from its own rules, hence the ampersand escaping I guess...){On some stuff & other things}
Having to manually edit bibliographies to replace
&
by&
is cumbersome, we'd need to avoid it, or at least have some way to bypass it. (I'd also be interested in supporting Djot/Markdown in bibTeX files, but that's another hornet's nest :p )The text was updated successfully, but these errors were encountered: