Updated document.txt

MmmmJoel authored
revision 1a83a85418315e758e91f1e4ae9fb4413414ef58
Your project is alive!

This is your document. Click the small white 'Edit' button above to make changes to this file and start writing. Until then, here's a quick primer on how Penflip works:

## Projects

Right now, you're looking at the project page for your new project. The project page is the headquarters for you and your collaborators - you can write and edit, invite collaborators, have discussions, browse changes, see project activity, export your project, and more.

## Writing

You'll see 'Edit' buttons across the project. Clicking any of these buttons will take you into a distraction-free 'writing mode', similar to Google Docs and other writing tools. Everything is written with [Markdown](http://daringfireball.net/projects/markdown/). For an explanation on why markdown is awesome for writing, [read this](http://nerdplusart.com/markdown-is-the-future/).

## Versions

Every project has a master version. Whenever you invite somebody to your project, a new version will automatically be created for them, and all of their changes will be made on their own version. When a collaborator is ready to submit their changes into the master version, they'll create a Merge Request.

## Merge Requests

A Merge Request is a group of changes to your project. All merge requests go into the master version. As the project owner, you control the merge requests: you can accept them, ignore them, and comment on them to suggest changes. When you accept a Merge Request, the master version of your project will be updated with those changes.
# Introduction to MultiMarkdown #

This document is an introduction to [MultiMarkdown][] --- what it is, how to
use it, how you can help make it better. This document exists in multiple
formats: a plain text document, a pdf, a [Scrivener][] document,
etc. Find the format that best suits your needs, or create your own. That is
what MultiMarkdown was designed to be used for!

[MultiMarkdown]: http://fletcherpenney.net/MultiMarkdown
[Scrivener]: http://www.literatureandlatte.com/scrivener.html

## What is Markdown? #

