WFH tweaks, more options for fic export

master
trémeur 2 years ago
parent bfd5775927
commit 99b9079131

@ -1,4 +1,15 @@
* Systems * Systems and custom functions
Firstly, tell Emacs where to look for custom functions (via [[https://www.emacswiki.org/emacs/LoadingLispFiles][EmacsWiki]]).
#+BEGIN_SRC emacs-lisp
(defun load-directory (dir)
"Add all files in a directory to load-path"
(let ((load-it (lambda (f)
(load-file (concat (file-name-as-directory dir) f)))))
(mapc load-it (directory-files dir nil "\\.el$"))))
(load-directory "~/.emacs.d/custom/")
#+END_SRC
Define functions that specify what OS Im on, also whether Im at work or not. Then I can implement specific packages according to need/compatibility. Define functions that specify what OS Im on, also whether Im at work or not. Then I can implement specific packages according to need/compatibility.
@ -27,7 +38,9 @@ Set name and location based on who Im being right now.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(if (atwork) (if (atwork)
(load-file "~/Documents/drive/admin/emacs/identity-work.el") (load-file "~/Documents/drive/admin/emacs/identity-work.el")
(load-file "~/Documents/drive/admin/emacs/identity-home.el")) (if workhours
(load-file "~/Documents/drive/admin/emacs/identity-work.el")
(load-file "~/Documents/drive/admin/emacs/identity-home.el")))
#+END_SRC #+END_SRC
* It's not 1986 * It's not 1986
@ -62,17 +75,6 @@ Also suppress certain warnings that would otherwise come up all the time and con
* Miscellaneous changes to make to the basic config * Miscellaneous changes to make to the basic config
Firstly, tell Emacs where to look for custom functions (via [[https://www.emacswiki.org/emacs/LoadingLispFiles][EmacsWiki]]).
#+BEGIN_SRC emacs-lisp
(defun load-directory (dir)
"Add all files in a directory to load-path"
(let ((load-it (lambda (f)
(load-file (concat (file-name-as-directory dir) f)))))
(mapc load-it (directory-files dir nil "\\.el$"))))
(load-directory "~/.emacs.d/custom/")
#+END_SRC
I dont want finding files to be case-sensitive, same as in =zsh=: I dont want finding files to be case-sensitive, same as in =zsh=:
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -506,7 +508,7 @@ Add a couple of classes for LaTeX export.
'("article-std" '("article-std"
"\\documentclass{article} "\\documentclass{article}
[NO-DEFAULT-PACKAGES] [NO-DEFAULT-PACKAGES]
\\input{$HOME/.emacs.d/header.tex} %$" \\input{$HOME/.emacs.d/header.tex} %$\n% latexbib"
("\\section{%s}" . "\\section*{%s}") ("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}"))) ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
@ -536,7 +538,11 @@ Settings for export, mostly for DW post previews but also fic?? And work I guess
(progn (progn
(setq org-export-with-author nil) (setq org-export-with-author nil)
(setq org-latex-default-class "article-std")) (setq org-latex-default-class "article-std"))
(setq org-latex-default-class "memoir")) (if workhours
(progn
(setq org-export-with-author nil)
(setq org-latex-default-class "article-std"))
(setq org-latex-default-class "memoir")))
(setq org-latex-compiler "xelatex") (setq org-latex-compiler "xelatex")
(setq org-html-validation-link nil) (setq org-html-validation-link nil)
(setq org-html-doctype "html5") (setq org-html-doctype "html5")
@ -655,18 +661,10 @@ Set the files to be included.
(add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/acwri.org")) (add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/acwri.org"))
(progn (progn
(add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/home.org") (add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/home.org")
(if workday (if workhours
(if (< (string-to-number (format-time-string "%H")) 19) (progn
(if (> (string-to-number (format-time-string "%H")) 7) (add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/work.org")
(progn (add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/acwri.org"))
(add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/work.org")
(add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/acwri.org"))
(progn
(add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/personal.org")
(add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/habit.org")))
(progn
(add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/personal.org")
(add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/habit.org")))
(progn (progn
(add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/personal.org") (add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/personal.org")
(add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/habit.org"))))) (add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/habit.org")))))

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

@ -11,15 +11,24 @@
(while (re-search-forward "/ " nil t) (while (re-search-forward "/ " nil t)
(replace-match " /")) (replace-match " /"))
(goto-char (point-min)) (goto-char (point-min))
(while (re-search-forward " \\.\\.\\." nil t) (while (re-search-forward "\\.\\.\\." nil t)
(replace-match "")) (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)) (goto-char (point-min))
(while (re-search-forward "" nil t) (while (re-search-forward "  +" nil t)
(replace-match " …")) (replace-match " …"))
(goto-char (point-min)) (goto-char (point-min))
(while (re-search-forward "'" nil t) (while (re-search-forward "'" nil t)
(replace-match "")) (replace-match ""))
(goto-char (point-min)) (goto-char (point-min))
(while (re-search-forward " +" nil t)
(replace-match " "))
(goto-char (point-min))
(while (re-search-forward " \n" nil t) (while (re-search-forward " \n" nil t)
(replace-match "\n")) (replace-match "\n"))
(goto-char (point-min)) (goto-char (point-min))
@ -55,6 +64,10 @@
(interactive) (interactive)
(org-format) (org-format)
(goto-char (point-min)) (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) (while (re-search-forward " …" nil t)
(replace-match "")) (replace-match ""))
(goto-char (point-min)) (goto-char (point-min))

@ -1,4 +1,9 @@
(load-file "~/Documents/drive/admin/emacs/daysoff.el") (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") (if (equal (format-time-string "%a") "Sat")
(setq workday nil) (setq workday nil)
(if (equal (format-time-string "%a") "Sun") (if (equal (format-time-string "%a") "Sun")
@ -6,3 +11,12 @@
(if (member (format-time-string "%Y-%m-%d") daysoff) (if (member (format-time-string "%Y-%m-%d") daysoff)
(setq workday nil) (setq workday nil)
(setq workday t)))) (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))))

@ -1,6 +1,7 @@
# name: latex-bibsetup # name: latex-bibsetup
# key: latexbib # key: latexbib
# -- # --
%
\usepackage[style=authoryear-ibid,alldates=long,giveninits=true,dashed=false,labeldate=year,mergedate=maximum,maxbibnames=10,ibidpage=true,uniquename=false]{biblatex} \usepackage[style=authoryear-ibid,alldates=long,giveninits=true,dashed=false,labeldate=year,mergedate=maximum,maxbibnames=10,ibidpage=true,uniquename=false]{biblatex}
\renewbibmacro*{volume+number+eid}{ % puts issue number in brackets \renewbibmacro*{volume+number+eid}{ % puts issue number in brackets

Loading…
Cancel
Save