Skip to content

Instantly share code, notes, and snippets.

View bjmorgan's full-sized avatar
:atom:
Crunching numbers

Benjamin Morgan bjmorgan

:atom:
Crunching numbers
View GitHub Profile
@bjmorgan
bjmorgan / table.latex.sublime-snippet
Created December 21, 2012 18:16
Sublime Text 2 snippet for inserting a `table` environment, triggered by `"table"+tab`
<snippet>
<content><![CDATA[\begin{table}[htb]
\begin{center}
\begin{tabular}{$3}
$0 \\\\
\end{tabular}
\caption{\label{tab:${1:label}}${2:CAPTION}}
\end{center}
\end{table}
@bjmorgan
bjmorgan / Default (OSX).sublime.keymap
Last active December 10, 2015 00:48
Sublime Text plugin for LaTeX that lists a choice of `.eps` files in the directory defined in `\graphicspath{<DIRECTORY>}`, and after the user selecting one inserts boilerplate figure code. If `\graphicspath` is missing, or the line is commented out, the plugin will look for .eps files in the root directory of the `.tex` file.
[
// Run LaTeX plugin to insert figure code
{
"keys": ["super+l", "super+f"],
"command": "insert_latex_figure",
"context": [
{ "key": "selector", "operator": "equal", "operand": "text.tex.latex" }
]
}
]
@bjmorgan
bjmorgan / Bibtex.sublime-build
Created December 20, 2012 23:30 — forked from dpo/BibTeX.sublime-build
Build files, keymap entries, and `run_latex_build.py` plugin for adding the option for running bibtex and cleaning up auxiliary files for LaTeX in Sublime Text 2. Added the ability to run bibtex, and changed key bindings.
{
"cmd": ["bibtex", "$file_base_name"],
"path": "$PATH:/usr/texbin:/usr/local/bin",
"file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)",
"selector": "text.tex.latex"
}
@bjmorgan
bjmorgan / gist:4344886
Created December 20, 2012 11:56
A Ruby TextExpander snippet that takes data copied to the clipboard from Numbers and pastes LaTeX source for a table environment. Discussed here: http://analysisandsynthesis.com/utilities/2012/12/20/quick-latex-tables-using-textexpander.html
#!/usr/local/bin/ruby
class Line
@@max_length = nil
@@eol = ' \\\\'
def initialize( data )
@contents = data
@@max_length = [0]*@contents.size if @@max_length.nil? # initialize array if this is the first Line instance