While I'm fine with writing "real" documents in full-blown LaTeX, I often switch to reStructuredText as a lightweight markup language for simplish documents (like meeting notes and stuff). I was quite happy with my workflow (file.txt -> rst2latex-2.6.py -> pdflatex -> file.pdf) until I recently decided that I wanted to use the memoir class, just as I do for my real documents.
The documentation for reStructuredText states that this class is supported via the --documentclass=memoir option. However, my document now fails to compile because of some command fragility issue I don't really understand :
Titles and section titles are converted to something in the lines of :
\title{\phantomsection%
This it the title%
\label{this-it-the-title}}
which article seems fine with, but which memoir chokes on (about 15 errors in the log file).
Is this an obvious but undocumented bug, or did I do something obviously wrong in the first place ?
Minimal (not)working example :
#!/bin/sh
rm -f test.*
cat >> test.txt <<EOF
This it the title
=================
this is dummy text
EOF
rst2latex-2.6.py -V
rst2latex-2.6.py --verbose --documentclass=memoir test.txt test.tex
pdflatex -interaction=nonstopmode test.tex
As for the output, I get out of it :
rst2latex-2.6.py (Docutils 0.9 [release], Python 2.6.8, on darwin)
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011/MacPorts 2011_5)
...
(...then the usual latex yada yada, including about 15 "errors"...)
...
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on test.log.
In case it is useful, here is the complete (and incorrect) LateX document produced by docutils :
\documentclass[a4paper]{memoir}
% generated by Docutils <http://docutils.sourceforge.net/>
\usepackage{fixltx2e} % LaTeX patches, \textsubscript
\usepackage{cmap} % fix search and cut-and-paste in Acrobat
\usepackage{ifthen}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
%%% Custom LaTeX preamble
% PDF Standard Fonts
\usepackage{mathptmx} % Times
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
%%% User specified packages and stylesheets
%%% Fallback definitions for Docutils-specific commands
% hyperlinks:
\ifthenelse{\isundefined{\hypersetup}}{
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
\urlstyle{same} % normal text font (alternatives: tt, rm, sf)
}{}
\hypersetup{
pdftitle={This it the title},
}
%%% Title Data
\title{\phantomsection%
This it the title%
\label{this-it-the-title}}
\author{}
\date{}
%%% Body
\begin{document}
\maketitle
this is dummy text
\end{document}
.texfile? – egreg Jun 7 '12 at 14:17reStructuredtext file. – Sveinung Jun 8 '12 at 7:41