Emacs Poetry Snippet

| | Comments () | TrackBacks (0)

The following is a snippet for LaTeX mode in Emacs. The snippet uses the wonderful YASnippet package and inserts the date of the poem being written and a tiny bit of LaTeX around it.

;; LaTeX snippets
(yas/define-snippets
  'latex-mode ; Snippet is available when in LaTeX mode
  '(
    ("poem" ; Keyword that will trigger the snippet
     ; The snippet itself
     ; (Each newline can be replaced with \n to make the snippet fit on one line)
     "\\begin{verse}
\\poemtitle{${1:untitled}}
% Written on ${2:$(format-time-string \"%e %B %Y\")}
$0

\\end{verse}
"
     "begin verse ..." ; Name of the snippet
     nil)
  )
)

0 TrackBacks

Listed below are links to blogs that reference this entry: Emacs Poetry Snippet.

TrackBack URL for this entry: http://www.neverfriday.com/cgi-bin/mt/mt-tb.cgi/8

Comments