fletcher / peg-multimarkdown

An implementation of MultiMarkdown in C, using a PEG grammar - a fork of jgm's peg-markdown. No longer under active development - see MMD 5.
Other
523 stars 55 forks source link

Problem with 'Date:' metadata --> LaTeX #108

Closed hugochisholm closed 12 years ago

hugochisholm commented 12 years ago

I've been having this problem where I'll define the date in the metadata header and it doesn't get passed to my LaTeX file. For example, this MMD file:

latex input:        mmd-article-header
Title:              An analysis of ...
Base Header Level:  2
latex mode:         memoir
Author:             Hugo V. Lachapelle-Chisholm
Date:               11 February, 2012
Comment:            
latex input:        mmd-natbib-plain  
latex input:        mmd-article-begin-doc    
latex footer:       mmd-memoir-footer 

# Testing

Some boring text

...and convert it to .tex then process it in TeXShop 2011, the date on my output .PDF shows today's date, not '11 February, 2012'. It also shows today's date if there is no date, which is the proper function.

Once I realized that I couldn't process any TeX file and have the proper date I started looking into the MMD latex input files. As far as I understand (and I am a new user at this, so I could be wrong), nothing calls '\date' in the input files. I experimented with adding it to the 'mmd-article-begin-doc' and made this change after '\author':

...
\begin{document}

\title{\mytitle}
\author{\myauthor}
\date{\mydate} 

\mainmatter
\maketitle
...

This fixes the problem if a date is defined in the metadata. But if none is defined, it causes the exact problem that user Gnossos mention in Issue #106. To fix this problem I added some code from 'mmd-letterhead-begin-doc' that was probably added to fix this exact problem in letters.

...
\ifx\event\undefined
\else
    \date[\mydate]{\today}
\fi

\ifx\mydate\undefined
    \def\mydate{\today}
\fi

The added code is just the last three lines. This, I've found, solves the problem of LaTeX stumbling if no date is defined in the metadata. If nothing is defined, today's date is used, if something is defined it uses that first.

So I guess I fixed my own problem but I wanted to share it in case it isn't isolated to just me. If this issue with dates isn't a problem for others, it could very well be an issue with my LaTeX installation, but when I saw Gnossos' earlier issue, it was the exact error message I was encountering before I implemented the changes to the mmd lated input files.

fletcher commented 12 years ago

I haven't forgotten about this, but really busy with a bunch of other MMD related things.

hugochisholm commented 12 years ago

No problem. Thanks for the response though. Nice work on MMD :)

fletcher commented 12 years ago

I believe this is fixed now - please reopen if you find issues.