Minted---colored source blocks in Org LaTeX exports.

Commit
6df26c02303da93ae592b58c06e18adb646f47db
Author
Blendoit <blendoit@gmail.com>
Author date
Committer
Blendoit <blendoit@gmail.com>
Committer date
Changed files
blendoit/.gitignore
index 0233e752..dff4699c 100644..100644
@@ -1,2 +1,5 @@
1 1 # blendoit/.gitignore
2 2
3 Added: _minted-blendoit-init/
4 Added: secrets.org
5 Added: secrets.el
blendoit/blendoit-init.org
index 833a4ee8..84229645 100644..100644
@@ -8,7 +8,7 @@
8 8
9 9 #+LATEX: \begin{abstract}
10 10 GNU Emacs is most often used as a text editor.
11 Removed: The utmost level of customisation is afforded by enabling the user
11 Added: The utmost level of customization is afforded by enabling the user
12 12 to rewrite \textit{any} part of the source code and observe the editor's
13 13 modified behaviour in real time. Since its inception in 1984, GNU Emacs
14 14 has grown to be much more than a full-featured, high-productivity
@@ -24,7 +24,7 @@
24 24 * Introduction
25 25
26 26 The following sections were laid out very deliberately. When we start Emacs,
27 Removed: Emacs Lisp source blocks contained in this document are evaluated
27 Added: Emacs Lisp source code blocks contained in this document are evaluated
28 28 sequentially---our editing environment is constructed in real time as we
29 29 execute the blocks in order. For instance, we only begin loading packages once
30 30 we ensured ~use-package~ is working properly.
@@ -73,7 +73,7 @@
73 73 https://git-scm.com/download/win]
74 74
75 75 #+BEGIN_SRC emacs-lisp
76 Removed: (if (string-equal system-type "windows-nt")
76 Added: (when (string-equal system-type "windows-nt")
77 77 (add-to-list 'exec-path "C:/Users/marius.peter/PortableGit/bin/"))
78 78 #+END_SRC
79 79
@@ -186,11 +186,16 @@
186 186
187 187 ** Secrets
188 188
189 Removed: #+INCLUDE: ./secrets.org
189 Added: The code contained in the =secrets.org= file is loaded by Emacs, but not
190 Added: rendered in this PDF for the sake of privacy. It contains individually
191 Added: identifying information such as names and e-mail addresses, which are used to
192 Added: populate Org templates (Section [[~org-mode~]]).
190 193
194 Added: You need to create this =secrets.org= file, as it is ignored by =git= by
195 Added: default.
196 Added:
191 197 #+BEGIN_SRC emacs-lisp
192 Removed: (setq user-full-name "Marius Peter"
193 Removed: user-mail-address "blendoit@gmail.com")
198 Added: (org-babel-load-file "~/.emacs.d/blendoit/secrets.org")
194 199 #+END_SRC
195 200
196 201 * Global key bindings
@@ -385,61 +390,44 @@
385 390
386 391 *** LaTeX export
387 392
388 Removed: The following makes =TODO= items appear red and =CLOSED= items appear green in
389 Removed: Org's LaTeX exports. Very stylish, much flair!
393 Added: We customize the format for org time stamps to make them pop in our exported
394 Added: LaTeX documents.
390 395
391 396 #+BEGIN_SRC emacs-lisp
392 397 (setq org-latex-active-timestamp-format
393 Removed: "\\textcolor{SteelBlue}{\\texttt{%s}}")
398 Added: "\\texttt{%s}")
394 399 (setq org-latex-inactive-timestamp-format
395 Removed: "\\textcolor{ForestGreen}{\\texttt{%s}}")
400 Added: "\\texttt{%s}")
396 401 #+END_SRC
397 402
398 Removed: *** Publish
403 Added: The following packages are loaded for every LaTeX export
399 404
400 Removed: In the following /alist/ (association list), we describe the projects publishable
401 Removed: via =org-publish=. We separate the publishing of =.org= files and attachments,
402 Removed: because an online tutorial recommended we do so.
405 Added: #+BEGIN_SRC emacs-lisp
406 Added: (setq org-latex-packages-alist
407 Added: '(("AUTO" "polyglossia" t
408 Added: ("xelatex" "lualatex"))
409 Added: ("AUTO" "babel" t
410 Added: ("pdflatex"))
411 Added: ("AUTO" "booktabs" t
412 Added: ("pdflatex"))
413 Added: ("table,svgnames" "xcolor" t
414 Added: ("pdflatex"))))
415 Added: #+END_SRC
403 416
417 Added: Little bonus for GNU/Linux users: syntax highlighting for source code blocks in
418 Added: LaTeX exports.
419 Added:
404 420 #+BEGIN_SRC emacs-lisp
405 Removed: (require 'ox-publish)
406 Removed: (setq org-publish-project-alist
407 Removed: '(
408 Removed: ("Safran-VIP-html"
409 Removed: :base-directory "~/org/WORK/Safran/programs/B787/VIP/doc/org/"
410 Removed: :base-extension "org"
411 Removed: :publishing-directory "~/org/WORK/Safran/programs/B787/VIP/doc/wiki/"
412 Removed: :recursive t
413 Removed: :publishing-function org-html-publish-to-html
414 Removed: :auto-preamble t
415 Removed: :auto-sitemap t
416 Removed: :sitemap-title "" )
417 Removed: ("Safran-VIP-static"
418 Removed: :base-directory "~/org/WORK/Safran/programs/B787/VIP/doc/org/"
419 Removed: :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|mp4\\|ogg\\|swf"
420 Removed: :publishing-directory "~/org/WORK/Safran/programs/B787/VIP/doc/wiki/"
421 Removed: :recursive t
422 Removed: :publishing-function org-publish-attachment )
423 Removed: ("Safran-VIP-all"
424 Removed: :components ("Safran-VIP-html" "Safran-VIP-static"))
425 Removed: ("Safran-MA700-html"
426 Removed: :base-directory "~/org/WORK/Safran/programs/MA700/doc/org/"
427 Removed: :base-extension "org"
428 Removed: :publishing-directory "~/org/WORK/Safran/programs/MA700/doc/wiki/"
429 Removed: :recursive t
430 Removed: :publishing-function org-html-publish-to-html
431 Removed: :auto-preamble t
432 Removed: :auto-sitemap t
433 Removed: :sitemap-title "" )
434 Removed: ("Safran-MA700-static"
435 Removed: :base-directory "~/org/WORK/Safran/programs/MA700/doc/org/"
436 Removed: :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|mp4\\|ogg\\|swf"
437 Removed: :publishing-directory "~/org/WORK/Safran/programs/MA700/doc/wiki/"
438 Removed: :recursive t
439 Removed: :publishing-function org-publish-attachment )
440 Removed: ("Safran-MA700-all"
441 Removed: :components ("Safran-MA700-html" "Safran-MA700-static"))))
421 Added: (when (string-equal system-type "gnu/linux")
422 Added: (add-to-list 'org-latex-packages-alist '("AUTO" "minted" t
423 Added: ("pdflatex" "lualatex")))
424 Added: (setq org-latex-listings 'minted)
425 Added: (setq org-latex-minted-options
426 Added: '(("style" "friendly") ())))
442 427 #+END_SRC
428 Added:
429 Added: The following makes =TODO= items appear red and =CLOSED= items appear green in
430 Added: Org's LaTeX exports. Very stylish, much flair!
443 431
444 432 *** Export
445 433
blendoit/blendoit-init.pdf
index bd0f983d..1f28bb50 100644..100644

Binary files differ

blendoit/secrets.org
index a6ca8954..00000000 100644..000000
@@ -1,4 +0,0 @@
1 Removed: #+BEGIN_SRC emacs-lisp
2 Removed: (setq user-full-name "Marius Peter"
3 Removed: user-mail-address "blendoit@gmail.com")
4 Removed: #+END_SRC
blendoit/test.el
index ca95879e..00000000 100644..000000
@@ -1,1 +0,0 @@
1 Removed: (when window-system (add-hook 'prog-mode-hook 'hl-line-mode))
blendoit/test.org
index d4492b83..00000000 100644..000000
@@ -1,7 +0,0 @@
1 Removed: ** hl-line
2 Removed:
3 Removed: Highlight line at point.
4 Removed:
5 Removed: #+BEGIN_SRC emacs-lisp
6 Removed: (when window-system (add-hook 'prog-mode-hook 'hl-line-mode))
7 Removed: #+END_SRC
init-custom.el
index b7f6584e..3574a4ef 100644..100644
@@ -79,17 +79,10 @@
79 79 ("\\section{%s}" . "\\section*{%s}")
80 80 ("\\subsection*{%s}" . "\\subsection*{%s}")
81 81 ("\\subsubsection*{%s}" . "\\subsubsection*{%s}"))))
82 Removed: '(org-latex-packages-alist
83 Removed: '(("AUTO" "polyglossia" t
84 Removed: ("xelatex" "lualatex"))
85 Removed: ("AUTO" "babel" t
86 Removed: ("pdflatex"))
87 Removed: ("AUTO" "booktabs" t
88 Removed: ("pdflatex"))
89 Removed: ("table,svgnames" "xcolor" t
90 Removed: ("pdflatex"))))
82 Added: '(org-latex-logfiles-extensions
83 Added: '("aux" "bcf" "blg" "fdb_latexmk" "fls" "figlist" "idx" "log" "nav" "out" "ptc" "run.xml" "snm" "toc" "vrb" "xdv"))
91 84 '(org-latex-pdf-process
92 Removed: '("latexmk -pdf -f -interaction=nonstopmode -pdflatex=\"%latex\" -outdir=%o %f"))
85 Added: '("latexmk -pdf -f -interaction=nonstopmode -shell-escape -pdflatex=\"lualatex\" -outdir=%o %f"))
93 86 '(org-latex-toc-command "\\tableofcontents\\clearpage")
94 87 '(org-log-done 'time)
95 88 '(org-startup-align-all-tables t)
templates/documents/general.org
index 43bf396c..8b360db2 100644..100644
@@ -1,4 +1,4 @@
1 Removed: # -*- mode: org; -*-
1 Added: # -*- mode: org; -*- #
2 2
3 3 # Hide Org mode tags
4 4 #+OPTIONS: tags:nil
@@ -7,8 +7,10 @@
7 7
8 8 # Ensure room for header and footer
9 9 #+LATEX_HEADER: \usepackage[left=1in,right=1in,top=1in,bottom=1.75in]{geometry}
10 Removed: # A beautiful font indeed
11 Removed: #+LATEX_HEADER: \usepackage{fourier}
10 Added: # Beautiful fonts ONLY
11 Added: #+LATEX_HEADER: \usepackage{fontspec}
12 Added: #+LATEX_HEADER: \setmainfont{liberation serif}
13 Added: #+LATEX_HEADER: \setmonofont{hermit}
12 14
13 15 # Get total page count to insert in footer
14 16 #+LATEX_HEADER: \usepackage{lastpage}
@@ -26,7 +28,7 @@
26 28 #+LATEX_HEADER: \usepackage{fancyhdr}
27 29 #+LATEX_HEADER: \setlength{\headheight}{40pt}
28 30 #+LATEX_HEADER_EXTRA: \pagestyle{fancy}
29 Removed: #+LATEX_HEADER_EXTRA: \fancyhead[L]{\rule[-12pt]{0pt}{0pt}\theauthor}
31 Added: #+LATEX_HEADER_EXTRA: \fancyhead[L]{\rule[-12pt]{0pt}{0pt}\texttt{\theauthor}}
30 32 #+LATEX_HEADER_EXTRA: \fancyhead[C]{\large\textbf{\thetitle}}
31 33 #+LATEX_HEADER_EXTRA: \fancyhead[R]{\thedate}
32 34 #+LATEX_HEADER_EXTRA: \renewcommand{\headrulewidth}{1.4pt}
templates/documents/general.org_title
index 3cf4431a..c2c3c093 100644..100644
@@ -1,8 +1,10 @@
1 Added: # -*- mode: org; -*- #
2 Added:
1 3 #+OPTIONS: title:nil toc:nil
2 4 # Increase spacing between header rule and main text body
3 5 #+LATEX: \rule[-2in]{0pt}{0pt}\\
4 6 #+LATEX: \Huge\textbf{\thetitle}\\[1in]
5 Removed: #+LATEX: \LARGE\theauthor\\
7 Added: #+LATEX: \LARGE\texttt{\theauthor}\\
6 8 #+LATEX: \thedate
7 9
8 10 #+LATEX: \clearpage