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.
@ -27,7 +38,9 @@ Set name and location based on who Im being right now.
#+BEGIN_SRC emacs-lisp
(if (atwork)
(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
* 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
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=:
#+BEGIN_SRC emacs-lisp
@ -506,7 +508,7 @@ Add a couple of classes for LaTeX export.
'("article-std"
"\\documentclass{article}
[NO-DEFAULT-PACKAGES]
\\input{$HOME/.emacs.d/header.tex} %$"
\\input{$HOME/.emacs.d/header.tex} %$\n% latexbib"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%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
(setq org-export-with-author nil)
(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-html-validation-link nil)
(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"))
(progn
(add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/home.org")
(if workday
(if (< (string-to-number (format-time-string "%H")) 19)
(if (> (string-to-number (format-time-string "%H")) 7)
(if workhours
(progn
(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
(add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/personal.org")
(add-to-list 'org-agenda-files "~/Documents/drive/org/calendar/habit.org")))))

@ -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,13 +218,15 @@
(replace-match "\\begin{document}\n\\pagestyle{plain}" nil t)))))
(goto-char (point-max))
(save-buffer)
(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))))
(shell-quote-argument (buffer-file-name)))))
(kill-current-buffer))
(unless draftmode
(delete-file "FFXYevon.ttf")
(if (file-exists-p (concat (file-name-base) ".aux"))
(delete-file (concat (file-name-base) ".aux")))
@ -235,5 +238,5 @@
(delete-file (concat (file-name-base) ".toc")))
(if (file-exists-p "texput.log")
(delete-file "texput.log"))
(delete-file texfile)
(delete-file texfile))
(message "Done"))

@ -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)
(replace-match " … "))
(goto-char (point-min))
(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 " \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))

@ -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))))

@ -1,6 +1,7 @@
# name: latex-bibsetup
# key: latexbib
# --
%
\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

Loading…
Cancel
Save