From 56ef05b6589b4e466c2dd387195a60ffc81f4278 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Fri, 19 Jan 2018 15:39:08 +0100 Subject: emacs: added LaTeX support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Support has been added through Auctex, and through org-mode export. Signed-off-by: Miquel Sabaté Solà --- emacs/init.html | 76 +++++++++++++++++++++++++++++++++++++++++++++------------ emacs/init.org | 32 ++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 16 deletions(-) (limited to 'emacs') diff --git a/emacs/init.html b/emacs/init.html index a55d2ac..e8b08da 100644 --- a/emacs/init.html +++ b/emacs/init.html @@ -4,7 +4,7 @@ mssola's GNU Emacs configuration - + @@ -199,10 +199,11 @@ for the JavaScript code in this tag.
  • Others
  • -
  • WoMan
  • -
  • Misc
  • -
  • Credits
  • -
  • License
  • +
  • LaTeX
  • +
  • WoMan
  • +
  • Misc
  • +
  • Credits
  • +
  • License
  • @@ -2063,6 +2064,29 @@ And now let's set all the related settings. +

    +Sometimes it's useful to export to LaTeX. That is, when you are simply writing a +quick document that will end up being converted into LaTeX and finally into PDF: +

    + +
    + +
    (require 'ox-latex)
    +
    +(unless (boundp 'org-latex-classes)
    +  (setq org-latex-classes nil))
    +
    +(add-to-list 'org-latex-classes
    +             '("article"
    +               "\\documentclass{article}"
    +               ("\\section{%s}" . "\\section*{%s}")
    +               ("\\subsection{%s}" . "\\subsection*{%s}")
    +               ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
    +               ("\\paragraph{%s}" . "\\paragraph*{%s}")
    +               ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
    +
    +
    +

    You can also export org documents to man pages. In order to do so, you have to perform this first: @@ -2847,9 +2871,29 @@ criteria really).

    -

    WoMan

    +

    LaTeX

    +Let's use [Auctex](https://www.gnu.org/software/auctex/) for LaTeX files. +

    + +
    + +
    (use-package tex
    +  :ensure auctex
    +  :config
    +  (setq TeX-auto-save t)
    +  (setq TeX-parse-self t)
    +  (setq-default TeX-master nil))
    +
    +
    +
    +
    + +
    +

    WoMan

    +
    +

    WoMan is a package that is included inside of GNU Emacs by default, and that takes care of visualizing man pages. Let's properly setup Evil mode for this:

    @@ -2881,9 +2925,9 @@ Finally, I want man pages to fill all the frame:
    -
    -

    Misc

    -
    +
    +

    Misc

    +

    Install a set of useful functions from @bbatsov. The bindings are following Emacs style instead of being more Vim-like on purpose (I don't want to put @@ -2904,9 +2948,9 @@ too many things into my leader and these shortcuts look sensible to me).

    -
    -

    Credits

    -
    +
    +

    Credits

    +

    I've built this file by simply scavenging from other people's emacs.d/dotfiles repositories. I have taken lots of pieces from here and there, but most notably: @@ -2931,9 +2975,9 @@ repositories. I have taken lots of pieces from here and there, but most notably:

    -
    -

    License

    -
    +
    +

    License

    +
    Copyright (C) 2014-2018 Miquel Sabaté Solà <mikisabate@gmail.com>
    @@ -2957,7 +3001,7 @@ along with this program.  If not, see <
     
    diff --git a/emacs/init.org b/emacs/init.org index b493798..908457d 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -1426,6 +1426,25 @@ And now let's set all the related settings. org-export-htmlize-output-type 'css) #+END_SRC +Sometimes it's useful to export to LaTeX. That is, when you are simply writing a +quick document that will end up being converted into LaTeX and finally into PDF: + +#+BEGIN_SRC elisp +(require 'ox-latex) + +(unless (boundp 'org-latex-classes) + (setq org-latex-classes nil)) + +(add-to-list 'org-latex-classes + '("article" + "\\documentclass{article}" + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) +#+END_SRC + You can also export org documents to man pages. In order to do so, you have to perform this first: @@ -2014,6 +2033,19 @@ criteria really). (add-hook lang-hook 'soria-purple-identifiers)) #+END_SRC +* LaTeX + +Let's use [Auctex](https://www.gnu.org/software/auctex/) for LaTeX files. + +#+BEGIN_SRC elisp +(use-package tex + :ensure auctex + :config + (setq TeX-auto-save t) + (setq TeX-parse-self t) + (setq-default TeX-master nil)) +#+END_SRC + * WoMan =WoMan= is a package that is included inside of GNU Emacs by default, and that -- cgit v1.2.3