Skip to content

Instantly share code, notes, and snippets.

@promicrobial
promicrobial / pandoc.md2pdf.sublime-build
Last active March 1, 2024 19:33 — forked from keuv-grvl/pandoc.md2pdf.sublime-build
Convert Markdown to PDF within Sublime Text using Pandoc
{
"cmd": ["pandoc --pdf-engine=xelatex --filter=pandoc-citeproc -o '$file_base_name.pdf' '$file_name' && xdg-open '$file_base_name.pdf'"],
"selector": "text.html.markdown",
"shell": true
}
@promicrobial
promicrobial / stop_floating_figures.md
Created July 31, 2024 00:39 — forked from burchill/stop_floating_figures.md
How to make figures and text stay in the order you wrote them in R Markdown when convert to LaTeX!

Keep figures and text in the order you wrote them

Want to keep the order of figures and text the way you wrote them in R Markdown when you convert to LaTeX? Tired of having to insert \FloatBarrier after every chunk you want plotted?

Just use knitr's hooks! Let's look at how we can do it:

Adding the placeins LaTeX package

First, you need to add the placeins LaTeX package to the header of your R Markdown file with \usepackage{placeins}. This lets you use the \FloatBarrier LaTeX command.