add some stuff for LaTeX org export
This commit is contained in:
parent
2092b846b4
commit
8cc78d8ded
70
config.org
70
config.org
@ -1,8 +1,10 @@
|
|||||||
* Emacs Configuration
|
#+TITLE: Emacs Configuration
|
||||||
|
#+AUTHOR: Camden Dixie O'Brien
|
||||||
|
#+ATTR_LATEX: :float t
|
||||||
|
|
||||||
Shout out to Harry R. Schwartz; A whole bunch of this config
|
Shout out to Harry R. Schwartz; A whole bunch of this config
|
||||||
(including the idea of embeddeding the lot in an Org document) is
|
(including the idea of embeddeding the lot in an Org document) is
|
||||||
yanked from [[https://github.com/hts/dotfiles][his dotfiles repo]].
|
yanked from [[https://github.com/hrs/dotfiles][his dotfiles repo]].
|
||||||
|
|
||||||
The rest of this config grabs packages via =use-package=, so that
|
The rest of this config grabs packages via =use-package=, so that
|
||||||
needs to be set up to install them if they aren't already.
|
needs to be set up to install them if they aren't already.
|
||||||
@ -12,7 +14,7 @@ needs to be set up to install them if they aren't already.
|
|||||||
(setq use-package-always-ensure t)
|
(setq use-package-always-ensure t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** UI
|
* UI
|
||||||
|
|
||||||
The start-up message gets pretty annoying, so disable that.
|
The start-up message gets pretty annoying, so disable that.
|
||||||
|
|
||||||
@ -41,7 +43,7 @@ don't use them.
|
|||||||
(scroll-bar-mode -1)
|
(scroll-bar-mode -1)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Colour Scheme
|
** Colour Scheme
|
||||||
|
|
||||||
Currently using =spacemacs-theme='s light variant, but I prefer a pure
|
Currently using =spacemacs-theme='s light variant, but I prefer a pure
|
||||||
white background to the off-white it has by default.
|
white background to the off-white it has by default.
|
||||||
@ -55,7 +57,7 @@ white background to the off-white it has by default.
|
|||||||
(load-theme 'spacemacs-light t)
|
(load-theme 'spacemacs-light t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Font
|
** Font
|
||||||
|
|
||||||
I am addicted to programming ligatures but Fira Code (my preferred
|
I am addicted to programming ligatures but Fira Code (my preferred
|
||||||
ligature font) requires some hackery to display properly; this is
|
ligature font) requires some hackery to display properly; this is
|
||||||
@ -72,7 +74,7 @@ And then make sure that mode is enabled for any =prog-mode= buffer.
|
|||||||
(add-hook 'prog-mode-hook 'fira-code-mode)
|
(add-hook 'prog-mode-hook 'fira-code-mode)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Magit
|
* Magit
|
||||||
|
|
||||||
=magit= is truly a wonderful creation! Only deviations from defaults
|
=magit= is truly a wonderful creation! Only deviations from defaults
|
||||||
here are a keybinding for =magit-status= and a maximum length for the
|
here are a keybinding for =magit-status= and a maximum length for the
|
||||||
@ -87,7 +89,7 @@ highlighted).
|
|||||||
(setq git-commit-summary-max-length 50))
|
(setq git-commit-summary-max-length 50))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Language Integrations
|
* Language Integrations
|
||||||
|
|
||||||
Generally, 8-character-wide tabs are not my thing.
|
Generally, 8-character-wide tabs are not my thing.
|
||||||
|
|
||||||
@ -96,7 +98,13 @@ Generally, 8-character-wide tabs are not my thing.
|
|||||||
(setq-default basic-offset 4)
|
(setq-default basic-offset 4)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** C
|
And generally indenting with spaces is more common, so make that the default:
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(setq-default indent-tabs-mode nil)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** C
|
||||||
|
|
||||||
For C, I like to indent with tabs and align with spaces: this
|
For C, I like to indent with tabs and align with spaces: this
|
||||||
behaviour is provided by =smart-tabs-mode=.
|
behaviour is provided by =smart-tabs-mode=.
|
||||||
@ -125,7 +133,7 @@ Meson is my build system of choice for C, but I also use CMake a lot.
|
|||||||
(use-package cmake-mode)
|
(use-package cmake-mode)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Haskell
|
** Haskell
|
||||||
|
|
||||||
My workflow with Haskell is very REPL-based, so I always want
|
My workflow with Haskell is very REPL-based, so I always want
|
||||||
=interactive-haskell-mode= on.
|
=interactive-haskell-mode= on.
|
||||||
@ -144,7 +152,7 @@ And, of course, that REPL needs to be taking advantage of parallelism!
|
|||||||
'("-threaded" "+RTS" "-N8" "-RTS"))
|
'("-threaded" "+RTS" "-N8" "-RTS"))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Idris
|
** Idris
|
||||||
|
|
||||||
The only thing to change from the defaults here is to add a more
|
The only thing to change from the defaults here is to add a more
|
||||||
convenient way to case-split.
|
convenient way to case-split.
|
||||||
@ -157,7 +165,7 @@ convenient way to case-split.
|
|||||||
'idris-case-split)))
|
'idris-case-split)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Rust
|
** Rust
|
||||||
|
|
||||||
I never really use Rust without Cargo, so always turn on the minor
|
I never really use Rust without Cargo, so always turn on the minor
|
||||||
mode for Cargo in Rust buffers.
|
mode for Cargo in Rust buffers.
|
||||||
@ -168,7 +176,7 @@ mode for Cargo in Rust buffers.
|
|||||||
(add-hook 'rust-mode-hook 'cargo-minor-mode)
|
(add-hook 'rust-mode-hook 'cargo-minor-mode)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Lisps
|
** Lisps
|
||||||
|
|
||||||
Get =racket-mode= for some Racket-specific things, like searching documentation
|
Get =racket-mode= for some Racket-specific things, like searching documentation
|
||||||
|
|
||||||
@ -204,7 +212,7 @@ enclosing parens.
|
|||||||
(paredit-mode))))
|
(paredit-mode))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Org-mode
|
* Org-mode
|
||||||
|
|
||||||
I use a couple non-standard bits and pieces, but not a whole bunch. I
|
I use a couple non-standard bits and pieces, but not a whole bunch. I
|
||||||
really like the =<s= to insert a source block thing (which was
|
really like the =<s= to insert a source block thing (which was
|
||||||
@ -238,7 +246,7 @@ Log when tasks were marked =DONE=, just for graphs.
|
|||||||
(setq org-log-done t)
|
(setq org-log-done t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Source Blocks
|
** Source Blocks
|
||||||
|
|
||||||
Pressing tab inside a source block should indent appropriately for its
|
Pressing tab inside a source block should indent appropriately for its
|
||||||
language.
|
language.
|
||||||
@ -257,7 +265,9 @@ Emacs lisp.
|
|||||||
'((emacs-lisp . t)))
|
'((emacs-lisp . t)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** HTML Exporting
|
** Exporting
|
||||||
|
|
||||||
|
*** HTML
|
||||||
|
|
||||||
=htmlize= is needed for decent HTML exporting, and there is no need
|
=htmlize= is needed for decent HTML exporting, and there is no need
|
||||||
for all that stuff at the bottom.
|
for all that stuff at the bottom.
|
||||||
@ -267,7 +277,35 @@ for all that stuff at the bottom.
|
|||||||
(setq org-html-postamble nil)
|
(setq org-html-postamble nil)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Music Player
|
*** LaTeX
|
||||||
|
|
||||||
|
Use =minted= (LaTeX package) to do syntax highlighting in code blocks:
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(add-to-list 'org-latex-packages-alist '("" "minted"))
|
||||||
|
(setq org-latex-listings 'minted)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
=minted= actually calls =pygments= through the shell, which =pdflatex=
|
||||||
|
doesn't like; you have to tell it not to worry, and that everything is
|
||||||
|
going to be OK.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(setq org-latex-pdf-process
|
||||||
|
'("xelatex -shell-escape -interaction nonstopmode -output-directory %o %f"
|
||||||
|
"xelatex -shell-escape -interaction nonstopmode -output-directory %o %f"
|
||||||
|
"xelatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
Also, I don't like Emacs' built-in PDF viewer, so open PDFs in [[https://mupdf.com/][MuPDF]] instead:
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(eval-after-load "org"
|
||||||
|
'(progn
|
||||||
|
(setcdr (assoc "\\.pdf\\'" org-file-apps) "mupdf %s")))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
* Music Player
|
||||||
|
|
||||||
I use MPD because it is clearly the best way to play music; sometimes
|
I use MPD because it is clearly the best way to play music; sometimes
|
||||||
it's nice to control it from Emacs, so I use MPDel for that.
|
it's nice to control it from Emacs, so I use MPDel for that.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user