timtylin / scholdoc

Fork of Pandoc for the implementation of a ScholarlyMarkdown parser
scholdoc.scholarlymarkdown.com
GNU General Public License v2.0
335 stars 16 forks source link

Force Figure Position in Scholarly Markdown? #11

Closed dnguyen85 closed 9 years ago

dnguyen85 commented 9 years ago

Hi, I was wondering if there is a syntax in Scholarly Markdown to force a figure position (for pdf and tex outputs). Such syntax should ideally attach placement properties (htbp, etc.) to the figure float environment.

Is this supported in the current scholdoc?

Thanks, Dan

timtylin commented 9 years ago

Hi Dan! Thanks for your interest in Scholdoc.

The current default for LaTeX is to use htbp placement. This is specified in the default Scholdoc latex template using the floatplacement command from the float package

\floatplacement{figure}{htbp}

To over-ride this, note that the default latex template has a bunch of places where you can inject your own latex commands (via special variables) without having to use a new template. The most useful is probably the latex-header-includes variable which is immediately before \begin{document}.

To change figure placement to, say, tbp, you can add the following to your YAML metadata block in your scholdoc markdown document

---
latex-header-includes:
  - \floatplacement{figure}{tbp}
---

Hope that helps.

Tim

dnguyen85 commented 9 years ago

Hi Tim, that is extremely helpful. Thank you so much for your effort in developing and maintaining such a great authoring tool as scholdoc. Your answer above gives me some clear instructions on how to customize the latex output I want. I recently adopt scholdoc for some writing assignments and must say it takes away all the pains in using pandoc.

Best Regards, Dan