summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2020-12-31 13:45:36 +0530
committerArun Isaac2020-12-31 15:07:21 +0530
commit79da3ff61ffb5d3c825c37002115639ffdd0789f (patch)
tree571c89ed56c73266658b2af880649e5653d7acc8
parentc986de298d9ae631c5c70bc66aa4c327f38e6c88 (diff)
downloadksh-reports-79da3ff61ffb5d3c825c37002115639ffdd0789f.tar.gz
ksh-reports-79da3ff61ffb5d3c825c37002115639ffdd0789f.tar.lz
ksh-reports-79da3ff61ffb5d3c825c37002115639ffdd0789f.zip
Combine biometry and report into single file.
* ksh-report-header.el, ksh-biometry.el: Combine into ksh-report.el. * ksh-scan2.el, ksh-scan3.el: Require ksh-report instead of loading ksh-report-header.el and ksh-biometry.el.
-rw-r--r--ksh-report-header.el25
-rw-r--r--ksh-report.el (renamed from ksh-biometry.el)30
-rw-r--r--ksh-scan2.el4
-rw-r--r--ksh-scan3.el4
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))