Add a yasnippet for an org homework header

This commit is contained in:
Adam Goldsmith 2018-01-16 20:47:07 -05:00
parent d63fb671ab
commit 9008ef0138
2 changed files with 22 additions and 1 deletions

View File

@ -176,7 +176,11 @@
(setq org-confirm-babel-evaluate nil)
(add-to-list 'org-babel-load-languages '(dot . t))
(add-to-list 'org-src-lang-modes '("dot" . graphviz-dot)))
(add-to-list 'org-src-lang-modes '("dot" . graphviz-dot))
(defun org-insert-homework-header ()
""
(interactive)
(yas-expand-snippet (yas-lookup-snippet "Homework Header" 'org-mode))))
(use-package windmove
:config

View File

@ -0,0 +1,17 @@
# -*- mode: snippet -*-
# name: Homework Header
# key: hwhead
# --
#+Author: Adam Goldsmith
#+Title: ${1:title}
#+Date: `(format-time-string "%Y-%m-%d")`
#+LaTeX_HEADER: \newcommand{\class}{${2:class}}
#+LATEX_CLASS_OPTIONS: [12pt]
#+OPTIONS: toc:nil num:nil ^:{}
#+LATEX_HEADER: \usepackage[margin=1in, nohead, nofoot]{geometry}
#+LATEX_HEADER: \makeatletter \def\@maketitle{{\noindent\@title} {\hfill\@author\unskip\strut\par} {\noindent\class\unskip\strut} {\hfill\@date\par \vspace{\baselineskip}}\makeatother}
#+LATEX_HEADER: \pagenumbering{gobble}
$0