Skip to content

Instantly share code, notes, and snippets.

(defn hey [x]
x)
(defn transform-node [node f]
(case (.-nodeName node)
("P" "DIV") (str "\n" (f) "\n")
("SPAN") (str " " (f) " ")
("A") (f)
("I" "EM" "B" "U") (str " \\emph{" (f) "} ")
("BR") "\n"
; else
(do (warn! (.-nodeName node))
(defn space-in-emph [[match g1 g2]]
(let [l (if (= " " g2) "" g2)]
(str "{" g1 l "}")))
(defn footnote [[match g1]]
(if (#{"..." "…"} g1)
" \\el "
(str "\\footnote{" g1 "}")))
(defn final-clean [txt]
% XeLaTeX can use any Mac OS X font. See the setromanfont command below.
% Input to XeLaTeX is full Unicode, so Unicode characters can be typed directly into the source.
% The next lines tell TeXShop to typeset with xelatex, and to open and save the source with Unicode encoding.
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass[11pt,openany,showtrims]{memoir} %showtrims removed for final PDF
\usepackage{graphicx}