#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):

 For completeness, here's a way to get 'make latexpdf' to complete, even
 including the unicode.txt source file that contains problem unicode
 characters.

 The problem characters are in a code box in Chapter 6, section  "URI and
 IRI handling" > "An example to demonstrate:". There's two heart characters
 and a checkmark. Those characters are legit in RST, but not in Latex
 without special handling. (So in my view it's an error for Sphinx to emit
 them into Latex without including the appropriate handling for them.)
 Later in that chapter there are some Scandinavian characters, but these
 are in a range that's apparently OK in Latex.

 To avoid erroring out on the two characters in question, modify
 .../docs/conf.py as follows:

 {{{
 latex_elements = {
     'preamble': ('\\DeclareUnicodeCharacter{2264}{\\ensuremath{\\le}}'
                  '\\DeclareUnicodeCharacter{2265}{\\ensuremath{\\ge}}'
                  '\\DeclareUnicodeCharacter{2665}{[unicode-heart]}'
                  '\\DeclareUnicodeCharacter{2713}{[unicode-checkmark]}')
 }}}

 This adds handling for the heart and checkmark characters in the
 latex->pdf step, and simply places the provided strings in their place. It
 does not actually cause the proper glyphs to appear in the PDF. I played
 around a bit with that, but couldn't figure out what latex library needed
 to be included to make that happen. But at least this avoids a docs make
 error.

--
Ticket URL: <https://code.djangoproject.com/ticket/23751#comment:13>
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.a44d501c7ea0e9f5a14666766a14d04a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to