Cannot typset exported file

I am failing miserably to get this to work.

I have downloaded all the MMD files in the last few days.

I have a simple file exported

\input{mmd-memoir-header}
\def\mytitle{Test project}
\def\myauthor{Graham Smith}
\def\latexmode{memoir}
\input{mmd-memoir-begin-doc}
\def\format{complete}
\chapter{Test paragraph with some text}
\label{testparagraphwithsometext}

\chapter{Heading}
\label{heading}

Test paragraph with some text

\textbf{Testbold} \emph{test italic}

-Bullet list 1
-Bullet list 2
-Bullet list 3

\begin{enumerate}
\item Numbered list
-Sub numbered point
-Sub numbered point 2

\item Numbered list 2

\item Number list 3

\end{enumerate}

\begin{quote}

Block quote is given
\end{quote}

This is final sentence


Trying to typset in Textmate gives me 480+ errors (the first few are below) which seem to relate to the mmd-memoir-header.tex rather than my file, can anyone suggest what I am doing wrong.

I have followed Huw Evans guide in terms of setting up the meta data.

Many thanks

Graham

Processing: ./Scrivtest.tex
Processing: ./mmd-memoir-header.tex
Latex Error: ./mmd-memoir-header.tex:4 LaTeX Error: Missing \begin{document}.

Latex Error: ./mmd-memoir-header.tex:6 You can’t use `macro parameter character #’ in horizontal mode.

Latex Error: ./mmd-memoir-header.tex:6 You can’t use `macro parameter character #’ in horizontal mode.

