12

The question "A Measure Theoretic Formulation of Bayes' Theorem" has an excellent answer which I would like to cite via BibTeX.

This gives the following:

@MISC {444082,
    TITLE = {A Measure Theoretic Formulation of Bayes' Theorem},
    AUTHOR = {Artem Mavrin (https://stats.stackexchange.com/users/97872/artem-mavrin)},
    HOWPUBLISHED = {Cross Validated},
    NOTE = {URL:https://stats.stackexchange.com/q/444082 (version: 2020-01-13)},
    EPRINT = {https://stats.stackexchange.com/q/444082},
    URL = {https://stats.stackexchange.com/q/444082}
}

Unfortunately the apostrophe in the title gets exported as HTML entity ', of which the & and # are interpreted (i.e. by LaTeX) as special characters and will break the processing.

Is there any way to export the apostrophe (and probably some other characters) as their Unicode equivalent instead of the HTML entities?

This bug might be slightly related to Android Share - special characters in title became HTML entities.

3

The quote character is represented with the HTML entity in the title itself, I am guessing that this is just copied verbatim to the BibTeX export.

One solution would be to post-process the export to change the entities back into Unicode, another (easier) solution would be not to encode the characters in the titles at all. Entities are not encoded in the body of the question, see this fragment from the source:

<h1 class="fs-title mb16">A Measure Theoretic Formulation of Bayes&#39; Theorem</h1>

<div class="s-prose js-post-body mb16">
<p>I am trying to find a measure theoretic formulation of Bayes' theorem

So it would be interesting to know why entities are (still) encoded in titles - presumably to avoid parsing/rendering/database/url problems somewhere in the pipeline where titles are used, but if strings are properly handled this should not be an issue imo. Given the problems that entities cause on SE (https://meta.stackexchange.com/search?q=html+entities returns 180 posts, mostly bugs) using Unicode directly may prove to be a good alternative.

Note that postprocessing/conversion in BibTeX output would still be needed for actual special characters, for example the & in Lower & upper bounds on $\|Av\|$? should be exported as \& (and not &amp; as in the current situation, but also not raw Unicode & as suggested in this answer).


Interestingly, for the 'Share on Twitter' link a hex representation is used:

<meta name="twitter:title" [...] content="[...] Formulation of Bayes&#x27; Theorem" />

but of course that is not very relevant for the current question about the BibTeX export.

You must log in to answer this question.

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