Skip to content

Instantly share code, notes, and snippets.

@promicrobial
promicrobial / zotero-return-home.js
Last active November 18, 2024 20:07
Assigning this code to a keybinding e.g. using the Actions & Tags plugin will allow you to return to the main "My Library" collection when browsing a subcollection or reading a pdf (even if you were previously in a subcollection).
const Zotero = require("Zotero");
const Zotero_Tabs = require("Zotero_Tabs");
if (Zotero_Tabs.selectedID != 'zotero-pane') {
Zotero_Tabs.select('zotero-pane')
}
Zotero.getActiveZoteroPane().collectionsView.selectLibrary(Zotero.Libraries.userLibraryID)
@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.

@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
}