#23751: Code snippets display without formatting in PDF version of the docs
--------------------------------+------------------------------------
Reporter: adam-glodowski | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------
Comment (by gwideman):
Revised fix, now builds without errors, and includes TOC.
Issues addressed:
1. In order for the overall 'make latexpdf' to succeed (with TOC), the
build must proceed without errors. There is a separate nested
docs/_build/latex/Makefile for the latex->pdf phase, which invokes
pdflatex three times, in order to iterate toward stable pagination to
arrive at page numbers for TOC, index and cross-references. If any of
these steps fails, the resulting PDF is incomplete.
So it's essential for all errors to be fixed.
2. The latex code for the grey box containing the filename must not
include unescaped underscores, as that's some kind of a latex error in
this context, preventing make from completing. So in the djangodocs.py
code that constructs that grey box (the 'colorbox'), I added backslash
escape to the the underscores.
3. Make was failing when the latex->pdf process encountered unexpected
unicode characters, originally from one of the source files,
(/docs/ref/unicode.txt. For example on line 230). For testing purposes, I
simply renamed that file so it didn't get included.
The correct fix involves figuring out why the bogus characters are in
there in the first place. Are they editing mistakes? Did they get there
due to unwanted translation from some previous source form? Or are they
intentional, in which case they could be added to the list of
DeclareUnicodeCharacter entries in the preample section of the
/docs/conf.py Sphinx config file.
With these issues taken care of, the build proceeds without errors and the
file I will attach produces a good PDF output: djangodocs-latex-pdf-fix-
gw-2015-11-14C.py
--
Ticket URL: <https://code.djangoproject.com/ticket/23751#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/072.dad5f680447060c046a76784cf9fc919%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.