To understand what MultiMarkdown is, you first should be familiar with
[Markdown](http://daringfireball.net/projects/markdown/ "Daring Fireball:
Markdown"). The best description of what Markdown is comes from John Gruber's
Markdown web site:

> Markdown is a text-to-HTML conversion tool for web writers. Markdown
> allows you to write using an easy-to-read, easy-to-write plain text
> format, then convert it to structurally valid XHTML (or HTML).

> Thus, “Markdown” is two things: (1) a plain text formatting
> syntax; and (2) a software tool, written in Perl, that converts
> the plain text formatting to HTML. See the Syntax page for details
> pertaining to Markdown’s formatting syntax. You can try it out,
> right now, using the online Dingus.

> The overriding design goal for Markdown’s formatting syntax is to
> make it as readable as possible. The idea is that a Markdown-formatted
> document should be publishable as-is, as plain text, without looking
> like it’s been marked up with tags or formatting instructions. While
> Markdown’s syntax has been influenced by several existing
> text-to-HTML filters, the single biggest source of inspiration for
> Markdown’s syntax is the format of plain text email. [#Gruber][]

[#Gruber]: Daring Fireball: Markdown.

## What is MultiMarkdown? #

Markdown is great, but it lacked a few features that would allow it to work
with documents, rather than just pieces of a web page.

I wrote MultiMarkdown in order to leverage Markdown's syntax, but to extend it
to work with complete documents that could ultimately be converted from text
into other formats, including complete XHTML documents, LaTeX, PDF, RTF, or
even (shudder) Microsoft Word documents.

In addition to the ability to work with complete documents and conversion to
other formats, the Markdown syntax was lacking a few things. Michel Fortin
added a few additional syntax tools when writing [PHP Markdown Extra][]. Some
of his ideas were implemented and expanded on in MultiMarkdown.

John Gruber may disagree with me, but I really did try to stick with his
proclaimed vision whenever I added a new syntax format to MultiMarkdown. The
quality that attracted me to Markdown the most was its clean format. Reading a
plain text document written in Markdown is *easy*. It makes sense, and it
looks like it was designed for people, not computers. To the extent possible,
I tried to keep this same concept in mind when working on MultiMarkdown.

I may or may not have succeeded in this...

In the vein of Markdown's multiple definitions, you can think of MultiMarkdown

1. A perl script to convert plain text to XHTML

2. The syntax used in the plain text to describe how to convert it to XHTML

3. The system of programs (perl scripts, shell commands, XSLT transforms, php scripts, etc) used to convert plain text to XHTML, and then to convert XHTML into LaTeX, PDF, RTF, etc)

[PHP Markdown Extra]: http://www.michelf.com/projects/php-markdown/extra/

## How do I use MultiMarkdown? #

You can use MultiMarkdown in a variety of ways:

* As a command-line perl program (the "default" approach)

* As a drag and drop application for Mac OS X

* As a [TextMate][]

* Within the [Scrivener][] application

* In a [blosxom][] or [Oddmuse][] web site

[TextMate]: http://macromates.com/
[Scrivener]: http://www.literatureandlatte.com/scrivener.html
[blosxom]: http://blosxom.sourceforge.net "blosxom"
[Oddmuse]: http://www.oddmuse.org/ "Oddmuse Homepage"

## Where can I find MultiMarkdown? #

The MultiMarkdown package can be downloaded:


Information about MultiMarkdown is available on my web site:


John Gruber's original Markdown is available at his site:


Michel Fortin's PHP version of Markdown is at his site:


## Where can I get more information about MultiMarkdown? #

As above, check my web site.

Also, you can check out the MultiMarkdown discussion list:


If you questions are specific to Scrivener, you can also browse the Literate and Latte forum:


# Quickstart Guide to MultiMarkdown #

Quick start instructions, for those in a hurry...

## General Instructions ##

1. Download the MultiMarkdown package:

2. Unzip/untar it

3. MultiMarkdown can be run from anywhere, but is easiest when installed in a "common" location:

* Windows:

* C:\Documents and Settings\All Users\MultiMarkdown
* C:\Documents and Settings\\MultiMarkdown

* Mac OS X or *nix

* ~/Library/Application Support/MultiMarkdown (preferred on Mac OS X)
* ~/.multimarkdown
* /Library/Application Support/MultiMarkdown (preferred on Mac OS X)
* /usr/share/multimarkdown

4. In the "bin" directory, there are a couple of perl scripts designed to take a MultiMarkdown text file and convert to XHTML, or LaTeX, or pdf. These scripts are designed to be able to be run from anywhere. You can leave them where they are, or install them somewhere in your path directory:

* mmd2XHTML.pl

* mmd2LaTeX.pl

* mmd2PDF.pl

* mmd2PDFXeLaTeX.pl

* mmd2letter.pl

5. To use these files, do something like the following:

cd MultiMarkdown
bin/mmd2XHTML.pl file.txt

where "file.txt" is the MultiMarkdown file you wish to process. "file.html" will be created automatically

6. You can now open `file.html` in your web browser, or do what you like with it.

[TextMate]: http://macromates.com/
[Scrivener]: http://www.literatureandlatte.com/scrivener.html

# MultiMarkdown Syntax Guide #

This is a guide to the markup syntax used in the MultiMarkdown system.

## Metadata ##

MultiMarkdown has support for metadata, meaning that you can include
information about a document that is not necessarily part of the document

To use metadata, simply add information to the top of a Markdown file:

Title: A New MultiMarkdown Document
Author: Fletcher T. Penney
John Doe
Date: July 25, 2005

The key is the text before the colon, and the data is the text after the
colon. In the above example, notice that there are two lines of information
for the Author key. If you end a line with "space-space-newline", the newline
will be included when converted to other formats.

There must not be any whitespace above the metadata, and the metadata block
ends with the first whitespace only line. The metadata is stripped from the
document before it is passed on to the syntax parser.

While not required, I recommend including two spaces at the end of each line
of metadata. In this way, if you pass your document through a regular version
of Markdown, the metadata will be properly formatted as plain text with line
breaks, rather than joined into a single run-on paragraph.

I have included information about some of the "standard" metadata keys --- I
welcome feedback and suggestions for additional standard keys that would be
useful. If you add keys that are not listed, they are included in the XHTML
and LaTeX as custom variables that can still be used if you desire.

Remember, XHTML snippets have no means to use metadata. To make use of these
features, one must be using `Format: complete` to create full XHTML documents,
which can then be processed using XSLT to create other document types. As an
example, I use metadata for information that is used to add title, author,
keyword, and copyright metadata to PDF's created by MultiMarkdown.

**Note**: I make multiple mentions to the use of these keys for LaTeX
documents. This is simply because the LaTeX output format currently makes the
most use of the metadata information. Any export format could be modified to
make use of additional metadata keys.

### Address ###

Use this to include the author's mailing address. You can have more than one
line in this field --- use two extra spaces at the end of a line, and a
newline character will be used in LaTeX. Also used as return address for
letterhead and envelope templates.

### Author ###

Self-explanatory. I strip this out to provide an author string to LaTeX
documents. Also used as the sender for letterhead and envelope templates.

### Affiliation ###

Use this to include an organization that the author is affiliated with, e.g. a
university, company, or organization. You can include address information here
as well, or use the `Address`, `email`, `web`, and `phone` metadata fields.
You can have more than one line in this field --- use two extra spaces at the
end of the line, and a newline character will be used in LaTeX.

### Base Header Level ###

Used by my XSLT script tool to change the default header level. For example,
if using the memoir class, you might want a first level header to be
interpreted as a chapter, rather than as a part. To do this, simply set `Base
Header Level` to `2`.

### Base URL (Deprecated)###

Deprecated - WikiWords and WikiLinks no longer supported.

### Bibliography Title ###

Change the title used for the references section (e.g. "References" or
"Bibliography"). The default value is "Bibliography".

### Bibliography Style ###

The name of the BibTeX style you wish to use.

### BibTeX ###

This should be the name of a `.bib` file (a BibTeX file used to store
references). If you use my xhtml2latex.xslt file, this will convert external
citations into markup for BibTeX (see [Bibliography Support][] for more

You must have `bibtex` installed and working, and the `.bib` file must be in
your working directory.

### Chapterstyle ###

This is used to designate the `chapterstyle` in LaTeX memoir documents.

### Copyright ###

This can be used to provide a copyright string.

### CSS ###

Used to specify a CSS stylesheet when creating the complete XHTML output.

### Date ###

Provide a date for the document.

### Email ###

Use this to include the author's email address.

### Format ###

Set to `complete` to indicate that a fully-formed XHTML document should be
produced. Such a document is ready for processing by an XSLT tool, such as the
XSLT files to convert XHTML into LaTeX.

Set to `snippet` to indicate that no `` or other information should be
included. This might be useful for generating (X)HTML output ready for pasting
into a weblog, for example.

**Note**: Some MultiMarkdown tools add this for you (e.g. TextMate using my
bundle, and Scrivener.) Duplicating the `Format` key in these programs should
not cause a problem --- let me know if you have trouble.

### Keywords ###

Provide a list of keywords for the document. I use these to add keywords to
PDF's that are produced as well. Keywords can be separated by commas, or
placed on separate lines.

### Language ###

Currently, the language field is used to specify which version of
[SmartyPants] to use. In the future, it may be used for other purposes as

The languages are written using the English word (e.g. "german" not

[SmartyPants]: http://daringfireball.net/projects/smartypants/ "SmartyPants Homepage"

### LaTeX XSLT ###

Used to designate an XSLT file to convert an XHTML document to a LaTeX
document. The LaTeX document can then be converted to PDF by `pdflatex`. This
key used to be called `XSLT File`.

### Pagestyle ###

This is used to designate the `pagestyle` in LaTeX memoir documents.

### Phone ###

Use this to include the author's phone number(s). You can have more than one
line in this field --- use two extra spaces at the end of the line, and a
newline character will be used in LaTeX.

### Recipient ###

Used by letterhead and envelope templates.

### Recipient Address ###

Used by letterhead and envelope templates.

### Revision ###

You can use a string to declare the current version of the document. Displayed
on the copyright page when using my memoir XSLT transform.

### RTF XSLT ###

This key is used to provide an XSLT file that can alter the XHTML output prior
to conversion to RTF. Useful for further customizing the output of
MultiMarkdown specifically for the RTF format. I have no plans to create any
such files myself, but others may find it useful.

*I strongly encourage you to use another route to convert XHTML to RTF.
I've had the best results with [Google Docs](htts://docs.google.com/). For
non-Mac users, that's definitely the way to go.*

### Subtitle ###

Used to provide a subtitle. It ends up in the meta tags, but can be extracted
by XSLT for other uses.

### Title ###

Used to provide the official title of a document. This is set as the ``<br>string within the `<head>` section of an HTML document, and is also used by<br>other export formats.<br><br><br>### Use WikiLinks (Deprecated)###<br><br>Set to `true` or `1` to enable the use of `WikiWords` and `[[Free Links]]`.<br>Requires that you also set `Base URL`. See [WikiLinks][] for more information.<br><br><br>### Web ###<br><br>Use this to include the author's web URL.<br><br><br>### XHTML Header ###<br><br>This is used to include raw XHTML information in the header of a document. You<br>can use this field to add information that will be included in the header of<br>the generated XHTML file. This can be CSS formatting data, or javascript code,<br>or just about anything. I am not responsible for getting that code to work.<br>MultiMarkdown just includes it as is.<br><br>Anything included in this field is inserted, unaltered, in the `<head>`<br>section of the XHTML output. If you do add anything here, the XSLT stylesheet<br>may have to updated to ignore what you added if you want to convert to LaTeX.<br>Let me know what you add, and I can consider updating the XSLT stylesheet to<br>ignore it. Currently it ignores `<style>` sections.<br><br><br>### XHTML XSLT ###<br><br>This is the name of the XSLT file to use to post-process the XHTML file. This<br>can be used to further customize the XHTML output generated by MultiMarkdown.<br>For example, the `xhtml-toc.xslt` file can add a Table of Contents to the<br>start of XHTML page.<br><br><br><br>### XMP ###<br><br>This is used to provide a file to be included using<br>[xmpincl](http://www.ctan.org/tex-archive/macros/latex/contrib/xmpincl/).<br>Basically, this adds the ability to provide Creative Commons Licensing<br>information in a PDF's [metadata](http://creativecommons.org/technology/xmp).<br>It can also be used for other purposes (beyond the scope of this document.)<br><br><br>### XSLT File (deprecated)###<br><br>This metadata key has been deprecated in favor of `XHTML XSLT`, `RTF XSLT`,<br>and `LaTeX XSLT`.<br><br>## Automatic Cross-References ##<br><br>An oft-requested feature was the ability to have Markdown automatically handle<br>within-document links as easily as it handled external links. To this aim, I<br>added the ability to interpret `[Some Text][]` as a cross-link, if a header<br>named "Some Text" exists.<br><br>As an example, `[Metadata][]` will take you to the<br>[section describing metadata][Metadata].<br><br>Alternatively, you can include an optional label of your choosing to help<br>disambiguate cases where multiple headers have the same title:<br><br> ### Overview [MultiMarkdownOverview] ##<br><br>This allows you to use `[MultiMarkdownOverview]` to refer to this section<br>specifically, and not another section named `Overview`. This works with atx-<br>or settext-style headers.<br><br>If you have already defined an anchor using the same id that is used by a<br>header, then the defined anchor takes precedence.<br><br>In addition to headers within the document, you can provide labels for images<br>and tables which can then be used for cross-references as well.<br><br>## Image Support ##<br><br>Obviously, images are handled just fine by Markdown (with the exception of<br>attributes as noted above.) However, without some more information, images are<br>not easily translated into other document formats (e.g. PDF).<br><br>To handle this, my XSLT files will make use of `<img>` dimensions (e.g.<br>`height` and `width`). If present, the image will be scaled. If only one<br>dimension is specified, the image will be scaled proportionately. If neither<br>`height` nor `width` is specified, then the image will be scaled such that<br>it's width is the same as a column of text. This is to prevent high resolution<br>images from overflowing the page. Unfortunately, it has the side effect of<br>"zooming" in on smaller images. So, if you have images that are being scaled<br>in a way that you do not desire, simply specify at least one dimension.<br><br>*Note: XHTML only allows for units of `px` and `%` on `<img>` tags. LaTeX<br>allows for several others. So, my XSLT file allows for other units to be used,<br>even if they screw up the XHTML version. You have to choose appropriate units<br>for your purpose. Unfortunately, the only way around this is to make sure that<br>all of your images contain actual dimension information, and then remove the<br>`\resizebox` part from the XSLT.*<br><br>## Anchor and Image Attributes ##<br><br>Adding attributes to links and images has been requested for a long time on<br>the Markdown discussion list. I was fairly opposed to this, as most of the<br>proposals really disrupted the readability of the syntax. I consider myself a<br>"Markdown purist", meaning that I took John's introduction to heart:<br><br>> The overriding design goal for Markdown's formatting syntax is to make<br>> it as readable as possible. The idea is that a Markdown-formatted<br>> document should be publishable as-is, as plain text, without looking<br>> like it's been marked up with tags or formatting instructions. While<br>> Markdown's syntax has been influenced by several existing text-to-HTML<br>> filters, the single biggest source of inspiration for Markdown's<br>> syntax is the format of plain text email.<br><br>Because there was not a syntax proposal that I felt fit this goal, I was generally opposed to the idea.<br><br>Then, Choan C. Gálvez [proposed][galvez] a brilliantly simple syntax that<br>stayed out of the way. By simply appending the attributes to the link<br>reference information, which is already removed from the text itself, it<br>doesn't disturb the readability.<br><br>[galvez]: http://six.pairlist.net/pipermail/markdown-discuss/2005-October/001578.html<br><br>For example:<br><br> This is a formatted ![image][] and a [link][] with attributes.<br> <br> [image]: http://path.to/image "Image title" width=40px height=400px<br> [link]: http://path.to/link.html "Some Link" class=external<br> style="border: solid black 1px;"<br><br>This will generate width and height attributes for the image, and a border<br>around the link. And while it can be argued that it does look "like it's been<br>marked up with tags [and] formatting instructions", even I can't argue too<br>strongly against it. The link and the title in quotes already look like some<br>form of markup, and the the additional tags are hardly that intrusive, and<br>they offer a great deal of functionality. They might even be useful in further<br>functions (citations?).<br><br>The attributes must continue after the other link/image data, and may contain<br>newlines, but must start at the beginning of the line. The format is<br>`attribute=value` or `attribute="multi word value"`. Currently, MultiMarkdown<br>does not attempt to interpret or make any use of any of these attributes.<br>Also, you can't have a multiword attribute span a newline.<br><br><br>## WikiLinks (Deprecated)##<br><br><br><br>**Note:** The WikiLinks feature was more trouble than it was<br>worth, and has been removed. One can still use the wiki software<br>to manage these links. For example, my [MultiMarkdown Extension] for [Oddmuse]<br>supports Oddmuse styled WikiLinks.<br><br>[MultiMarkdown Extension]: http://www.oddmuse.org/cgi-bin/wiki/Markdown_Extension <br><br>## Footnotes ##<br><br><br>I have added support for footnotes to MultiMarkdown, using the syntax proposed<br>by John Gruber. Note that there is no official support for footnotes yet, so<br>the output format may change, but the input format sounds fairly stable.<br><br>To create a footnote, enter something like the following:<br><br> Here is some text containing a footnote.[^somesamplefootnote]<br> <br> [^somesamplefootnote]: Here is the text of the footnote itself.<br> <br> [somelink]:http://somelink.com<br><br><br>The footnote itself must be at the start of a line, just like links by<br>reference. If you want a footnote to have multiple paragraphs, lists, etc.,<br>then the subsequent paragraphs need an extra tab preceding them. You may have<br>to experiment to get this just right, and please let me know of any issues you<br>find.<br><br>This is what the final result looks like:<br><br>> Here is some text containing a footnote.[^somesamplefootnote]<br><br>[^somesamplefootnote]: Here is the text of the footnote itself.<br><br>## Tables ##<br><br><br>I have implemented a syntax for tables similar to that used by Michael<br>Fortin's [PHP Markdown Extra][].<br><br>[PHP Markdown Extra]: http://www.michelf.com/projects/php-markdown/extra<br><br>Basically, it allows you to turn:<br><br> | | Grouping ||<br> First Header | Second Header | Third Header |<br> ------------ | :-----------: | -----------: |<br> Content | *Long Cell* ||<br> Content | **Cell** | Cell |<br> <br> New section | More | Data |<br> And more | And more |<br> [Prototype table]<br><br>into a [table][Prototype Table].<br><br>| | Grouping ||<br>First Header | Second Header | Third Header |<br>| ---------- | :-----------: | -----------: |<br>Content | *Long Cell* ||<br>Content | **Cell** | Cell |<br><br>New section | More | Data |<br>And more | And more ||<br>[Prototype table]<br><br><br>The requirements are:<br><br>* There must be at least one `|` per line<br>* The second line must contain only `|`,`-`,`:`,`.`, or spaces<br>* Cell content must be on one line only<br>* Columns are separated by `|`<br>* The first line of the table, and the alignment/divider line, must start at <br> the beginning of the line<br><br>Other notes:<br><br>* It is optional whether you have `|`'s at the beginning and end of lines.<br><br>* To set alignment, you can use a colon to designate left or right alignment,<br> or a colon at each end to designate center alignment, as above. If no colon<br> is present, the default alignment of your system is selected (left in most<br> cases). If you use a period character (`.`), then `char` alignment is used -<br> in the future this will allow columns of decimal formatted numbers to be<br> aligned on the decimal character. Browsers do not currently support this<br> feature, so it is somewhat useless at the moment. It could be used in an<br> XSLT stylesheet for other output formats (e.g. LaTeX).<br><br>* To indicate that a cell should span multiple columns, there simply add<br> additional pipes (`|`) at the end of the cell, as shown in the example. If<br> the cell in question is at the end of the row, then of course that means<br> that pipes are not optional at the end of that row....<br><br>* You can use normal Markdown markup within the table cells.<br><br>* Captions are optional, but if present must be at the beginning of the line<br> immediately preceding or following the table, start with `[`, and end with<br> `]`. If you have a caption before and after the table, only the first match<br> will be used.<br><br>* If you have a caption, you can also have a label, allowing you to create<br> anchors pointing to the table. If there is no label, then the caption acts<br> as the label<br><br>* Cells can be empty.<br><br>* You can create multiple `<tbody>` tags within a table by having a **single**<br> empty line between rows of the table. This allows your CSS to place<br> horizontal borders to emphasize different sections of the table.<br><br>* If there is no header for the first column, then cells in that column will<br> be treated as headers, and formatted as such.<br><br><br>## Bibliography Support ##<br><br>I have included support for *basic* bibliography features in this version of<br>MultiMarkdown. Please give me feedback on ways to improve this but keep the<br>following in mind:<br><br>1. Bibliography support in MultiMarkdown is rudimentary. The goal is to offer<br>a basic standalone feature, that can be changed using the tool of your choice<br>to a more robust format (e.g. BibTeX, CiteProc). My XSLT files demonstrate how<br>to make this format compatible with BibTeX, but I am not planning on<br>personally providing compatibility with other tools. Feel free to post your<br>ideas and tools to the wiki.<br><br>2. Those needing more detailed function sets for their bibliographies may need<br>customized tools to provide those services. This is a basic tool that should<br>work for most people. Reference librarians will probably not be satisfied<br>however.<br><br><br>To use citations in MultiMarkdown, you use a syntax much like that for<br>anchors:<br><br> This is a statement that should be attributed to<br> its source[p. 23][#Doe:2006].<br> <br> And following is the description of the reference to be<br> used in the bibliography.<br> <br> [#Doe:2006]: John Doe. *Some Big Fancy Book*. Vanity Press, 2006.<br><br>The XHTML that is generated is as follows:<br><br> <p>This is a statement that should be attributed to its source<br> <span class="markdowncitation"> (<a href="#Doe:2006">1</a>, <span <br> class="locator">p. 23</span>)</span>.</p><br> <br> <p>And following is the description of the reference to be used<br> in the bibliography.</p><br> <br> <div class="bibliography"><br> <hr /><br> <p>Bibliography</p><br> <br> <div id="Doe:2006"><p>[1] John Doe. <em>Some Big Fancy Book</em>.<br> Vanity Press, 2006.</p></div><br> <br> </div><br><br>You are not required to use a locator (e.g. `p. 23`), and there are no special<br>rules on what can be used as a locator if you choose to use one.<br><br>There are no rules on the citation key format that you use (e.g. `Doe:2006`),<br>but it must be preceded by a `#`, just like footnotes use `^`.<br><br>As for the reference description, you can use Markup code within this section,<br>and I recommend leaving a blank line afterwards to prevent concatenation of<br>several references. Note that there is no way to reformat these references in<br>different bibliography styles; for this you need a program designed for that<br>purpose (e.g. BibTeX).<br><br>If you want to include a source in your bibliography that was not cited, you<br>may use the following:<br><br> [Not cited][#citekey]<br><br>The `Not cited` bit is not case sensitive.<br><br><br>### MultiMarkdown References ###<br><br>If you define your references (as in the example above), MultiMarkdown will<br>automatically append a basic bibliography to the end of your document. The<br>citations will of the form:<br><br> <span class="markdowncitation"> (<a href="#citekey">#<br> </a>, <span class="locator">p. 23</span>)</span><br><br>If you don't define a locator, you will get:<br><br> <span class="markdowncitation"> (<a href="#citekey">#<br> </a>)</span><br><br>When you click on the `#` (which is replaced with the specific reference<br>number), it takes you to the appropriate point in the Bibliography. Unlike<br>footnotes, there is no reverse link.<br><br><br>### External References ###<br><br>If you do not define references, then MultiMarkdown will substitute different<br>markup that can be used by XSLT to transform it into markup for an external<br>tool, e.g. BibTeX.<br><br> <span class="externalcitation"> (<a id="citekey">citekey</a>, <span <br> class="locator">p. 23</span>)</span><br><br>If you don't define a locator, you will get:<br><br> <span class="externalcitation"> (<a id="citekey">citekey</a>)</span><br><br><br>Obviously, the citekey that you use in MultiMarkdown must match that used by<br>your external tool.<br><br>[MultiMarkdownDragAndDrop]: http://fletcherpenney.net/Applications_That_Support_MultiMarkdown#multimarkdowndraganddrop "MultiMarkdown Drag and Drop"<br><br>### Multiple Citations ###<br><br>When you need to combine multiple citations together, simply add them<br>serially:<br><br> [p. 3][#Doe:1996][p. 10][#Smith:2005]<br><br>giving the output:<br><br> (1, p. 3) (2, p. 10)<br><br>I recognize that this is not really a standardized format, but again I remind<br>you that the bibliography support in MultiMarkdown is minimal. If you want<br>more control, or adherence to proper style rules, you need a more powerful<br>bibliography tool.<br><br>I have written a perl script that will join these serial citations into one,<br>`cleancites.pl`. It is run by default by the default MultiMarkdown usage<br>scripts.<br><br>### BibTeX Support ###<br><br>If you are a user of BibTeX, you may use it to control your references. Simply<br>set the `Bibtex` and `Bibliographystyle` metadata as described in the section<br>on [Metadata][], and use my xhtml2latex XSLT files as examples.<br><br>If you use this, you are not required to define your references within your<br>MultiMarkdown document.<br><br>### Advanced Citations with natbib ###<br><br>Advanced LaTeX users are probably familiar with the<br>[natbib](http://www.ctan.org/tex-archive/help/Catalogue/entries/natbib.html)<br>package, which adds additional features for bibliographic citations. It offers<br>two new citation commands, `\citet` and `\citep`.<br><br>To use the advanced natbib features:<br><br>1. You must have the natbib package installed for LaTeX<br>2. You must use an appropriate XSLT file that enables the natbib package (`memoir-natbib.xslt` is an example - you can make your own)<br><br><br>By default, citations occur using the `\citep` command.<br><br>To use a `\citet` citation, follow the example below:<br><br> In their seminal paper, [Smith and Jones; p 42][#Smith1990] argue<br> convincingly that....<br> <br> [#Smith1990]: Smith, R, and Jones, K. *Some Fancy Article* etc...<br><br>The text before the semi-colon indicates that we want a textual citation. In<br>the XHTML version, the text you enter becomes the text in the sentence. When<br>converted to LaTeX, your text is actually removed and the natbib package<br>handles it for you. The text after the semi-colon is the usual locator text<br>(if you don't want a locator, just leave it blank after the semi-colon).<br><br>If you don't include a semi-colon, then the `\citep` command is used in the<br>usual fashion.<br><br>## Math Syntax ##<br><br>### Introduction to Math support ###<br><br><br>**Note**: *Math support within MultiMarkdown is created using MathML. MathML<br>is not fully supported in many browsers, so your mileage may vary (I honestly<br>don't care whether Internet Explorer works --- get a real browser. Support<br>within Firefox is pretty good, but not perfect.) This feature is quite useful,<br>however, when generating a PDF via LaTeX.*<br><br>*To view a file with MathML properly in Firefox, it must have the file ending<br>".xhtml". I don't know why, and it seems dumb that file extensions are so<br>important in 2007. But for now, that's the way it is.*<br><br>MultiMarkdown supports [ASCIIMathML](http://en.wikipedia.org/wiki/ASCIIMathML)<br>a syntax for converting mathematical equations from plain text into<br>[MathML](http://en.wikipedia.org/wiki/MathML). MathML can be used within<br>properly formatted XHTML documents to display well typeset mathematical<br>formula.<br><br>The conversion used to managed by<br>[ASCIIMathPHP](http://www.jcphysics.com/ASCIIMath/), which was a PHP script<br>that had to be run separately from MultiMarkdown itself. As of version<br>2.0b.b4, however, I am using the<br>[Text::ASCIIMathML](http://search.cpan.org/~nodine/Text-ASCIIMathML-0.5/) Perl<br>module for support built into the MultiMarkdown script.<br><br>### MultiMarkdown Math Syntax ###<br><br>Basically, use use `<<` and `>>` as delimiters to indicate that you are<br>including math in your document. You can use this to create an inline formula,<br>or you can create independent equations, each in it's own paragraph. These can<br>also then be converted properly into LaTeX math environments.<br><br>Additionally, you can include a `[label]` tag at the end of the equation to<br>allow you to reference it elsewhere in your text with the label. For example:<br><br> << e^(i pi) + 1 = 0 [Euler's identity]>><br> <br> << x_(1,2) = (-b+-sqrt(b^2-4ac))/(2a) [quadratic equation solution]>><br> <br> You can also include formulas within a sentence, such as<br> <<x^2 + y^2 = 1>>. You can then make a reference to<br> [Euler's identity].<br><br>is converted into:<br><br>> << e^(i pi) + 1 = 0 [Euler's identity]>><br><br>> << x_(1,2) = (-b+-sqrt(b^2-4ac))/(2a) [quadratic equation solution]>><br><br>> You can also include formulas within a sentence, such as<br>> << x^2 + y^2 = 1>>. You can then make a reference to [Euler's identity].<br><br>### Superscripts ###<br><br>By using the math mode above, you can include superscripts and the like in<br>MultiMarkdown documents that don't necessarily have to be separate formulas.<br>For example:<br><br> <<2^pi>><br><br>becomes <br><br>> <<2^pi>>.<br><br>This is, of course, subject to the same limitations as MathML in general.<br><br>### MathML Difficulties ###<br><br>There are some glitches in this process. First, many browsers don't fully<br>support MathML, and sometimes you have to go through great lengths to get the<br>browser to recognize it properly. Firefox, for instance, requires an `.xhtml`<br>extension to properly recognize the file as `XHTML` instead of `HTML`. This<br>may not be an ideal solution for everybody, but it **does** allow you to use a<br>plain english syntax to represent mathematical formulas and symbols within<br>Markdown documents, which was my goal. Others may prefer to use custom<br>solutions using raw LaTeX source, but I didn't want to have to learn the LaTeX<br>math syntax.<br><br>On the up side, however, this does give wonderful output when combined with my<br>XSLT scripts to generate LaTeX documents and PDF's. I am open to input on this<br>feature, and suspect it will become increasingly useful as browser support for<br>MathML improves.<br><br>For more information on supporting MathML in web browsers, I have written a<br>brief introduction to <br>[Supporting MathML](http://fletcherpenney.net/Supporting_MathML) on my web<br>site.<br><br><br>## Definition Lists ##<br><br>MultiMarkdown has support for definition lists using the same syntax used in<br>[PHP Markdown Extra][]. Specifically:<br><br> Apple<br> : Pomaceous fruit of plants of the genus Malus in <br> the family Rosaceae.<br> : An american computer company.<br> <br> Orange<br> : The fruit of an evergreen tree of the genus Citrus.<br><br><br>becomes:<br><br>> Apple<br>> : Pomaceous fruit of plants of the genus Malus in <br>> the family Rosaceae.<br>> : An american computer company.<br>><br>> Orange<br>> : The fruit of an evergreen tree of the genus Citrus.<br><br>You can have more than one term per definition by placing each term on a<br>separate line. Each definition starts with a colon, and you can have more than<br>one definition per term. You may optionally have a blank line between the last<br>term and the first definition.<br><br>Definitions may contain other block level elements, such as lists,<br>blockquotes, or other definition lists.<br><br>Unlike PHP Markdown Extra, all definitions are wrapped in `<p>` tags. First, I<br>was unable to get Markdown *not* to create paragraphs. Second, I didn't see<br>where it mattered - the only difference seems to be aesthetic, and I actually<br>prefer the `<p>` tags in place. Let me know if this is a problem.<br><br>See the [PHP Markdown Extra][] page for more information.<br><br>## Appendices ##<br><br>If you want to designate the final subgroup of chapters as appendices, you can include an `h1` or `h2` level header (as appropriate based on your document) with the title `Appendices`. The chapters that follow would be considered appendices when the document is converted to LaTeX using the memoir class. Since XHTML doesn't have a concept of appendices, it has no real meaning, but would at least designate this to the reader.<br><br>## Glossaries ##<br><br>MultiMarkdown has a feature that allows footnotes to be specified as glossary<br>terms. It doesn't do much for XHTML documents, but the XSLT file that converts<br>the document into LaTeX is designed to convert these special footnotes into<br>glossary entries.<br><br>The glossary format for the footnotes is:<br><br> [^glossaryfootnote]: glossary: term (optional sort key)<br> The actual definition belongs on a new line, and can continue on<br> just as other footnotes.<br><br>The `term` is the item that belongs in the glossary. The `sort key` is<br>optional, and is used to specify that the term should appear somewhere else in<br>the glossary (which is sorted in alphabetical order).<br><br>Unfortunately, it takes an extra step to generate the glossary when creating a<br>pdf from a latex file:<br><br>1. You need to have the `basic.gst` file installed, which comes with the<br>memoir class.<br><br>2. You need to run a special makeindex command to generate the `.glo` file:<br> ``makeindex -s `kpsewhich basic.gst` -o "filename.gls" "filename.glo"``<br><br>3. Then you run the usual pdflatex command again a few times.<br><br>Alternatively, you can use the code below to create an engine file for TeXShop<br>(it belongs in `~/Library/TeXShop/Engines`). You can name it something like<br>`MemoirGlossary.engine`. Then, when processing a file that needs a glossary,<br>you typeset your document once with this engine, and then continue to process<br>it normally with the usual LaTeX engine. Your glossary should be compiled<br>appropriately. If you use [TeXShop][], this is the way to go.<br><br>**Note**: *Getting glossaries to work is a slightly more advanced LaTeX<br>feature, and might take some trial and error the first few times.*<br><br><br> #!/bin/ <br> <br> set path = ($path /usr/local/teTeX/bin/powerpc-apple-darwin-current <br> /usr/local/bin) # This is actually a continuation of the line above<br> <br> set basefile = `basename "$1" .tex`<br> <br> makeindex -s `kpsewhich basic.gst` -o "${basefile}.gls" "${basefile}.glo"<br><br><br>[TeXShop]: http://www.uoregon.edu/~koch/texshop/ "TeXShop Homepage"<br><br>## Poetry Mode ##<br><br>By default, when you have a section of text indented with a tab, MultiMarkdown<br>interprets this as a code block. This allows you to more exactly control the<br>spacing and line endings, but it also applies a monospace font in both the<br>XHTML and LaTeX outputs. This is the usual way of demonstrating source code in<br>documents.<br><br>Some authors, however, don't write about source code, but would like a way to<br>control line endings (when writing poetry, for example).<br><br>To accomplish this, there are several alternate XSLT files included within the<br>MultiMarkdown distribution that are labelled with a `poetry` filename. These<br>XSLT files handle the code blocks in a slightly different way to make them<br>more suitable for text, rather than code. I encourage you to give this a try.<br><br>At the current time, there is no way to use both formats within the same<br>document, except to format them manually. This may change in the future,<br>depending on some decisions John Gruber needs to make about the standard<br>Markdown syntax.<br><br>## Miscellanea ##<br><br>In addition to what is mentioned elsewhere in this document, MultiMarkdown<br>does a few things slightly differently:<br><br>* `©` entities are converted to `©` so that they can pass through an<br> XSLT parser<br><br>* `*` and `_` are not interpreted as `<strong>` or `<em>` when they occur in<br> the middle of words. This caused too many problems with URL's.<br><br>MultiMarkdown supports the conversion of colored spans of text from XHTML to<br>LaTeX using the xcolor package. For example:<br><br> <span style="color:#888888">net</span><br><br>becomes:<br><br> {\color[HTML]{888888} net}<br><br>There is not currently a syntax shortcut for this, you have to manually add<br>the `` information. This technique is used to support annotations from<br>Scrivener, for example.<br><br>[PHP Markdown Extra]: http://www.michelf.com/projects/php-markdown/extra/<br><br># MultiMarkdown and LaTeX #<br><br>[LaTeX](http://www.latex-project.org/) is a professional quality typesetting<br>system that can be used to take plain text markup and produce a high quality<br>pdf, complete with table of contents, index, glosssary, etc. It's a fairly<br>complicated program, but capable of doing most of the work for you. One of my<br>goals with MultiMarkdown was to make it even easier to create a LaTeX<br>document, with minimal knowledge of the LaTeX syntax. In fact, you can create<br>fairly complex documents without any understanding of how LaTeX works, as long<br>as you have it installed correctly.<br><br><br>That said, MultiMarkdown is not simply a preprocessor for LaTeX files, so<br>there will always be LaTeX commands that are just not available from within<br>MultiMarkdown. If you're a LaTeX expert, you might find that after<br>MultiMarkdown runs, you want to go and hand tweak a few parts to get things<br>just right. But for the average user and average document, I suspect the<br>default output will be just fine.<br><br>The settings to pay particular attention to:<br><br>* You must choose an XSLT file to convert the MultiMarkdown-generated XHTML<br> into LaTeX; you do this by setting the `LaTeX XSLT` metadata. If you do not<br> choose one, the default is `memoir.xslt`. Most of my XSLT files are based<br> around the `memoir` package --- it's the one I'm familiar with, it's very<br> flexible, and has high quality output, and lots of features. That said, you<br> are welcome to create your own XSLT files to use whatever packages you<br> prefer. The beauty of the XSLT transformation process is that it can be<br> completely reconfigured however you like.<br><br>* Depending on what sort of document you are creating, you may need to set the<br> `Base Header Level` metadata. For example, if you are creating a `memoir`<br> based document, and wish for your top-level section to be a chapter, rather<br> than a "part", you could set `Base Header Level` to 2. It's easier to do<br> than explain, but basically it moves all levels of your structure by the<br> specified number of steps.<br><br>* You likely will want to set as much of the basic metadata as possible (e.g.<br> `Title`, `Author`, `Date`, `Keywords`, etc) as most of this is converted to<br> a format that is used in the resulting PDF.<br><br>Also, MultiMarkdown has support for<br>[BibTeX](http://en.wikipedia.org/wiki/BibTeX), glossaries, html links,<br>internal links between sections of the document, math formatting, etc. Most of<br>the "major" features of LaTeX are available using the standard MultiMarkdown<br>syntaxes. If there is something you don't see, just ask --- it may exist, or I<br>might be able to add it if appropriate.<br><br>The general process of creating a PDF via LaTeX is the same as the normal use<br>of MultiMarkdown, with one additional step:<br><br>1. Create your text source file<br><br>2. Using your method of choice, convert the text file to XHTML, and then<br>convert the XHTML to LaTeX (most of my tools will do this as a single step as<br>far as the user is concerned).<br><br>3. Convert the LaTeX source file to PDF using the tool of your choice (my Drag<br>and Drop [application](http://fletcherpenney.net/MultiMarkdown_Drag_and_Drop),<br>[TeXShop], [latexmk](http://www.phys.psu.edu/~collins/software/latexmk-jcc/),<br>manually, etc.)<br><br>Due to the complexity of the LaTeX source, it can be hard to troubleshoot when<br>using an automatic tool. If something doesn't work, I recommend first trying<br>to get your MultiMarkdown text file converted to XHTML and verify that it is<br>correct. Then convert the XHTML to LaTeX and be sure that you can watch the<br>status messages that occur during processing of the LaTeX file - they will<br>usually give you a hint as to where the problem lies. Remember, just because<br>the XHTML version of a MultiMarkdown document is valid XHTML does not mean the<br>resulting LaTeX will be totally valid.<br><br>[TeXShop]: http://www.uoregon.edu/~koch/texshop/ "TeXShop Homepage"<br><br><br># Advanced Features and Customization #<br><br>I believe that MultiMarkdown works pretty well "out of the box" for the vast<br>majority of users (of course, I'm not biased or anything...) But more advanced<br>users will eventually start thinking about features that they wish existed.<br>Some of these features are very specific to their own documents and style, but<br>others are more general and would be of use to everyone.<br><br>## How do I find out about feature x? ##<br><br>My recommended approach is:<br><br>1. Make sure you check through the documentation on the web site (there is a<br>search feature). An increasing number of feature requests are for things that<br>already exist.<br><br>2. Check the MultiMarkdown discussion list to see if someone has already<br>suggested your feature, or better yet, has already solved it.<br><br>3. Decide whether it's something you could try and do yourself, or whether you<br>need to ask for help to accomplish it. Either way, the results can be shared<br>on my web site to help others.<br><br>## How do I customize MultiMarkdown? ##<br><br>The first step in trying to customize MultiMarkdown is to figure out where in<br>the workflow the customization needs to occur:<br><br>1. Does the MultiMarkdown perl script need to be modified to add a new syntax,<br>or change the way the output is generated? There should be fewer and fewer<br>necessary changes in this step as the MultiMarkdown syntax matures. Also, note<br>that I am hesitant to add new features at this level that increase the<br>complexity of markup. It's not impossible, but I will definitely need to be<br>convinced it's the only way to go.<br><br>2. Can the desired feature be implemented through a modification of one of the<br>XSLT files? XSLT is a powerful tool, and can be used to really customize the<br>XHTML or LaTeX output from a MMD document. (*Many users would likely benefit<br>from a generic XHTML to RTF XSLT stylesheet - I have been unable to locate one<br>that would work, and I have no need of RTF documents. This would be too much<br>work for too little gain for me, but I am sure someone out there needs exactly<br>this sort of tool.*) Browse through the `XSLT` directory and look to see if<br>there is a stylesheet that could be modified to do what you want. The XSLT<br>syntax is not that complicated, but does take some getting used to. As<br>examples, the `xhtml-toc.xslt` script parses the header tags in the XHTML<br>output, and creates an automatic table of contents at the top of the XHTML<br>file. The `xhtml-poetry-support.xslt` file looks for code blocks that start<br>with `[poetry]` and changes them to a poetry mode, rather than code (basically<br>removing the monospace font).<br><br>3. Does the desired feature need to be implemented in a separate<br>post-processing script? For example, for LaTeX documents I use a script called<br>`cleancites.pl` that looks for strings of multiple citations to shorten the<br>syntax. You could easily create a script to do whatever you like and<br>incorporate it into your work flow.<br><br><br>In summary, a great many features and customizations can be added to<br>MultiMarkdown by users. I also recommend that you consider sharing any of your<br>customizations back to the MultiMarkdown community - I am happy to put any<br>files or links on my site, if you are interested.<br><br>## Where do I dig in the MultiMarkdown package to find out more? ##<br><br><br>Again, places to look for inspiration:<br><br>* MultiMarkdown/bin - this is where the "glue" scripts live that manage<br> different MultiMarkdown workflow patterns. You can create your own shell<br> scripts that can add additional steps to your workflow here.<br><br>* MultiMarkdown/Utilities - a couple of utility scripts and the<br> `cleancites.pl` post-processing script live here; you can add files here and<br> incorporate them into your work flow.<br><br>* MultiMarkdown/XSLT - XSLT files for modifying XHTML files or creating LaTeX<br> files go here. Lots of examples for different styles of output or<br> customizing the way various features work.<br><br>* <http://fletcherpenney.net/XSLT_Files> - this is where I will place various<br> user submitted files that may be of interest, or offer a starting point for<br> further customization. Please consider submitting your own improvements here<br> as well.<br><br># Component Software #<br><br>The MultiMarkdown system is actually a patchwork of multiple programs, which<br>are run in a specific order by shell scripts. I have written the glue<br>utilities, and the MultiMarkdown modifications to John Gruber's original<br>Markdown program, but I can't take credit for the rest.<br><br><br>## MultiMarkdown [MMD] ##<br><br>* by Fletcher T. Penney<br>* <http://fletcherpenney.net/MultiMarkdown><br><br>MultiMarkdown is my update to John Gruber's<br>[Markdown](http://daringfireball.net/projects/markdown/) software. It is what<br>this bundle is based on. To learn more about why you would want to use this<br>bundle, check out the web page for MultiMarkdown.<br><br>## SmartyPants ##<br><br>* by John Gruber<br>* <http://daringfireball.net/projects/smartypants/><br><br>SmartyPants is another program by John Gruber, and is designed to add "smart"<br>typography to HTML documents, including proper quotes, dashes, and ellipses.<br>Additionally, there are several variations of the SmartyPants files to handle<br>different localizations (specifically, Dutch, French, German, and Swedish).<br>These localizations were provided by Joakim Hertze.<br><br>## Text::ASCIIMathML ##<br><br>* by Mark Nodine<br>* <http://search.cpan.org/~nodine/><br><br>This perl module adds support for converting the ASCIIMathML syntax into<br>MathML markup suitable for inclusion in XHTML documents.<br><br>## ASCIIMathPHP (Deprecated)##<br><br>* by Kee-Lin Steven Chan<br>* <http://www.jcphysics.com/ASCIIMath/><br><br>This bundle includes the MultiMarkdown specific variant of the original<br>ASCIIMathPHP. It allows you to use the ASCIIMath syntax to describe<br>mathematical formulas in plain text language.<br><br>This software has been replaced by Text::ASCIIMathML.<br><br>## XSLTMathML ##<br><br>* by Vasil Yaroshevich<br>* <http://www.raleigh.ru/MathML/mmltex/index.php?lang=en><br><br>This bundle includes the MultiMarkdown specific variant of the original<br>XSLTMathML. It converts XHTML with MathML markup into LaTeX math environment<br>code. Very handy for making well typeset documents that are math-heavy.<br><br># Applications That Support MultiMarkdown #<br><br>There are several applications and utilities out there that include support<br>for MultiMarkdown, that can make it even easier to create your output<br>documents.<br><br>If you know of something not included here, please let me know.<br><br><br>## Movable Type ##<br><br>MultiMarkdown can be used with Movable Type. To install:<br><br>1. Place `MultiMarkdown.pl` in the `mt/plugins/Markdown` directory<br>2. Copy `ASCIIMathML.pm` into the same directory<br>3. Make sure `SmartyPants.pl` is also there<br><br>Now MultiMarkdown should be working with Movable Type. For some reason,<br>however, it seems somewhat temperamental at times. I haven't been able to<br>figure out why, but it works for me on my local machine and on my host's<br>server. It has also worked for other users.<br><br><br>## MultiMarkdown Drag and Drop ##<br><br>Early on, as MultiMarkdown became increasingly powerful (and complex) I<br>realized that most people would want something a little easier to use than<br>what had become a rather complicated command line string.<br><br>The first solution was a set of Drag and Drop applications created using<br>[Platypus]. These were designed to allow you to drop a MultiMarkdown text file<br>on the application icon, and they spit out a .xhtml, .pdf, .rtf, or .tex file,<br>depending on which application you used.<br><br>These utilities are still available, and have been updated to work with the<br>"Common" MultiMarkdown Installation:<br><br>* <http://files.fletcherpenney.net/MultiMarkdownDragAndDrop.zip><br><br><br>[Platypus]: http://sveinbjorn.sytes.net/platypus "Platypus Homepage"<br><br>## Scrivener ##<br><br>[Scrivener] is a:<br><br>> ... project management tool for writers that acts like your own<br>> little writing shed at the bottom of the garden, where you have<br>> cork notice-boards, ring-binders, photos, clippings paperclipped<br>> to jottings, notebooks and reams of typewritten pages piling up<br>> - along with a secretary who keeps it all in neat piles and uses<br>> his speed-reading skills to find what you need as soon as you need<br>> it. [#Blount][]<br><br>As of beta 3, Scrivener has the ability to export to a MultiMarkdown text<br>file, or to run the conversion utilities to create XHTML, RTF, or LaTeX files.<br>It also has support for MultiMarkdown metadata.<br><br>Scrivener's strengths, as they relate to MultiMarkdown, included the ability<br>to arrange and re-arrange your document as desired using its outliner view,<br>cork-board, and other features. It also has some limited ability to convert<br>RTF bold and italic formatting into MultiMarkdown syntax, which can be useful<br>when converting documents from other formats.<br><br>Scrivener is primarily focused towards creative writing, but when combined<br>with MultiMarkdown it is very useful for academic and technical writing where<br>a LaTeX file is highly desirable.<br><br>Keith Blount has done a great job with Scrivener, and I was happy to be able<br>to help implement support for MultiMarkdown. I look forward to helping to<br>continue to use and refine this program myself.<br><br>At this time, Scrivener is in public beta, and should be available for<br>purchase towards the end of 2006 or beginning of 2007. But the beta is very<br>usable as is, and gives you until Jan 2007 or so to try it out.<br><br>For more information, I have created a User's Guide to MultiMarkdown and<br>Scrivener:<br><br>* <http://fletcherpenney.net/Using_MultiMarkdown_with_Scrivener><br><br>[#Blount]: Literate and Latte - Scrivener. <br><http://www.literatureandlatte.com/scrivener.html><br><br>## OmniOutliner ##<br><br>I have written an export plugin for OmniOutliner that allows you to craft your<br>MultiMarkdown documents within OmniOutliner, and then export to a text file<br>(or folder with text file and images), that can then be processed with<br>Markdown or MultiMarkdown.<br><br><http://fletcherpenney.net/multimarkdown/multimarkdown_and_omnioutliner/><br><br>## TextMate ##<br><br>[TextMate][] is a powerful text editor that:<br><br>> brings Apple's approach to operating systems into the world of text<br>> editors. By bridging UNIX underpinnings and GUI, TextMate cherry-picks<br>> the best of both worlds to the benefit of expert scripters and novice<br>> users alike....<br><br>> Created by a closet UNIX geek who was lured to the Mac platform by<br>> its ease of use and elegance, TextMate has been referred to as the<br>> culmination of Emacs and OS X and has resulted in countless requests<br>> for both a Windows and Linux port, but TextMate remains exclusive for<br>> the Mac, and that is how we like it![#macromates][]<br><br>TextMate is somewhere between a text editor for programmers, and a writing<br>tool. If you like being able to customize your writing environment, and like<br>fancy tools to handle the formatting for you, then TextMate might be the app<br>for you.<br><br>Allan Odgaard created an initial Bundle that added Markdown support to<br>TextMate. It included some basic MultiMarkdown support as well. But to be<br>honest, *I* had trouble getting it to work. And if I had difficulty, I can<br>only imagine how much trouble others had.<br><br>So I created my own Bundle. It includes a lot of features that automatically<br>format metadata, lists, tables, headers, etc. It can clean up the text to make<br>it look as presentable as possible in plain text, and it can then<br>automatically convert your text into XHTML, RTF, Word, or LaTeX/PDF.<br><br>I have subsequently rewritten this bundle as a fork of the original on github.<br>This should make it easier to incorporate changes, and possibly to merge the<br>two projects into a single bundle.<br><br>* <http://fletcher.github.com/markdown.tmbundle/><br><br><br>[#macromates]: TextMate --- The Missing Editor for Mac OS X. <br><http://macromates.com/><br><br><br>## Using Scrivener and TextMate Together ##<br><br>It is possible, using the "Edit in TextMate" feature from TextMate. Basically,<br>it adds the ability to edit any Cocoa based text editor view in TextMate. This<br>allows you to edit the text from a Scrivener document in TextMate, in order to<br>take advantage of the automatic formatting, while still retaining the<br>organizational features of Scrivener.<br><br>This feature has its limitations (it breaks the undo stack in Scrivener) and<br>is only for advanced users. I take no responsibility for it, as I didn't write<br>Scrivener or TextMate. But it can be useful...<br><br>To learn more, check out the information on Cocoa Text Fields:<br><br>* <http://macromates.com/textmate/manual/using_textmate_from_terminal><br><br>## The "Common" MultiMarkdown approach ##<br><br>During beta testing of the MultiMarkdown support with Scrivener, it was<br>proposed that having a standard location for MultiMarkdown could make it easy<br>to integrate with various applications, and to allow the user a single place<br>to update their MultiMarkdown files, independent of the application it was<br>being used with.<br><br>For Mac OS X users, this boils down to allowing a MultiMarkdown installation<br>to be placed in one of two locations, where it is available to any application<br>that knows to look for it there:<br><br>* ~/Library/Application Support/MultiMarkdown<br><br>* /Library/Application Support/MultiMarkdown<br><br>The first is available only to the user, and the second is available to anyone<br>on that computer.<br><br>When Scrivener, or another application that supports this feature is run, it<br>checks to see if a MultiMarkdown installation is available in either of those<br>places. If not (the first time you run the program, for instance), then some<br>programs might install a version of MultiMarkdown here; others might simply<br>use an a copy of MultiMarkdown embedded within the application bundle.<br><br>The benefit of this approach is that if I update MultiMarkdown, you can simply<br>replace the updated files in the Application Support folder, without having to<br>update the other applications.<br><br>Please let me know if you have suggestions on improving this feature, or if<br>you are interested in including support for MultiMarkdown in your own<br>application.<br><br>Naturally, this approach only works with Mac OS X. If anyone is interested in<br>working on a similar feature for other operating systems, please let me know.<br><br>## Create Your Own ##<br><br>Between shell scripts, applescripting, Automator, and other tools, you can<br>usually find an easy way to incorporate MultiMarkdown into your own workflow.<br>If you find something that you think should be added here, let me know!<br><br><br><br># Technical Issues #<br><br>The MultiMarkdown system is actually a fairly complex group of programs, which<br>includes multiple perl utilities, a PHP program, and multiple XSLT files. With<br>some hand waving, I try to make it look like a single coherent program, but it<br>actually uses multiple utilities written by multiple people.<br><br>This section is designed to address some of these issues, and implications<br>they may have for users, programmers, etc.<br><br><br>## XML Namespace Issues ##<br><br>As of version 2.0.a3, there has been a complete overhaul of the way XML<br>namespaces are handled. This required changing all of the XSLT files to use an<br>"html" alias for the "http://www.w3.org/1999/xhtml" namespace.<br><br>It appears to be working, including support for MathML.<br><br>If you have any custom XSLT files, you will need to make the same changes,<br>specifically:<br><br>Make your stylesheet declaration look like:<br><br> <xsl:stylesheet<br> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"<br> xmlns:html="http://www.w3.org/1999/xhtml"<br> version="1.0"><br><br>And relabel any references to XHTML elements, so that they are preceeded by "html:", e.g. <br><br> <xsl:template match="/"><br> <xsl:apply-templates select="html/head"/><br> <xsl:apply-templates select="html/body"/><br> <xsl:call-template name="latex-footer"/><br> </xsl:template><br><br>should look like this:<br><br> <xsl:template match="/"><br> <xsl:apply-templates select="html:html/html:head"/><br> <xsl:apply-templates select="html:html/html:body"/><br> <xsl:call-template name="latex-footer"/><br> </xsl:template><br><br>I have left the `-novalid` and `-nonet` options in place to prevent<br>unnecessary errors when you are not connected to the internet, but these could<br>be removed if desired.<br><br>## XeLaTeX Tips ##<br><br>If you are using XeLaTeX to process your document (useful for utilizing Mac OS X fonts in your document), you want to use font declarations like this:<br><br> \font\addressbold="Garamond Bold:mapping=tex-text" at 8pt<br><br>By including the ":mapping=tex-text" portion, you regain use of smart quotes, en- and em- dashes, etc. I'm sure most XeLaTeX users know this, but it took me a bit of trial and error to discover it....<br><br><br># Acknowledgments #<br><br>Thanks to the individuals and groups below for their contributions to<br>improving Markdown and MultiMarkdown:<br><br>* John Gruber<br>* Michel Fortin<br>* Jonathan Weber<br>* Mark Eli Kalderon<br>* Choan C. Gálvez<br>* Dr. Drang<br>* Robert McGonegal<br>* David Green<br>* Trey Pickard<br>* Saleem<br>* Melinda Norris<br>* Sean Wallace<br>* Allan Odgaard<br>* Stefan Brantschen<br>* Keith Blount<br>* Amber Vaesca<br>* Gerd Knops<br>* John Purnell<br>* Jonathan Coulombe<br>* Jason Bandlow<br>* Joakim Hertze<br>* Kee-Lin Steven Chan<br>* Vasil Yaroshevich<br>* Matt Neuburg<br>* James Howison<br>* Edward Nixon<br>* etherean<br>* Özgür Gökmen<br>* Chad Schmidt<br>* Greg (gr)<br>* Ben Jennings<br>* Silvan Kaiser<br>* Tomas Doran<br>* Rob Walton<br>* Dan Rolander<br>* Duoyi wu<br>* Dan Dascalescu<br>* Ingolf Schäfer<br>* Chris Bunch<br>* Oblomov<br>* Alex Melhuish<br>* Stephan Mueller<br>* Josh Brown<br>* Rob Person<br>* Matthew D. Rankin<br><br>and others I have surely forgotten....<br><br><br><br># Known Issues #<br><br>* The `<<...>>` syntax can cause only the first `<` to be encoded as `<` if<br> there is no trailing space (e.g. `<<something>>` vs. `<< something >>`). I<br> suspect that I will have to manually look for any `<<` and convert them. I<br> guess this is technically an issue with Markdown and not MultiMarkdown, but<br> it has apparently not come up before.<br><br>* I tried to remove dependence on the `varwidth` package. This screws up the<br> formatting of footnotes in tables, and also RTF exporting of tables. I'm not<br> sure what to do - varwidth is incompatible with xcolor and is not a standard<br> package. Suggestions welcome.<br><br>* Creating a link to an image by label doesn't work properly anymore<br><br>* I'm having difficulty with getting the glossary feature to work in the<br> non-memoir classes. At some point I will look into this, but if someone else<br> out there can point out what I'm doing wrong, let me know.<br><br>* RTF support currently only exists for Mac OS X. Conversion from XHTML to RTF<br> happens via Apples `textutil` tool. It is possible to write an XSLT file <br> that converts from XHTML to RTF, but I have little to no interest in <br> writing this myself, as I don't really use the RTF format very often. If <br> someone were interested in developing this, I would help out. An added <br> benefit would be that the XSLT could actually do a better job than Apple's <br> tool in terms of footnote support and internal links. Contact me if <br> you're interested. In the meantime, I suggest using [Google Docs][] to <br> import the XHTML file, and then export as an RTF. It does a much better <br> job.<br><br>* The sample MMD file creates two copies of the footnote in the `MultiMarkdown<br> vs. Crayons` table, even though I only call for one. Not sure where the `a`<br> footnote comes from.... Any help in tracking this down would be appreciated,<br> as it didn't used to do this.<br><br><br>[Google Docs]: http://docs.google.com/<br><br><br># Things to Do #<br><br>* Add a syntax to allow comments that can be stripped before passing the<br> output to the parser<br><br>* write a routine (that would be separate from MultiMarkdown) to download<br> linked images, save them to a tmp directory, and then convert them for use<br> within a pdf.<br><br>* Decide on appropriate management of alignment when a cell spans multiple<br> columns. Currently, the alignment of the first cell is used. (If Markdown<br> goes to a whitespace-based alignment option, that could be used in this<br> instance.)<br><br>* Consider whether there is a reasonable syntax for table cells that span<br> multiple rows.<br><br>* Consider a syntax for superscripts (this has been discussed before) - could<br> convert it to MathML syntax? Or just use math markup instead as described in<br> [Superscripts].<br><br>* Certain markup gets processed within headers and shouldn't, e.g. `<img>`<br><br>* Consider whether to incorporate the definition list syntax into a footnote<br> to specify a glossary entry (or perhaps even without the footnote), or<br> whether to leave well enough alone.<br><br><br># Version History #<br><br>> Release early, release often!<br>> > Linus Torvalds<br><br>* 2.0.b6 - Fix support for base header level with Setext-style headers (thanks<br> to Rob Walton); improve Windows support;<br><br>* 2.0.b5 - spaces at end of xslt filenames won't cause failure; use `\url{}`<br> for "non-referenced" url's in LaTeX to allow linebreaks (though they still<br> don't always break correctly --- this is a problem with `hyperref` not MMD);<br> don't convert `^` to exponents in the `clean-text-allow-latex.xslt` file so<br> that math code works properly; the S5 XSLT file at least partially works<br> again now; update the TextMate bundle to work with Leopard; updated the<br> envelope and letterhead files; include `6x9book-real-poetry` XSLT that uses<br> memoir's poetry features fairly well; rework the `clean-text` files to make<br> them easier to update in the future and more modular; XHTML comments are now<br> passed through as raw LaTeX; unescape encoding within comments;<br><br>* 2.0.b4 - empty labels for headers now produce valid XHTML (e.g. no `id=""`);<br> fix bug in `clean-text.xslt` that caused a problem with closing double<br> quotes; the `.xslt` extension is no longer required in metadata; added<br> customizable letterhead XSLT; fix bug in table support that choked on extra<br> spaces at end of lines; *Major Change*: switched to Text::ASCIIMathML for<br> math support, meaning that everything is once again perl based (this enables<br> math features on web sites using MultiMarkdown, for example); fix bug that<br> occurred when 'Abstract' was not the first chapter;<br><br>* 2.0.b3 - move the `clean-text` routine from `xhtml2latex.xslt` into it's own<br> file (to allow easier modification by users); create alternate version that<br> does not protect certain characters in order to allow raw LaTeX code to be<br> passed through; added `latex-snippet.xslt` stylesheet for inclusion in<br> outside LaTeX template systems; added `xhtml-poetry-support.xslt` and<br> `xhtml-toc.xslt` to demonstrate how to extend MMD functionality for XHTML<br> output with new system; fix bug in SmartyPants that processed typography<br> within `<style>` sections (thanks AmberV); fix handling of links by<br> reference in headers and handling of attributes when links are referenced<br> multiple times (thanks to Edward Nixon); fix bug in epigraphs (thanks<br> etherean); improve id generation for footnotes - e.g. match behavior of PHP<br> Markdown Extra (thanks to Özgür Gökmen); fix bug in id generation for ToC<br> for XHTML documents; fix problem with `\ldots` command (thanks to etherean<br> and James Howison); fix issue with ` ` and tilde character; fix bug<br> where footnote special characters were not unescaped (thanks to Chad<br> Schmidt); clean up documentation a bit;<br><br>* 2.0.b2 - fix processing of footnotes so that ending in a blockquote doesn't<br> break validity; fix bug in `letter.xslt`; overhaul XSLT system to allow for<br> different XSLT files for different output formats (e.g. HTML, RTF, LaTeX);<br><br>* 2.0.b1 - fix bug in `_StripLinkDefinitions` that prevented detection of<br> single character labels; change `\textwidth` to `\linewidth` in LaTeX export<br> XSLT files (let me know if this causes problems); add Windoze compatibility<br> to the perl scripts (thanks to Jason Bandlow for pointing out this problem,<br> as well as for suggesting a fix);fix issues with glossary support and<br> document the process; complete overhaul of the way namespaces are handled<br> (`stripnamespace.pl` is no longer needed, XSLT files are rewritten, `-nonet`<br> and `-novalid` should be optional for xsltproc); update the Drag and Drop<br> applications to use the "Common" MMD Installation; update to Markdown<br> 1.0.2b8 codebase; add support for natbib and `\citep` and `\citet`;<br><br>* 2.0.a2 - fix some minor problems with XSLTMathML; allow math to be enclosed<br> in parentheses; change matching for bottomrule in tables; improve handling<br> of tables with no header row (only a header column);<br><br>* 2.0.a1 - strip spaces from metadata keys for XHTML validity; make XHTML<br> footnote output more compatible with Gruber's website and PHP Markdown<br> Extra; update XSLT to address these changes (*Note*: this breaks<br> compatibility with prior versions); add support for definition lists; fix<br> bug when escaping WikiWords in code; add `XHTML Header` metadata, and update<br> XSLT to ignore `<style>` tags; add support for the `XSLT File` metadata tag,<br> which allows a single command to parse any MultiMarkdown file; add<br> additional XSLT files; add the multimarkdown2XHTML.pl and related commands;<br> article XSLT now uses the article option in memoir, rather than the article<br> class; delete the report class (use memoir instead); fix a **lot** of<br> "minor" bugs; add the "6x9book.xslt" option; allow custom cross-reference<br> labels to headers; give preference to defined links over automatic<br> cross-references; add "poetry" versions of several XSLT files (treat code<br> blocks as formatted text, rather than code --- useful for formatting poetry)<br><br>* 2.0.a - New version numbering scheme; update to Markdown.pl 1.0.2b7 code;<br> add support for `[link reference]` shortcut syntax (i.e. no trailing `[]`)<br> for MultiMarkdown crossrefs; add an extra newline in verbatims to add space<br> before the next paragraph; synchronize numbering schemes of all related<br> MultiMarkdown tools to make it easier to ensure compatibility; add revision<br> numbers to source documents to help track incompatibilities; add LaTeX<br> support for `i.e.` and `e.g.`; TextMate MultiMarkdown bundle available;<br> update MultiMarkdownDragAndDrop tools to new codebase; now distributed as a<br> zipfile.<br><br>* 1.0.1Multi19.4 - major update; fix issue where cross-references to images<br> defined by alt text had to follow the image in the document; add support for<br> MathML via ASCIIMathPHP; change `name` to `id` for footnotes; move<br> _DoHeaders in front of _DoTables to allow cross-references inside tables;<br> fix handling of citations without locator; a table with no header titles and<br> no column alignment row is interpreted as a pull-quote - this is<br> experimental and may be changed; the `Bibliography Title` metadata field is<br> available for LaTeX to rename the bibliography section; multiple changes to<br> XSLT files to improve compatibility; support for `<< math >>` syntax using<br> ASCIIMathPHP; change `HeaderLevel` to `Base Header Level` and process it in<br> XSLT rather than in the OmniOutliner tool; support for `Affiliation`<br> metadata element; add equation label to possible cross-reference list;<br> compatible with epigraph feature for XSLT conversion to LaTeX; document<br> table labeling feature and default to caption if no label present;<br><br>* 1.0.1Multi19.2 - require leading space before unescaping \WikiWord; fixed<br> bug where attributes not included with images; add `Bibliography Title`<br> metadata key; fix bug with invalid leading characters in header id<br> attributes; allow '-' and '_' in metadata; fix handling of citations in<br> footnotes; fix issue with quotes in link attributes.<br><br>* 1.0.1Multi19.1 - minor change to bibliography formatting to allow<br> translation into a \BibTeX compatible format *without* the use of a `.bib`<br> file;<br><br>* 1.0.1Multi19 - Major update; fix bugs discovered by testing with<br> MarkdownTest 1.0; don't add leading blank line if no metadata exists; fix<br> parsing of link definitions, including attribute parsing; various clean- ups<br> to code and documentation; improve cross-reference handling of special<br> characters; fix bug in handling of wiki links (`/` is not automatically<br> added any more); fix bug in `title` attributes of images; re-enable the<br> inclusion of `DOCTYPE` in complete documents (this requires the use of the<br> `-nonet` and `-novalid` options in xsltproc; fix bug in handling of `**`;<br> fix bug where WikiWords in code blocks and spans were not unescaped; fix bug<br> where digits were not allowed in metadata keys; fix numbering of footnotes<br> so that they remain in proper order; add basic citation and bibliography<br> features; major bug fixes and testing to precede the release of version 20<br> (2.0)<br><br>* 1.0.1Multi18 - further work to make WikiWord escaping work properly...<br><br>* 1.0.1Multi17 - add support for "char" alignment in table columns (**NOTE**:<br> browsers do not currently support this); fix bug with `\` in code spans when<br> WikiWords are disabled; fix bug in bold/italic detection<br><br>* 1.0.1Multi16 - can now optionally have header in first cell of each row; fix<br> bug in footnote counting (thanks to Mark Eli Kalderon for pointing this<br> out);<br><br>* 1.0.1Multi15 - allow for multiple `<tbody>` span's within a table; ensure<br> that the variable`$g_empty_element_suffix` is used everywhere; protect code<br> spans from table parsing<br><br>* 1.0.1Multi14 - captions can now be before or after table; add syntax for<br> column spanning within tables (body and header)<br><br>* 1.0.1Multi13 - added support for CSS metadata key; allow no alignment option<br> on table cells; support for captions for tables<br><br>* 1.0.1Multi12 - added support for image/link attributes; fixed bug in table<br> handling<br><br>* 1.0.1Multi11 - added support for table syntax<br><br>* 1.0.1Multi10 - allow emphasis at beginning of line<br><br>* 1.0.1Multi9 - fix bug in metadata parsing<br><br>* 1.0.1Multi8 - first draft of fix for "underscore within a word" problem that<br> causes so many errors with URL's. Now a leading whitespace is required in<br> front of the "opening" `_` or `*` for it to be interpreted as emphasis or<br> strong.<br><br>* 1.0.1Multi7 - add Wiki Links support<br><br>* 1.0.1Multi6 - correct bug in footnote id handling (Thanks to Jonathan Weber<br> for pointing this out)<br><br>* 1.0.1Multi5 - allow disabling of metadata feature<br><br>* 1.0.1Multi4 - convert `©` entities to `©` (compatible with XSLT);<br> generate cross-refs for images<br><br>* 1.0.1Multi3 - fix metadata parsing in the event a key was empty<br><br>* 1.0.1Multi2 - add support for footnotes. **Major** change - no longer use<br> templates, but rather will focus on using XSLT to convert from XHTML output<br> to other formats. I think this will be more flexible and less error prone.<br><br>* 1.0.1M - initial release</ins><span><br> </div> </div> </div> <ul class='notes' id='notes-list'></ul> <div class='js-notes-busy'></div> <div class='js-main-target-form'></div> <script> NoteList.init("1a83a85418315e758e91f1e4ae9fb4413414ef58", "commit", "/MmmmJoel/writing-some-things/notes"); </script> </div> </div> <div class='footer'> <div class='footer-inner clearfix'> <div class='made-in-la'> <p>Penflip is made by <a href="https://twitter.com/madebyloren" target="_blank">Loren Burton</a><br> in Los Angeles, California</p> <div class='footer-share-wrapper'> <a href="https://twitter.com/share" class="twitter-share-button" data-text="Working on a book or writing project? Try Penflip for collaborative writing, version control and publishing" data-url="https://www.penflip.com">Tweet</a> <div class='fb-like' data-href='https://www.penflip.com/' data-layout='button_count' data-send='false' data-show-faces='false' data-width='200'></div> </div> </div> <ul> <h3>About</h3> <li><a href="https://www.penflip.com/penflip/team">Team</a></li> <li><a href="/pricing">Pricing</a></li> <li><a href="http://madebyloren.com/github-for-writers">Our Story</a></li> </ul> <ul> <h3>Quick Start</h3> <li><a href="https://www.penflip.com/Penflip/help/blob/master/writing/Markdown.txt">Markdown</a></li> <li><a href="https://www.penflip.com/Penflip/help/blob/master/getting-started/GeneralOverview.txt">Penflip Basics</a></li> <li><a href="https://www.penflip.com/Penflip/help/blob/master/working-offline/WorkingOffline.txt">Working Offline</a></li> </ul> <ul> <h3>Support</h3> <li><a href="/help">Help</a></li> <li><a href="/penflip/alpha/discussions">Feedback</a></li> <li><a href="/legal">Terms & Privacy</a></li> </ul> <ul> <h3>Connect</h3> <li><a href="mailto:loren@penflip.com">Email</a></li> <li><a href="https://twitter.com/PenflipApp" target="_blank">Twitter</a></li> </ul> </div> </div> <div id='fb-root'></div> <script src='//platform.twitter.com/widgets.js' type='text/javascript'></script> </div> </body> </html>