Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

statico (5018)

statico
  ian.langworthNO@SPAMgmail.com
http://langworth.com/
AOL IM: eisforian (Add Buddy, Send Message)

PAUSE-ID: IAN [cpan.org]

Co-author of Perl Testing: A Developer's Notebook [oreilly.com]

Journal of statico (5018)

Monday November 01, 2004
06:37 PM

formatting POD with LaTeX

[ #21638 ]

Since I don't know who I'll be sending $writing_project to or what format they'll expect it in, I chose to write it in POD. However, my independent study advisor needs to review it in hardcopy form, so I typeset the document with LaTeX.

Unfortunately, pod2latex's "-full" option adds a \usepackage[T1]directive which makes pdflatex's output icky. Also, I wanted a sleeker look to the pages. I took a look at the latest O'Reilly book I had hanging around and decided to mimic the style. The result is, IMHO, really nice.

I do all my writing in "thedoc.pod" and have a Makefile that converts it to LaTeX, inserts it into a full, pre-formatted LaTeX document, and does what it needs to with that.

Here's the TeX document that includes the output of pod2latex:

\documentclass{article}
 
\usepackage{newcent} % use New Century Schoolbook for normal font
\renewcommand{\ttdefault}{pcr} % use Courier for typewriter font
\usepackage[sf,bf,compact]{titlesec} % sans-serif, bold, compact headings
\parindent=0em % no indenting on first paragraphs
\parskip=0.6em % tighter spacing between paragraphs
 
\begin{document}
\include{thedoc}
\end{document}

Here's the Makefile (probably not written properly, but it works):

# vim:set noet:
PRINTER = xxxxxxx
BASENAME = thedoc
PRINTABLE = printable
 
help:
    @ echo "usage: make { pdf | print PRINTER=xxxxxx | clean }"
 
$(BASENAME).tex:
    pod2latex $(BASENAME).pod
 
print: $(BASENAME).tex
    latex $(PRINTABLE).tex
    dvips -t letter -P $(PRINTER) $(PRINTABLE).dvi
 
pdf: $(BASENAME).tex
    pdflatex $(PRINTABLE).tex
    open $(PRINTABLE).pdf
 
clean:
    rm -rf *.aux *.idx *.log *.toc \
        $(BASENAME).tex $(PRINTABLE).pdf

There are a few issues with really long lines of code, but these could probably be fixed with changing the font size of verbatim or using the fullpage package.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.