literals in latex meta-data file

Hi Folks,
I’m using the MMD->Latex compile option, with custom header/begin file/footer options selected. I’m also using a “Meta-Data” file as the first file in the Contents pane of the Compile dialog, in order to load extra meta-data.

I have the following meta-data line:

customfooter: some text \\ \zpageref{LastPage}

I use it to specify draft numbers and other variables that change from compile to compile. In other words, I’d like to change it on the fly, which it why its a variable.

On compile, this line gets converted to:

\def\customfooter{some text \textbackslash{}\textbackslash{} \textbackslash{}zpageref\{LastPage\}}

Is there anyway to avoid the conversion and to keep the field literally the same? I’ve tried enclosing the entire line, as well as the variable alone in , but this doesn’t work. Is there another trick? I can work around this if necessary, but thought I’d ask.

If you’re including a file, why not use MMD’s dedicated “LaTeX Input” meta-data key and specify the filename? The file can be in your compile output folder, or anywhere in your LaTeX path. I put my custom .tex includes into ~/texmf/tex/latex/mmd. In fact, if you compile to plain MultiMarkdown and examine what Scrivener is doing to include your custom tab preamble files, you’ll see a working example.

The reasoning for escaping the special characters in meta-data values though is because these are meant for storing strings, not code. If you want a way around that you’ll have to bring it up on the MMD boards. Scrivener doesn’t touch parsing itself, it just sets up the .mmd file.