Latex Error: ./mmd-memoir-header.tex:6 You can’t use `macro parameter character #’ in horizontal mode.

Latex Error: ./mmd-memoir-header.tex:17 LaTeX Error: Missing \begin{document}.

Latex Error: ./mmd-memoir-header.tex:17 Missing $ inserted.

Latex Error: ./mmd-memoir-header.tex:19 Missing $ inserted.

Latex Error: ./mmd-memoir-header.tex:20 LaTeX Error: Missing \begin{document}.

Latex Error: ./mmd-memoir-header.tex:24 LaTeX Error: Missing \begin{document}.

Latex Error: ./mmd-memoir-header.tex:28 LaTeX Error: Missing \begin{document}.

Latex Error: ./mmd-memoir-header.tex:33 Missing $ inserted.

Latex Error: ./mmd-memoir-header.tex:35 Missing $ inserted.

Just to add to this, if I strip out all the Scrivener/MMD preamble and use a standard latex preamble and add an end{document} this compiles fine.

So all the Latex code is fine, its the Scrivener/MMD specific stuff that I cannot get to work.

As a possible relevant aside, although I have installed the mmd extras, I can’t see them in ~Library, is there somewhere else they might be?

Graham

When I make a tex file from your code and typeset it works, (although with the addition of an \end{document}).

That suggests the issue is with the mmd installation, and that there’s something missing.

Once you’ve installed MMD 3 itself there are two other thing you need to do:

First, download and run the MultiMarkdown-Support-Mac installer: that puts in all the behind-the-scenes stuff which gets the process flowing right. (From your post, I think you’ve probably done that.)

Then there are the MultiMarkdown Latex files, which need to be downloaded and manually put in ~/Library/texmf/tex/latex/mmd.

mmdfiles.png
I think this may be the part you are missing.

Depending on your Tex set up, you may have to create the whole Russian-doll nesting of files yourself. (It took me months to work that out.)

Thank you MrGruff.

I didn’t have a directory structure starting texmf in library, so I copied the MMD folder into

Library/Tex/local/tex/latex/mmd

and

Library/Tex/root/texmf/tex/latex/mmd

Hoping this would work but it didn’t

I have now created a new directory just to hold the mmd files

Library/texmf/tex/latex/mmd

and run texhash from terminal (not sure if I need to do this but it seemed sensible)

It now gives me an \end{document} that wasn’t there before, but I still get an error of missing \begin{document} when I try to typset with Tex.

I’m still puzzled by the support files. I have now run this three times, but I cannot find any installed files, so this may still be the source of the error.

Actually, while I would like to get this working, given the markdown code seems to getting translated properly, I don’t mind manually adding an appropriate preamble to the file, but of course would rather get it working as it should.

Thanks for your help.

Graham

Incidentally, the way LaTeX works, if the file you \input is in the same folder as the .tex, then it will use that file in precedence over any stuff in your texmf folder. So as a temporary experiment, you could try putting the necessary boilerplates into the output folder where your .tex document is, and see if that works. That would reduce one level of complexity. If it works, then you know it is something wrong with the texmf folder; or perhaps file permissions in it.

Thanks, in fact I have already tried that, and I get the same errors, but I just tried it again and it still isn’t working.

I still don’t understand why I can’t find support files anywhere, even though they seem to have installed. So I am assuming that its something to do with this at the moment, but at a loss what to do.

Graham

Okay, some minor things that are likely unrelated but should be fixed:

  • Your bullets look off in the source file. You need a space after the list indicator. So [b]- Bullet line 1[/b].
  • Un-check “Add ‘Format: complete’ at end of meta-data” in the compile pane. That is for MMD2.

When you compile using “MultiMarkdown” instead of going straight to LaTeX, what does your meta-data block look like? It should look a bit like this:

LaTeX Input: mmd-memoir-header Title: Test Project Author: Graham Smith Base Header Level: 2 LaTeX Input: mmd-memoir-begin-doc LaTeX Footer: mmd-memoir-footer

The order of these are important, as is the presence of all three LaTeX control file markers.

If I set up a simple test project with that meta-data (you can copy and paste that block into Scrivener’s compile meta-data pane to translate it into the table), export to .tex and then render, I get a PDF with no errors and only a few minor warnings.

By the way here is how a mixed list type case should be:

[code]- Bullet line 1

  • Bullet line 2
  • Bullet line 3
    1. Sub numbered point
    2. Sub numbered point 2[/code]

Thanks again, the bullet points I had fixed as I am playing with the same file in MMDComposer and Textmate. Mainly to check that there is nothing actually wrong with the MMD file.

Compiling as MMD gives

LaTex Input: mmd-memoir-begin-doc Title: Test project Author: Graham Smith Base Header Level: 2 Latex input: mmd-memoir-header Latex footer: mmd-memoir-footer

Even though this isn’t the order they have been put into Scrivener.

Manually changing the order to match your example (in the compiled tex file) Still gives me the same errors when I try to typeset the tex file. 603 errors according to TextMate !!

So I am still struggling here.

Graham

The shuffle bug could potentially the problem as the preamble could be getting all mixed up. You could either try the current beta, or create a document called “Meta-Data” in your draft so that it appears at the very top of the compile contents, and paste the proper meta-data into it. Remove any lines from the compile pane.

Unfortunately, I am ahead of you on this and the 603 errors mentioned in my last post were after I had done as you suggested above.

One of the strange things is that the errors seem to refer to the mmd-memoir-header.tex file e.g.

Processing: ./Scrivtest1.tex
Latex Error: /usr/local/texlive/2011/texmf/tex/latex/mmd/mmd-memoir-header.tex:4 LaTeX Error: Missing \begin{document}.

When I click on go to error that is where I get taken the line in mmd-memoir-header.text e.g.

[code]

...[/code]

Graham

Just to add I have now found and confirmed (with help from the MMD forum) that MMD and the MMD supplementary files are installed.

Graham

Well, that definitely doesn’t look right, and yes that would cause TeX to blow up! These should all just be normal .tex files (or pieces of what would be a .tex file). There shouldn’t be any HTML in them. How did you download these? As a .zip file from GitHub, or one at a time?

That file is very simple, it should only contain:

[code]%
% Configure LaTeX to produce a PDF “book” using the memoir class
%

\documentclass[10pt,oneside]{memoir}

\input{mmd-memoir-setup}
[/code]

Well, I have no idea what is going on here, I have made no changes since last night, TexShop was still sitting on my desktop with the file from last night.

I shut down the error window which I had left open last night, and just before shutting down TexShop, I thought I might as well hit typeset one last time, and it worked !!!

I wish I knew why :frowning:

But it still won’t typeset in Textmate, it is still trying to run that same file that looks like an HTML file. Now that I know that it “will” work. I will work away on my own for a bit and

However, thank you both for your help let’s hope I can sort out the Textmate problem.

Graham

P.S. I downloaded the files one at a time - I couldn’t see a zip file.

OK for the benefit of others, I will admit to having tried so many things I got myself confused, and my last email was totally wrong.

I have now removed all the mmd files that I had downloaded individually, and downloaded the zipped package. I have unzipped them and placed them where suggested earlier (~Library/texmf/tex/latex/mmd), which didn’t seem to work.

I have now put them in

~Library/Tex/Root/texmf/tex/latex/mmd and ran texhash

Everything is now working.

Thanks again.

Graham

Very glad to hear it is now working. (I wonder if you some how got the HTML files that are related to the download rather than the .tex files: I’ve certainly done that before now.)

When I revise the beginner’s guide I’m going to try to make that zip file download more obvious - I may need to go as far as a screen shot.

Thanks MrGruff, the zip download option is rather subtle on github, if you aren’t familiar with it, so I think this would be a god idea.

Graham

Yeah, I agree a screenshot would help. That download button is very easy to miss, even if you are looking for it.