WFH tweaks, more options for fic export

This commit is contained in:
trémeur 2023-02-22 18:56:47 +00:00
parent bfd5775927
commit 99b9079131
5 changed files with 77 additions and 48 deletions

View file

@ -61,6 +61,7 @@
(if multichapter
(setq chaptertitles (y-or-n-p "Titled chapters?")))
(setq ffx (y-or-n-p "FFX fic?"))))
(setq draftmode (y-or-n-p "Edit LaTeX file manually?"))
(org-format)
(save-buffer)
(goto-char (point-min))
@ -217,23 +218,25 @@
(replace-match "\\begin{document}\n\\pagestyle{plain}" nil t)))))
(goto-char (point-max))
(save-buffer)
(shell-command
(format "xelatex -interaction=batchmode %s"
(shell-quote-argument (buffer-file-name))))
(shell-command
(format "xelatex -interaction=batchmode %s"
(shell-quote-argument (buffer-file-name))))
(unless draftmode
(shell-command
(format "xelatex -interaction=batchmode %s"
(shell-quote-argument (buffer-file-name))))
(shell-command
(format "xelatex -interaction=batchmode %s"
(shell-quote-argument (buffer-file-name)))))
(kill-current-buffer))
(delete-file "FFXYevon.ttf")
(if (file-exists-p (concat (file-name-base) ".aux"))
(delete-file (concat (file-name-base) ".aux")))
(if (file-exists-p (concat (file-name-base) ".log"))
(delete-file (concat (file-name-base) ".log")))
(if (file-exists-p (concat (file-name-base) ".out"))
(delete-file (concat (file-name-base) ".out")))
(if (file-exists-p (concat (file-name-base) ".toc"))
(delete-file (concat (file-name-base) ".toc")))
(if (file-exists-p "texput.log")
(delete-file "texput.log"))
(delete-file texfile)
(unless draftmode
(delete-file "FFXYevon.ttf")
(if (file-exists-p (concat (file-name-base) ".aux"))
(delete-file (concat (file-name-base) ".aux")))
(if (file-exists-p (concat (file-name-base) ".log"))
(delete-file (concat (file-name-base) ".log")))
(if (file-exists-p (concat (file-name-base) ".out"))
(delete-file (concat (file-name-base) ".out")))
(if (file-exists-p (concat (file-name-base) ".toc"))
(delete-file (concat (file-name-base) ".toc")))
(if (file-exists-p "texput.log")
(delete-file "texput.log"))
(delete-file texfile))
(message "Done"))

View file

@ -11,15 +11,24 @@
(while (re-search-forward "/ " nil t)
(replace-match " /"))
(goto-char (point-min))
(while (re-search-forward " \\.\\.\\." nil t)
(replace-match " "))
(while (re-search-forward "\\.\\.\\." nil t)
(replace-match ""))
(goto-char (point-min))
(while (re-search-forward "" nil t)
(while (re-search-forward "" nil t)
(replace-match " … "))
(goto-char (point-min))
(while (re-search-forward "  …" nil t)
(replace-match " …"))
(goto-char (point-min))
(while (re-search-forward "  +…" nil t)
(replace-match " …"))
(goto-char (point-min))
(while (re-search-forward "'" nil t)
(replace-match ""))
(goto-char (point-min))
(while (re-search-forward " +" nil t)
(replace-match " "))
(goto-char (point-min))
(while (re-search-forward " \n" nil t)
(replace-match "\n"))
(goto-char (point-min))
@ -55,6 +64,10 @@
(interactive)
(org-format)
(goto-char (point-min))
(let ((case-fold-search nil))
(while (re-search-forward "oe" nil t)
(replace-match "œ")))
(goto-char (point-min))
(while (re-search-forward " …" nil t)
(replace-match ""))
(goto-char (point-min))

View file

@ -1,4 +1,9 @@
(load-file "~/Documents/drive/admin/emacs/daysoff.el")
(defcustom workday nil
"Returns true on working days"
:type 'boolean)
(if (equal (format-time-string "%a") "Sat")
(setq workday nil)
(if (equal (format-time-string "%a") "Sun")
@ -6,3 +11,12 @@
(if (member (format-time-string "%Y-%m-%d") daysoff)
(setq workday nil)
(setq workday t))))
(defcustom workhours nil
"Returns true during working hours"
:type 'boolean)
(if workday
(if (< (string-to-number (format-time-string "%H")) 19)
(if (> (string-to-number (format-time-string "%H")) 7)
(setq workhours t))))