MultiMarkdown and LaTeX - nolboo/wiki-syntax GitHub Wiki

MultiMarkdown and LaTeX

LaTeX is a professional quality typesetting system that can be used to take plain text markup and produce a high quality pdf, complete with table of contents, index, glossary, etc. It's a fairly complicated program, but capable of doing most of the work for you. One of my goals with MultiMarkdown was to make it even easier to create a LaTeX document, with minimal knowledge of the LaTeX syntax. In fact, you can create fairly complex documents without any understanding of how LaTeX works, as long as you have it installed correctly.

That said, MultiMarkdown is not simply a preprocessor for LaTeX files, so there will always be LaTeX commands that are just not available from within MultiMarkdown. If you're a LaTeX expert, you might find that after MultiMarkdown runs, you want to go and hand tweak a few parts to get things just right. But for the average user and average document, I suspect the default output will be just fine.

The settings to pay particular attention to:

  • You must choose an XSLT file to convert the MultiMarkdown-generated XHTML into LaTeX; you do this by setting the LaTeX XSLT metadata. If you do not choose one, the default is memoir.xslt. Most of my XSLT files are based around the memoir package --- it's the one I'm familiar with, it's very flexible, and has high quality output, and lots of features. That said, you are welcome to create your own XSLT files to use whatever packages you prefer. The beauty of the XSLT transformation process is that it can be completely reconfigured however you like.

  • Depending on what sort of document you are creating, you may need to set the Base Header Level metadata. For example, if you are creating a memoir based document, and wish for your top-level section to be a chapter, rather than a "part", you could set Base Header Level to 2. It's easier to do than explain, but basically it moves all levels of your structure by the specified number of steps.

  • You likely will want to set as much of the basic metadata as possible (e.g. Title, Author, Date, Keywords, etc) as most of this is converted to a format that is used in the resulting PDF.

Also, MultiMarkdown has support for BibTeX, glossaries, html links, internal links between sections of the document, math formatting, etc. Most of the "major" features of LaTeX are available using the standard MultiMarkdown syntaxes. If there is something you don't see, just ask --- it may exist, or I might be able to add it if appropriate.

The general process of creating a PDF via LaTeX is the same as the normal use of MultiMarkdown, with one additional step:

  1. Create your text source file

  2. Using your method of choice, convert the text file to XHTML, and then convert the XHTML to LaTeX (most of my tools will do this as a single step as far as the user is concerned).

  3. Convert the LaTeX source file to PDF using the tool of your choice (my Drag and Drop application, TeXShop, latexmk, manually, etc.)

Due to the complexity of the LaTeX source, it can be hard to troubleshoot when using an automatic tool. If something doesn't work, I recommend first trying to get your MultiMarkdown text file converted to XHTML and verify that it is correct. Then convert the XHTML to LaTeX and be sure that you can watch the status messages that occur during processing of the LaTeX file - they will usually give you a hint as to where the problem lies. Remember, just because the XHTML version of a MultiMarkdown document is valid XHTML does not mean the resulting LaTeX will be totally valid.

⚠️ **GitHub.com Fallback** ⚠️