Hi Ewan,
I'm also building a tufte-latex book via MMD, however I've dropped
down to the level of MMD to HTML to LaTeX via XSLT so I can control
the latex output see
https://github.com/fletcher/MMD-Support
These are some of the changes I made...
* change citep to cite for citations.
* change figure template, I'm using the reference style of images and
if I add a margin attribute I create a \begin{marginfigure} otherwise
I use a standard \begin{figure}. When I get to it I'll also make it
use \begin{figure*} if the img has a fullwidth attribute.
* change img template to remove the default width / height.
* change cross references from autoref to pageref
* add anchor rule to build cross references for image refs correctly.
* I'm using BibTex citations.
* I'm using MMD to define a glossary and building the LaTeX glossary
I'm writing with Text Mate and then building the book as follows:
# merge the different files together
mmd_merge.pl content/index.md
# build the HTML
multimarkdown Book.md > Book.xhtml
# make the latex
xsltproc -nonet -novalid tufte-book.xslt Book.xhtml > Book.tex
# first pass with LaTeX not totally sure I need this but it works for
now.
pdflatex Book.tex
# Make the BibTeX files
bibtex Book
# Make the glossary
makeglossaries Book
# Two runs of latex to get the final output.
pdflatex Book.tex &&
pdflatex Book.tex &&
It's a little more involved that was probably necessary but I now have
a pretty good handle on how to control the latex output. There are a
few issues I've still to test out such as tables, but it's getting
there.
Cheers
Aaron
On Jan 21, 3:16 am, Ewan <
ewanc...@gmail.com> wrote:
> As requested, some details on how I'm using Tufte-LaTeX with MultiMarkdown
> (MMD). (Warning: I'm no expert, and I use a Mac. This will work differently
> on Windows).
>
> MMD is described on the website <
http://fletcherpenney.net/multimarkdown/>as:
>
> ...a tool to help turn minimally marked-up plain text into well formatted
> documents, including HTML, PDF (by way of LaTeX<
http://en.wikipedia.org/wiki/LaTeX>
> ), OPML <
http://en.wikipedia.org/wiki/OPML>, or OpenDocument (specifically,
> Flat OpenDocument <
http://en.wikipedia.org/wiki/OpenDocument> or ‘.fodt’,
> which can in turn be converted into RTF<
http://en.wikipedia.org/wiki/Rich_Text_Format>,
> Microsoft Word, or virtually any other word-processing format).
>
> More simply, you write in a very lightweight, readable syntax, which is
> then converted to LaTeX/RTF. It works very well with Scrivener<
http://www.literatureandlatte.com/scrivener.php>
> .
>
> LaTeX output works using *metadata*, which is placed at the top of each
> document. For example:
>
> \input{mmd-tufte-header}
> \def\latexmode{memoir}
> \input{mmd-tufte-book-begin-doc}
> \chapter{Chapter Title}
>
> The \input commands refer to files in your "~/Library/texmf/" folder. For
> Tufte-LaTeX, I use the following files:
>
> - ~/Library/texmf/tex/latex/mmd/mmd-tufte-header.tex<
http://pastie.org/pastes/3219065/text>
> - ~/Library/texmf/tex/latex/mmd/mmd-tufte-book-begin-doc.tex<
http://pastie.org/pastes/3219074/text>
>
> At the end of the document, I add (or rather, Scrivener adds for me)
> "\input{mmd-tufte-footer}" which points to:
>
> - ~/Library/texmf/tex/latex/mmd/mmd-tufte-footer.tex<
http://pastie.org/pastes/3219086/text>
>
> These files are a work in progress – I've pieced them together from the
> Tufte-LaTeX example files. I'll probably need to add
> packages/customisations as I near completion.
>
> Some points on using MMD with Tufte-LaTeX:
>
> - I write everything in Scrivener, so rarely see any LaTeX code.
> - Citations are written in the MMD syntax<
http://pastie.org/pastes/3219101/text>,
> which gets converted to LaTeX (natbib) later.
> - Equations are written in MMD.
> - Standard images (i.e. \begin{figure}) are written in MMD, as is all
> formatting (bold/italics/quotes).
> - Footnotes are written in MMD, which get converted to LaTeX footnotes,
> which (in Tufte-LaTeX) become sidenotes. This is fine, so long as you don't
> need to adjust the position of a side note.
>
> For anything complicated (i.e. where I need to edit the LaTeX code), I just
> insert LaTeX code directly into Scrivener. By surrounding text with the
> HTML comment tags "<!--" and "-->" it is ignored by the MMD parser, and so
> gets passed straight through to the LaTeX document.
>
> I used this quite a lot, particularly with Tufte-LaTeX:
>
> - Almost all images (i.e. marginfigure, or figure*)
> - A lot of tables (MMD does have a table syntax, but it's limited)
> - Any time I need to adjust the placement of something (e.g. a