fletcher / MultiMarkdown-4

This project is now deprecated. Please use MultiMarkdown-6 instead!
https://github.com/fletcher/MultiMarkdown-5
Other
307 stars 59 forks source link

LaTeX escaping hyphens #65

Closed krontzo closed 10 years ago

krontzo commented 10 years ago

Setting the beamer theme such as:

Theme:              keynote-gradient

Produces an error, given that multimarkdown is replacing all hyphens '-' with '-{}' in all LaTeX modes:

! LaTeX Error: File `beamerthemekeynote-{}gradient.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 

I don't remember why it is useful to replace '-' in LaTeX; but it shouldn't be replaced in the metadata header.

I commented the code in latex.c to avoid this, but I am not sure if it is the proper way to handle this bug.

krontzo commented 10 years ago

Thank you very much!

fletcher commented 10 years ago

FYI, the problem is that --- gets converted to en/em dashes in code blocks unless hyphens are escaped...

vanto commented 9 years ago

Thanks for the explanation. Since LaTeX does not want to hyphenate words that already contain a hyphen, have you considered requiring the hyphenat-package and replacing such hyphens by \hyp? See here, page 3. Cf http://www.tex.ac.uk/cgi-bin/texfaq2html?label=nohyph -- This would make the generated LaTeX appearing much nicer in justified typesetting and would require less manual work after the generation.

Babel also provides a shorthand for this kind of hyphens, "= will add a hyphen but also tells LaTeX to apply the normal hyphenation rules to the rest of the word.

fletcher commented 9 years ago

I'm not sure about this. I'm always hesitant to add things that require yet another package to be installed, and I'm not sure how applicable this is across users.

This can, of course, be implemented by anyone who wants to use it for themselves. That's the beauty of open-source.

vanto commented 9 years ago

I see, thanks. I thought the generated LaTeX would use Babel to support non-english typesetting. Since this is not the case the change would indeed impose some impact.

This can, of course, be implemented by anyone who wants to use it for themselves. That's the beauty of open-source.

True, but in this case this means forking and recompiling. Or are there extension points that I didn't see for that?

fletcher commented 9 years ago

That's what open source means. You can fork/recompile/share.

Just because I don't think a particular change makes sense (at least not now) doesn't mean you can't have it.