-
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
Add support for citations in PDFs/LaTeX #46
Conversation
703d8b7
to
db28b15
Compare
The documentation preview is at https://juliadocs.org/DocumenterCitations.jl/previews/PR46/ More importantly, the PDF version (generated with |
@Seelengrab Can you review this? If I was your thesis advisor, I'd be totally fine with you handing in something in the format of the generated PDF 😉 Just let me know if this works for you, or if anything should be tweaked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor things - I'll see how this works on my thesis in a few hours :)
Something seems to be going wrong when linking down to the reference: The relevant bibtex that got parsed:
And the TEX that got produced for this section:
The author name actually does contain |
@Seelengrab Which platform are you running on? Is this a Windows problem? That |
I'm on linux - my setup is a bit weird though, since I need a preamble from my university and that messes with things a bit 😂 That may be the cause of the wonky |
That will require a patch to Documenter, but is probably a good idea |
That seems the likely cause for the Until we find a way to replace |
Sounds good! I'm excited for this, since the reference really does look MUCH nicer now than my previous cobbled together attempt :D Thank you very much! |
cbb3d9d
to
b0a8092
Compare
Co-authored-by: Sukera <11753998+Seelengrab@users.noreply.github.com>
b0a8092
to
ef4bfa9
Compare
I opened JuliaDocs/Documenter.jl#2300 about the problem with the non-breaking space. My best guess is that this is a font problem on your system. It's not that surprising that the LaTeX font you may be using doesn't handle I'm going to see how quickly @mortenpi gets around to looking at JuliaDocs/Documenter.jl#2300, and maybe keep this PR open until a new version of Documenter is released with that patch. That's because I have to adjust my tests that check the output of the |
Yeah, dealing with unicode & fonts in LaTeX is a bit of a PitA, unfortunately.. It's doubly bad when it shows up like this :/ I'll see if I can fiddle around a bit with the fonts and work out what (if anything) is going wrong on my end. |
I think he was saying on Slack that he was going to be traveling for a few weeks, so maybe I'll just merge later today (unless @Seelengrab has more input) and move on to fixing #22 next. I can always adjust the test on |
format=Documenter.LaTeX()
). Citations and references are rendered exactly as in the HTML version. Specifically, the support does not depend onbibtex
/biblatex
and supports any style (including custom styles).DocumenterCitations.set_latex_options
andDocumenterCitations.reset_latex_options
to tweak the rendering of bibliographies in PDFs.Internal changes:
@bibliography
block is now internally expanded into an internalBibliographyNode
instead of a raw HTML node. ThisBibliographyNode
can then be translated into the desired output format byDocumenter.HTMLWriter
orDocumenter.LaTeXWriter
. This is how support for bibliographies withformat=Documenter.LaTeX()
can be achieved.format_bibliography_reference
must now return a markdown string instead of an HTML string.There is now a script
docs/makepdf.jl
that can be executed withmake pdf
to produce a PDF of the documentation forDocumenterCitations
. This serves as a self-test and showcase. In future releases, we'll attach the PDF as an asset to the release. I didn't add a Github Workflow to produce the PDF, as setting up LaTeX and compiling the PDF would slow down the CI significantly. There are some tests, but they stop after generating the.tex
file, which is much more efficient. For releases, I can produce the PDF locally on my laptop.Closes #18