From 64d6179e0dd552471603f0864a05c312b56ac16c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tr=C3=A9meur?= Date: Fri, 17 Feb 2023 13:51:21 +0000 Subject: [PATCH] Add LaTeX export settings for work --- .gitignore | 1 + config.org | 44 +++++++++++++++++++++++++------------- header.tex | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+), 15 deletions(-) create mode 100644 header.tex diff --git a/.gitignore b/.gitignore index d4afd0d..8d8cec6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ \#* +auto/* auto-save-list/* backups/* bookmarks diff --git a/config.org b/config.org index 97ee3e2..c7db0af 100644 --- a/config.org +++ b/config.org @@ -505,20 +505,29 @@ In =emacs27= and above, I can set certain headlines not to be exported. I haven Add the =memoir= class for LaTeX export. #+BEGIN_SRC emacs-lisp - (unless (version< emacs-version "27") - (add-to-list 'org-latex-classes - '("memoir" - "\\documentclass[9pt,b6paper]{memoir} - [NO-DEFAULT-PACKAGES] - \\usepackage[namechapters]{optional} - \\input{$HOME/.emacs.d/fic-export-files/header.tex} %$" - ("\\chapter{%s}" . "\\chapter*{%s}") - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) -#+END_SRC - -Settings for export, mostly for DW post previews but also fic?? +(if (version< emacs-version "27") +(with-eval-after-load 'ox-latex +(add-to-list 'org-latex-classes +'("article-std" +"\\documentclass{article} +[NO-DEFAULT-PACKAGES] +\\input{$HOME/.emacs.d/header.tex} %$" +("\\section{%s}" . "\\section*{%s}") +("\\subsection{%s}" . "\\subsection*{%s}") +("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) +(add-to-list 'org-latex-classes +'("memoir" +"\\documentclass[9pt,b6paper]{memoir} +[NO-DEFAULT-PACKAGES] +\\usepackage[namechapters]{optional} +\\input{$HOME/.emacs.d/fic-export-files/header.tex} %$" +("\\chapter{%s}" . "\\chapter*{%s}") +("\\section{%s}" . "\\section*{%s}") +("\\subsection{%s}" . "\\subsection*{%s}") +("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) +#+END_SRC + +Settings for export, mostly for DW post previews but also fic?? And work I guess, I do that sometimes. #+BEGIN_SRC emacs-lisp (setq org-export-headline-levels 6) @@ -528,7 +537,12 @@ Settings for export, mostly for DW post previews but also fic?? (setq org-export-with-creator nil) (setq org-export-with-toc nil) (setq org-export-time-stamp-file nil) - (setq org-latex-default-class "memoir") + (if (atwork) + (progn + (setq org-export-with-author nil) + (setq org-latex-default-class "article-std")) + (unless (version< emacs-version "27") + (setq org-latex-default-class "memoir"))) (setq org-latex-compiler "xelatex") (setq org-html-validation-link nil) (setq org-html-doctype "html5") diff --git a/header.tex b/header.tex new file mode 100644 index 0000000..e8bb6d9 --- /dev/null +++ b/header.tex @@ -0,0 +1,62 @@ +% Dimensions +\usepackage{geometry} +\geometry{a4paper} + +% Text spacing +\usepackage{microtype} +% \setlength{\parindent}{0em} +% \setlength{\parskip}{1em} +\emergencystretch 3em +\usepackage{setspace} +% \doublespacing +\usepackage[bottom]{footmisc} + +% Tables +\usepackage{float} +\usepackage{tablefootnote} +\usepackage{makecell} +\renewcommand{\cellalign}{cl} +\usepackage{etoolbox} +\AtBeginEnvironment{tabular}{\doublespacing} +\usepackage{array} +\usepackage{booktabs} + +% Links and URLs +\usepackage[hyphens]{url} +\usepackage[hidelinks]{hyperref} +\urlstyle{tt} + +% Fonts +\usepackage{mathspec} +\setmainfont{TeX Gyre Pagella} +\setmathfont(Digits){TeX Gyre Pagella Math} +\setmathfont(Latin,Greek){TeX Gyre Pagella} +% \newfontfamily\ipatext{Doulos SIL} +% \DeclareTextFontCommand{\phontrans}{\ipatext} % wrap // and [] in \phontrans + +% Typographic tweaks +\usepackage{csquotes} +\makeatletter +\DeclareMathSymbol{0}{\mathalpha}{\eu@DigitsArabic@symfont}{`0} +\DeclareMathSymbol{1}{\mathalpha}{\eu@DigitsArabic@symfont}{`1} +\DeclareMathSymbol{2}{\mathalpha}{\eu@DigitsArabic@symfont}{`2} +\DeclareMathSymbol{3}{\mathalpha}{\eu@DigitsArabic@symfont}{`3} +\DeclareMathSymbol{4}{\mathalpha}{\eu@DigitsArabic@symfont}{`4} +\DeclareMathSymbol{5}{\mathalpha}{\eu@DigitsArabic@symfont}{`5} +\DeclareMathSymbol{6}{\mathalpha}{\eu@DigitsArabic@symfont}{`6} +\DeclareMathSymbol{7}{\mathalpha}{\eu@DigitsArabic@symfont}{`7} +\DeclareMathSymbol{8}{\mathalpha}{\eu@DigitsArabic@symfont}{`8} +\DeclareMathSymbol{9}{\mathalpha}{\eu@DigitsArabic@symfont}{`9} +\makeatother + +% Language +\usepackage{polyglossia} +\setdefaultlanguage[variant=british]{english} +\setotherlanguages{french} % for some reason this displays footnotes correctly? + +% Other +\usepackage{paralist} +\usepackage{verbatim} + +% uncomment and expand this if there's a bibliography: +% latexbib \ No newline at end of file