Images difficulty

I am having trouble getting images out in pdf. I tried to mimic the sample mmd doc, no luck. I just see my markup itself, not the figure.

What do the elements below do? Do I have to put in 3 separate entries to include a figure?

As an example, here is an image from my website---[Nautilus Star](#nautilusstar).  If you have a local copy of the image, you can include the image in a pdf.

![Nautilus Star][]

[Nautilus Star]: Nautilus_Star "Nautilus Star" width=307px height=250px

Thanks - Sophie

Do you try to create the PDF by doing the ‘File -> print -> save as pdf’ option?

If so, that won’t work with the above example. You could instead try to drag and drop your image into the right place. This works for images in your research folder and I think (but not entirely sure about it) for images you drag and drop from the finder.

For the above example to work you need to use ‘File -> Compile Draft’ and then choose ‘MultiMarkdown -> LaTeX’. After that, you need to build the PDF from the LaTeX-file.

This last option means you have to type your draft in MultiMarkdown (very easy) and do some extra work with LaTeX (not very hard, but takes a bit of reading through FAQ’s and all).

Which one did you use?

Tanja

All of the above syntax is explained on the MultiMarkdown web site, in the User’s Guide.

I highly encourage you to start by learning how regular Markdown works, and then learn the additional features in MultiMarkdown.

I used File->Compile Draft, but must have done something wrong. I can now get my document to work with a Png graphic. EPS fails with a Latex error (unknown graphics type) when typesetting, but PDF for the graphic seems to work.

So, thats progress. Folks here have been very helpful, but I must admit am really nervous about this setup and my learning curve, based on the amount of time I’ve invested in it so far … My target is a book, and I don’t know how indexes will work, am unsure how to mark some bits of my document semantically as “warning” or “note” or “principle” or anything else (easy to mark in scrivener, just really hard to get that info to influence the produced output), …

:neutral_face: Sophie

http://www.tex.ac.uk/cgi-bin/texfaq2html?label=pdftexgraphics

I think the easiest way to influence your output based on keywords is to use a keyword in the title of a document. You can evaluate titles in an XSLT file (the XPath function contains(string1,string2) might come handy) and change the output accordingly. Alternatively, you could write a script to process the “metadata” in an MMD file. Scrivener does already allow to export notes, synopsis, metadata and keywords, you just have to tag them in a way that the data can be reused at the XSL stage.

I did look, and honestly cannot figure out why it takes 3 entries to produce one figure + one cross-reference to it. Shouldn’t 2 be sufficient (in fact, ideally, couldn’t it be just 1 for the most common usage)?

And none of the 3 corresponds to Markdown syntax, as far as I can tell.

As an example, here is an image from my website---[Nautilus Star](#nautilusstar).  If you have a local copy of the image, you can include the image in a pdf.

![Nautilus Star][]

[Nautilus Star]: Nautilus_Star "Nautilus Star" width=307px height=250px

I’m trying. Very :neutral_face: I mean, really … Sophie

Thanks, I will give that a try.

Sophie

As an example, here is an image from my website---[Nautilus Star](#nautilusstar). If you have a local copy of the image, you can include the image in a pdf.

This is a standard Markdown link.

![Nautilus Star][]

This is a standard Markdown image by reference.

[Nautilus Star]: Nautilus_Star "Nautilus Star" width=307px height=250px

This is a standard Markdown defined image reference, with the addition of MultiMarkdown attributes (e.g. width, height).

So, it’s all standard Markdown, with the exception of the width and height. The only thing that’s different is that Scrivener knows that the “url” Nautilus_Star is an image in the Research section (of the MMD sample Scrivener document). Since there is an image that matches, that image is exported by Scrivener when you export. It could just as easily have been a url that referenced an image on the web, e.g. [b]http://some.com/image.png[/b].

What is #nautilusstar? I don’t see it anywhere else as a target of a cross-reference. Is one of the other “Nautilus Star” being silently converted into #nautilusstar? If so, may I suggest making it a bit less confusing by to a newbie – just use “nautilus_star” except where a display string is being defined? Or is this something MD/MMD do uniformly in many places?

To a markdown newbie just wanting to include an image, this seems redundant. Is it necessary? Is there any way to just do a single additional image definition, or might it make sense to consider that option? e.g.

![nautilus_star]: Nautilus_Star “Nautilus Star” width=307px height=250px

Many thanks — Sophie

It would be awesome if you could add some more optional attributes (as in ‘landscape’, ‘nofloat’, ‘inline’, etc.) to this in a future version of MMD. :smiley:

Again - this is all in the instructions:

fletcherpenney.net/multimarkdown … references

Again, in the Markdown instructions, it explains how to do inline and reference based images.

I am really not trying to come across as a jackass - but it seems as though you are having trouble with the subtleties of MD/MMD because you haven’t learned the basics. MultiMarkdown can be quite powerful if you’re willing to invest some time in XSLT. But first, you need to understand the basic syntax. Rather than trying to learn everything at once, become familiar with each feature on it’s own, and then it’s easy to see how to combine them.

MMD doesn’t care what attributes you use.

You are right, I’ll do that. Thanks – Sophie

What clever design! 8)

Having gone through a good chunk of this learning curve over the last few months, I am clear that MMD is a very powerful tool - and I am currently using it with Scrivener to produce a 100+ page software manual.

However, I do recall that it took a long time to work out exactly what was going on with the image link in the sample document: might it easier for the newcomer to understand the syntax if the sample document used ‘image name’ and ‘caption’, rather than have multiple references to ‘nautilus star’, one of which represents a file, one a cross reference and one a caption?

MrGruff

What seems to be confusing people is all basic Markdown syntax. If you compare the MMD source with the XHTML output, it’s fairly transparent as to what’s going on.

But if someone wants to write up a more detailed explanation for the FAQ - please feel free to email it to me and I’ll post it.

But again, with the exception of attributes, images work the exact same way in MMD that they do in MD. Which is why I always say to learn how to work with Markdown before trying to learn MMD…

F

I agree, the example could be simplified for a newbie. That zip file with the scrivener source, tex file, and pdf is invaluable, a bit of simplification would make it even more so.

I am currently just doing two things that work, and will not even try to figure out the others unless someone tells me I am doing something wrong.

To insert a reference to an image in my text:

As shown in [][#the_image_key], you can see that the part of the fish that …

To include the image itself:

#the_image_key

This was the gist of my “why does it take 3 entries” question.

  • Sophie

Great!! I’m sure I can learn from you as well.

How are you doing the index?

Did you build a glossary as an appendix? How did you include it?

Did you already know Latex? Needed to learn about it?

Thanks - Sophie

Well, I think I may only be a little way ahead of you on this learning curve.

I started at Latex from scratch because I wanted to get away from formatting large documents in Word-like ways. Mark-up as a concept hasn’t been a problem (I used something similar to Latex on main-frames back in the eighties), but what I have found is that there are an awful lot of things to sort out at once as you put together the Scriviner-MMD-Latex production line, and the information required is scattered in various sources. On the Latex side I seem to have stumbled into the crack between the ‘this is how you type’ document and the ‘define your own package’: what’s missing is the guide to ‘tricky but doable’.

Most of it is working now (although I’m hoping this document won’t have a glossary!) but I still have to do a lot of tweaking to the Latex file before typesetting (e.g. XeLatex doesn’t like the hyperref package – my fault for choosing it and not swapping XSLT file to match - I think I ran out of bravery). Once I’m feeling more confident I’ll have a look at changing/adjusting the XSLT file to tackle that sort of thing.

MrGruff

I use

\usepackage[xetex]{hyperref} 

in my .tex files and it works as expected. Maybe your hyperref package is too old? MacTeX 2007 (we have MacTeX 2008 now) came with a lot of packages that weren’t recent enough to work with XeTeX (e.g. hyperref, tex4ht, beamer, pgf…)