|
|
@ -134,10 +134,24 @@
|
|
|
|
(setq texfile (concat (file-name-base) ".tex"))
|
|
|
|
(setq texfile (concat (file-name-base) ".tex"))
|
|
|
|
(find-file-noselect texfile)
|
|
|
|
(find-file-noselect texfile)
|
|
|
|
(with-current-buffer texfile
|
|
|
|
(with-current-buffer texfile
|
|
|
|
(shell-command
|
|
|
|
(if asal
|
|
|
|
(format "pandoc %s -o %s.epub"
|
|
|
|
(progn
|
|
|
|
(shell-quote-argument (buffer-file-name))
|
|
|
|
(goto-char (point-min))
|
|
|
|
(shell-quote-argument (file-name-base))))
|
|
|
|
(search-forward "\\begin{document}")
|
|
|
|
|
|
|
|
(while (re-search-forward "\n" nil t)
|
|
|
|
|
|
|
|
(replace-match "\n\n"))
|
|
|
|
|
|
|
|
(save-buffer)
|
|
|
|
|
|
|
|
(shell-command
|
|
|
|
|
|
|
|
(format "pandoc %s -o %s.epub --epub-cover-image=/home/mdd/Documents/drive/the\\ walk/cover.png"
|
|
|
|
|
|
|
|
(shell-quote-argument (buffer-file-name))
|
|
|
|
|
|
|
|
(shell-quote-argument (file-name-base)))))
|
|
|
|
|
|
|
|
(shell-command
|
|
|
|
|
|
|
|
(format "pandoc %s -o %s.epub"
|
|
|
|
|
|
|
|
(shell-quote-argument (buffer-file-name))
|
|
|
|
|
|
|
|
(shell-quote-argument (file-name-base)))))
|
|
|
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
|
|
|
(while (re-search-forward "label{\\(.*\\)}\n\n" nil t)
|
|
|
|
|
|
|
|
(replace-match "label{\\1}\n"))
|
|
|
|
(goto-char (point-min))
|
|
|
|
(goto-char (point-min))
|
|
|
|
(while (re-search-forward "label{\\(.*\\)}\n\\([A-Z]\\)\\([a-z]*\\)" nil t)
|
|
|
|
(while (re-search-forward "label{\\(.*\\)}\n\\([A-Z]\\)\\([a-z]*\\)" nil t)
|
|
|
|
(replace-match "label{\\1}\n\\\\lettrine{\\2}{\\3}"))
|
|
|
|
(replace-match "label{\\1}\n\\\\lettrine{\\2}{\\3}"))
|
|
|
@ -228,26 +242,26 @@
|
|
|
|
(goto-char (point-max))
|
|
|
|
(goto-char (point-max))
|
|
|
|
(save-buffer)
|
|
|
|
(save-buffer)
|
|
|
|
;; (unless draftmode
|
|
|
|
;; (unless draftmode
|
|
|
|
(shell-command
|
|
|
|
(shell-command
|
|
|
|
(format "xelatex -interaction=batchmode %s"
|
|
|
|
(format "xelatex -interaction=batchmode %s"
|
|
|
|
(shell-quote-argument (buffer-file-name))))
|
|
|
|
(shell-quote-argument (buffer-file-name))))
|
|
|
|
(shell-command
|
|
|
|
(shell-command
|
|
|
|
(format "xelatex -interaction=batchmode %s"
|
|
|
|
(format "xelatex -interaction=batchmode %s"
|
|
|
|
(shell-quote-argument (buffer-file-name))))
|
|
|
|
(shell-quote-argument (buffer-file-name))))
|
|
|
|
;; )
|
|
|
|
;; )
|
|
|
|
(kill-current-buffer))
|
|
|
|
(kill-current-buffer))
|
|
|
|
;; (unless draftmode
|
|
|
|
;; (unless draftmode
|
|
|
|
(delete-file "FFXYevon.ttf")
|
|
|
|
(delete-file "FFXYevon.ttf")
|
|
|
|
(if (file-exists-p (concat (file-name-base) ".aux"))
|
|
|
|
(if (file-exists-p (concat (file-name-base) ".aux"))
|
|
|
|
(delete-file (concat (file-name-base) ".aux")))
|
|
|
|
(delete-file (concat (file-name-base) ".aux")))
|
|
|
|
(if (file-exists-p (concat (file-name-base) ".log"))
|
|
|
|
(if (file-exists-p (concat (file-name-base) ".log"))
|
|
|
|
(delete-file (concat (file-name-base) ".log")))
|
|
|
|
(delete-file (concat (file-name-base) ".log")))
|
|
|
|
(if (file-exists-p (concat (file-name-base) ".out"))
|
|
|
|
(if (file-exists-p (concat (file-name-base) ".out"))
|
|
|
|
(delete-file (concat (file-name-base) ".out")))
|
|
|
|
(delete-file (concat (file-name-base) ".out")))
|
|
|
|
(if (file-exists-p (concat (file-name-base) ".toc"))
|
|
|
|
(if (file-exists-p (concat (file-name-base) ".toc"))
|
|
|
|
(delete-file (concat (file-name-base) ".toc")))
|
|
|
|
(delete-file (concat (file-name-base) ".toc")))
|
|
|
|
(if (file-exists-p "texput.log")
|
|
|
|
(if (file-exists-p "texput.log")
|
|
|
|
(delete-file "texput.log"))
|
|
|
|
(delete-file "texput.log"))
|
|
|
|
(delete-file texfile)
|
|
|
|
(delete-file texfile)
|
|
|
|
;; )
|
|
|
|
;; )
|
|
|
|
(message "Done")))
|
|
|
|
(message "Done")))
|
|
|
|