Trent W. Buck
2008-06-22 13:31:54 UTC
Has anyone got Unicode box art working in a reST to PDF toolchain?
Because ICBF adding diagram support to my document preparation
toolchain, I drew this network diagram as "ascii" art, which I include
in my reST source document as a literal block::
PPPoE link (to Internet)
│
│ Potential second PPPoE link (to Internet)
│ │
┌─┴──┴─────────┐
│Foo ├──┬──┬─── DMZ (123.4.45670/24)
└─┬──┬──┬──────┘ │ [customer DMZ servers]
│ │ │ ┌┴───────────────┐
│ │ │ │Foo │
│ │ │ └────────────────┘
│ │ │
│ │ └┬─── Test (NATted 192.168.235.0/24)
│ │ [engineer test servers]
│ │
│ └┬─── Wireless
│ [engineer laptops]
│
└┬──┬─── Office (NATted 192.168.155.0/24)
│ [engineer workstations]
┌┴──────────────┐
│Foo │
└───────────────┘
I used Unicode box drawing characters because they look better and are
less ambiguous (true ascii art only has + as a connector, whereas
Unicode has several "T" and corner connectors).
This renders nicely to HTML (using -o utf-8:strict), but neither
rst2latex nor rst2newlatex produce useful PDFs -- the former crashes
pdflatex, and the latter generates a PDF with "escaped" gibberish
(e.g. âŤĆ) in the literal block insted of the box art.
I tried adding \include{usc} after the inputenc line (of rst2latex's
output), but this only succeeded in generating a PDF with [U+2502]-style
escaped gibberish.
Before I spend any more time grovelling through the TeX generated by
docutils, I thought I'd ask: has anyone got Unicode box art working in a
reST to PDF toolchain? If so, how?
Because ICBF adding diagram support to my document preparation
toolchain, I drew this network diagram as "ascii" art, which I include
in my reST source document as a literal block::
PPPoE link (to Internet)
│
│ Potential second PPPoE link (to Internet)
│ │
┌─┴──┴─────────┐
│Foo ├──┬──┬─── DMZ (123.4.45670/24)
└─┬──┬──┬──────┘ │ [customer DMZ servers]
│ │ │ ┌┴───────────────┐
│ │ │ │Foo │
│ │ │ └────────────────┘
│ │ │
│ │ └┬─── Test (NATted 192.168.235.0/24)
│ │ [engineer test servers]
│ │
│ └┬─── Wireless
│ [engineer laptops]
│
└┬──┬─── Office (NATted 192.168.155.0/24)
│ [engineer workstations]
┌┴──────────────┐
│Foo │
└───────────────┘
I used Unicode box drawing characters because they look better and are
less ambiguous (true ascii art only has + as a connector, whereas
Unicode has several "T" and corner connectors).
This renders nicely to HTML (using -o utf-8:strict), but neither
rst2latex nor rst2newlatex produce useful PDFs -- the former crashes
pdflatex, and the latter generates a PDF with "escaped" gibberish
(e.g. âŤĆ) in the literal block insted of the box art.
I tried adding \include{usc} after the inputenc line (of rst2latex's
output), but this only succeeded in generating a PDF with [U+2502]-style
escaped gibberish.
Before I spend any more time grovelling through the TeX generated by
docutils, I thought I'd ask: has anyone got Unicode box art working in a
reST to PDF toolchain? If so, how?