summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2020-12-31 13:05:29 +0530
committerArun Isaac2020-12-31 15:07:19 +0530
commit5b430437143e471724c9e6576e01e76ce3c1ed1d (patch)
tree604d422faf7820848d4921ad6ccf2d24fdeb3018
parent08c3f930b7e607fc4d62b10ed8861744e7faed57 (diff)
downloadksh-reports-5b430437143e471724c9e6576e01e76ce3c1ed1d.tar.gz
ksh-reports-5b430437143e471724c9e6576e01e76ce3c1ed1d.tar.lz
ksh-reports-5b430437143e471724c9e6576e01e76ce3c1ed1d.zip
Abstract out latex usepackage statement.
* ksh-report-header.el (latex-use-package): New function. (make-report-header): Use latex-use-package.
-rw-r--r--ksh-report-header.el35
1 files changed, 20 insertions, 15 deletions
diff --git a/ksh-report-header.el b/ksh-report-header.el
index 6194250..1177662 100644
--- a/ksh-report-header.el
+++ b/ksh-report-header.el
@@ -1,20 +1,25 @@
+(defun latex-use-package (package &optional arguments)
+ (if arguments
+ (format "\\usepackage[%s]{%s}" arguments package)
+ (format "\\usepackage{%s}" package)))
+
(defun make-report-header (title)
(org-keywords
'(("TITLE" . "Kuzhanthai Sanjeevi Hospital")
("AUTHOR" . "Dr. Serene Isaac, MD, DGO, DNB")))
(org-latex-headers
- `("\\usepackage{fullpage}"
- "\\usepackage{nopageno}"
- "\\usepackage[ddmmyyyy]{datetime}"
- "\\renewcommand{\\dateseparator}{-}"
- "\\setlength{\\parindent}{0cm}"
- "\\usepackage[tiny]{titlesec}"
- "\\usepackage{wasysym}"
- "\\usepackage{titling}"
- ,(format "\\pretitle{\\hrule \\begin{center} {\\Large \\textbf{%s}} \\par \\small \\sc}" title)
- "\\posttitle{\\par 17, Jawahar Street, Ramavarmapuram, Nagercoil - 629001 \\par \\phone \\, 223374 \\end{center}}"
- "\\preauthor{}"
- "\\postauthor{\\par Obstetrician and Gynaecologist}"
- "\\predate{\\hfill \\textbf{Date: }}"
- "\\date{\\today}"
- "\\postdate{\\vspace{1em} \\hrule \\par}")))
+ (list (latex-use-package "fullpage")
+ (latex-use-package "nopageno")
+ (latex-use-package "datetime" "ddmmyyyy")
+ "\\renewcommand{\\dateseparator}{-}"
+ "\\setlength{\\parindent}{0cm}"
+ (latex-use-package "titlesec" "tiny")
+ (latex-use-package "wasysym")
+ (latex-use-package "titling")
+ ,(format "\\pretitle{\\hrule \\begin{center} {\\Large \\textbf{%s}} \\par \\small \\sc}" title)
+ "\\posttitle{\\par 17, Jawahar Street, Ramavarmapuram, Nagercoil - 629001 \\par \\phone \\, 223374 \\end{center}}"
+ "\\preauthor{}"
+ "\\postauthor{\\par Obstetrician and Gynaecologist}"
+ "\\predate{\\hfill \\textbf{Date: }}"
+ "\\date{\\today}"
+ "\\postdate{\\vspace{1em} \\hrule \\par}")))