Re: Latex image and equation references not working in 4.0b (\href and \autoref)

59 views
Skip to first unread message
Message has been deleted

Skrummel

unread,
May 14, 2013, 3:57:50 AM5/14/13
to multim...@googlegroups.com
I poked a bit around the source, and it seems that the \href{}{} comes from the following lines:

if (n->link_data->label == NULL) {
/* This link was specified as [](#bar) */
/* do as told, even if it doesn't make sense */
g_string_append_printf(out, "\\href{%s}{}", n->link_data->source);
} else {
g_string_append_printf(out, "\\autoref{%s}", n->link_data->label); 
}

I am not sure why it needs to do what it is told even if it doesn't make sense :) 
Anyhow, I hacked it to the following: 

if (n->link_data->label == NULL) {
g_string_append_printf(out, "\\autoref{%s}", n->link_data->source + 1); 
}

Which I only recommend as a last resort until this gets sorted.

Kind regards. 

On Tuesday, May 7, 2013 3:28:39 PM UTC+2, Skrummel wrote:
Hi there,

With the new version of Markdown (4.0b) it seems that the Latex references changed from \autoref{labelname} to \href{labelname}{}, which unfortunately is not working properly for me.

The problem arise when I insert a image (or equation) in Markdown using the following:

![Caption][labelname]
[labelname]: path/to/image

And make the reference with [](#labelname).

I use mmd2tex and then pdflatex to compile, this correctly inserts the figure in Latex and also creates a \href{labelname}{}, however in the PDF this reference is not showing up and pdflatex throws the following error:

pdfTeX warning (dest): name{labelname} has been referenced but does not exist,
 replaced by a fixed one

Anyone got any ideas on how to fix this? The same Markdown compiled beautifully under version 3.

Fletcher T. Penney

unread,
May 14, 2013, 1:22:38 PM5/14/13
to Skrummel, multim...@googlegroups.com
That comment is from the HTML source, where it really doesn't make sense to have a link with nothing "inside" it.

I can tweak the latex (and possibly ODF) code.

F-
> --
> You received this message because you are subscribed to the Google Groups "MultiMarkdown Discussion List" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to multimarkdow...@googlegroups.com.
> To post to this group, send email to multim...@googlegroups.com.
> Visit this group at http://groups.google.com/group/multimarkdown?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>


--
Fletcher T. Penney
flet...@fletcherpenney.net

Fletcher T. Penney

unread,
May 14, 2013, 9:20:43 PM5/14/13
to Skrummel, multim...@googlegroups.com
Pushed a commit to github that should fix this, and updated the test suite to reflect the change.


F-

--  
Fletcher T. Penney




Skrummel

unread,
May 15, 2013, 8:20:45 AM5/15/13
to multim...@googlegroups.com
Awesome Fletcher,

The new commit works perfectly.

Thank you.
Reply all
Reply to author
Forward
0 new messages