-
Notifications
You must be signed in to change notification settings - Fork 6
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
Improve parsing of tex strings #52
Conversation
Implements a proper (albeit limited) parser for the subset of tex syntax that occurs in BibTeX fields, converting to the equivalent Markdown. Most importantly, this handles accents like \"o, and groupings, i.e., it removes curly braces in the same way that LaTeX does. Inline math is recognized and translated into Documenter's preferred "``" syntax, but otherwise left alone. A limited set of LaTeX commands is recognized, most notably \href and \url, allowing to put hyperlinks in the `@note` field of a reference. We're deliberately conservative here. Anyone who can demonstrate the need for additional commands should submit an issue with a real-life example. It should be quite trivial to add any specific additional command. All of this is considered "very internal". We're not making any promises. Ideally, a lot of this code would probably be better in Bibliography.jl, but at this point, we're treating Bibliography as a just a basic parser to get the raw tex, and doing all the processing / conversion to Markdown ourselves.
2622910
to
e9b0f66
Compare
c04e795
to
8f83b48
Compare
The DocumenterCitations.jl/docs/src/refs.bib Lines 278 to 285 in 8f83b48
|
@kellertuer @Seelengrab @lgoettgens Can you have a look? Are there any specific LaTeX commands that you would like me to add support for? This should be the last PR that goes into the 1.3 release. It should also make |
I am fine with the current state of rendering I think. |
I was wondering whether supporting Other than that, I'm very happy already with the current state, so nothing for me to add either :) |
Can you open a separate issue for that, preferably with an example BibTeX entry, and how it should render? |
@Seelengrab Opened #53, we can discuss |
Implements a proper (albeit limited) single-pass parser for the subset of tex syntax that occurs in BibTeX fields, converting to the equivalent Markdown. Most importantly, this handles accents like
\"o
, and groupings, i.e., it removes curly braces in the same way that LaTeX does.Inline math is recognized and translated into Documenter's preferred "``" syntax, but otherwise is left alone.
A limited set of LaTeX commands is recognized, most notably
\href
and\url
, allowing to put hyperlinks in the@note
field of a reference. We're deliberately conservative here. Anyone who can demonstrate the need for additional commands should submit an issue with a real-life example. It should be quite trivial to add any specific additional command.All of this is considered "very internal". We're not making any promises. Ideally, a lot of this code would probably be better off in Bibliography.jl, but at this point, we're treating Bibliography as just a basic parser to get the raw tex, and doing all the processing / conversion to Markdown ourselves.
Closes #15.
Should also address #44,
except that the lack of a new.BibInternal
release still requires the workaround of using non-breaking spaces