From: <tre...@gm...> - 2008-06-22 13:32:16
|
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? |
From: G. M. <mi...@us...> - 2008-06-23 08:48:28
|
On 22.06.08, Trent W. Buck wrote: > 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? Yes. > If so, how? * generate LaTeX code with --output-encoding=utf-8:strict. * In the latex file, edit the preamble to load "ucs" with "postscript" option and also load the pstricks package:: \usepackage{shortvrb} - \usepackage{ucs} + \usepackage[postscript]{ucs} + \usepackage{pstricks} \usepackage[utf8x]{inputenc} * Convert to PDF with `latex`, `dvips`, and `ps2pdf`. The `rubber` building system for LaTeX documents is a help here, just run `rubber --ps --pdf <your-box-file>.tex` Günter |
From: <tre...@gm...> - 2008-06-23 12:41:04
|
"G. Milde" <mi...@us...> writes: > On 22.06.08, Trent W. Buck wrote: >> 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? > > * generate LaTeX code with --output-encoding=utf-8:strict. Yup, already doing that. > * In the latex file, edit the preamble to load "ucs" with "postscript" > option and also load the pstricks package:: > > \usepackage{shortvrb} > - \usepackage{ucs} > + \usepackage[postscript]{ucs} > + \usepackage{pstricks} > \usepackage[utf8x]{inputenc} Neither rst2latex nor rst2newlatex include a ucs line, here, using Debian's 0.4-6 package. Are you using a svn snapshot? > * Convert to PDF with `latex`, `dvips`, and `ps2pdf`. > The `rubber` building system for LaTeX documents is a help here, just run > `rubber --ps --pdf <your-box-file>.tex` Hmm, I'd been using rubber, but with --inplace --pdf rather than --ps --pdf. |
From: G. M. <mi...@us...> - 2008-06-23 13:21:09
|
On 23.06.08, Trent W. Buck wrote: > "G. Milde" <mi...@us...> writes: > > On 22.06.08, Trent W. Buck wrote: > >> 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? > > > > * generate LaTeX code with --output-encoding=utf-8:strict. > Yup, already doing that. > > * In the latex file, edit the preamble to load "ucs" with "postscript" > > option and also load the pstricks package:: > Neither rst2latex nor rst2newlatex include a ucs line, here, using > Debian's 0.4-6 package. Are you using a svn snapshot? Yes. But, as you need to edit the generated latex anyway, you might be OK with 0.4-6. Juas make sure to replace the line that loads package inputenc with > > \usepackage[utf8x]{inputenc} and also load ucs and pstricks \usepackage[postscript]{ucs} \usepackage{pstricks} . > > * Convert to PDF with `latex`, `dvips`, and `ps2pdf`. > > The `rubber` building system for LaTeX documents is a help here, just run > > `rubber --ps --pdf <your-box-file>.tex` > Hmm, I'd been using rubber, but with --inplace --pdf rather than --ps > --pdf. While --inplace or not will not influence the box-drawing characters, you need the --ps --pdf as pstricks (used to draw the boxes) is incompatible with pdflatex (see the rubber man or info pages for details). Günter |
From: <tre...@gm...> - 2008-06-25 03:04:40
|
"G. Milde" <mi...@us...> writes: > On 23.06.08, Trent W. Buck wrote: >> "G. Milde" <mi...@us...> writes: >> > On 22.06.08, Trent W. Buck wrote: >> >> 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? >> > * In the latex file, edit the preamble to load "ucs" with "postscript" >> > option and also load the pstricks package:: > >> Neither rst2latex nor rst2newlatex include a ucs line, here, using >> Debian's 0.4-6 package. Are you using a svn snapshot? > > Yes. But, as you need to edit the generated latex anyway, you might be OK > with 0.4-6. Juas make sure to replace the line that loads package inputenc > with Using rst2newlatex, works with trunk r5573 but not with Debian's 0.4-6. I've rolled out that trunk snapshot to a couple of my boxes, which will do for now. Thanks for your help. |