diff options
-rw-r--r-- | ksh-report-header.el | 25 | ||||
-rw-r--r-- | ksh-report.el (renamed from ksh-biometry.el) | 30 | ||||
-rw-r--r-- | ksh-scan2.el | 4 | ||||
-rw-r--r-- | ksh-scan3.el | 4 |
4 files changed, 32 insertions, 31 deletions
diff --git a/ksh-report-header.el b/ksh-report-header.el deleted file mode 100644 index 0fc912a..0000000 --- a/ksh-report-header.el +++ /dev/null @@ -1,25 +0,0 @@ -(defun latex-use-package (package &optional arguments) - (if arguments - (format "\\usepackage[%s]{%s}" arguments package) - (format "\\usepackage{%s}" package))) - -(defun make-report-header (title) - (seq-do 'ksh-forms-org-keyword - '(("TITLE" . "Kuzhanthai Sanjeevi Hospital") - ("AUTHOR" . "Dr. Serene Isaac, MD, DGO, DNB"))) - (seq-do 'ksh-forms-org-latex-header - (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}"))) diff --git a/ksh-biometry.el b/ksh-report.el index 0e5f1d7..4d6d4e8 100644 --- a/ksh-biometry.el +++ b/ksh-report.el @@ -1,3 +1,5 @@ +(require 'seq) + (defun draw-biometry (param-name param param-age percentile) (let ((temp-script-file (make-temp-script (format "%s %s" param-name param) @@ -39,3 +41,31 @@ (let ((output-pdf (format "%s-crop.pdf" (file-name-sans-extension pdf)))) (shell-command (format "pdfcrop %s %s" pdf output-pdf)) (delete-file pdf) output-pdf)) + +(defun latex-use-package (package &optional arguments) + (if arguments + (format "\\usepackage[%s]{%s}" arguments package) + (format "\\usepackage{%s}" package))) + +(defun make-report-header (title) + (seq-do 'ksh-forms-org-keyword + '(("TITLE" . "Kuzhanthai Sanjeevi Hospital") + ("AUTHOR" . "Dr. Serene Isaac, MD, DGO, DNB"))) + (seq-do 'ksh-forms-org-latex-header + (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}"))) + +(provide 'ksh-report) diff --git a/ksh-scan2.el b/ksh-scan2.el index 0ea63dd..22d8cb9 100644 --- a/ksh-scan2.el +++ b/ksh-scan2.el @@ -1,9 +1,7 @@ ;; -*- lexical-binding: t -*- (require 'ksh-forms) - -(load "ksh-report-header.el") -(load "ksh-biometry.el") +(require 'ksh-report) ;; Datafile path and fields (setq forms-file (expand-file-name "scan2.dat" ksh-data-path)) diff --git a/ksh-scan3.el b/ksh-scan3.el index cb8947e..75389ff 100644 --- a/ksh-scan3.el +++ b/ksh-scan3.el @@ -1,9 +1,7 @@ ;; -*- lexical-binding: t -*- (require 'ksh-forms) - -(load "ksh-report-header.el") -(load "ksh-biometry.el") +(require 'ksh-report) ;; Datafile path and fields (setq forms-file (expand-file-name "scan3.dat" ksh-data-path)) |