adding the package magic-latex-buffer to the latex layer

This commit is contained in:
Ben 2015-12-11 17:14:56 -05:00 committed by Eivind Fonn
parent c56c927641
commit cc1b087497
3 changed files with 54 additions and 15 deletions

View File

@ -13,6 +13,7 @@
- [[#build-command][Build command]]
- [[#auto-fill][Auto-fill]]
- [[#folding][Folding]]
- [[#magic-latex-buffer][Magic latex buffer]]
- [[#keybindings][Keybindings]]
- [[#folding-1][Folding]]
- [[#reftex][RefTeX]]
@ -87,6 +88,28 @@ is nil.
(latex :variables latex-enable-folding t))
#+END_SRC
** Magic latex buffer
To enable “magic” symbols in latex buffers, set the variable
=latex-enable-magic= to =t=.
#+BEGIN_SRC emacs-lisp
dotspacemacs-configuration-layers '(
(latex :variables latex-enable-magic t))
#+END_SRC
The precise effect of this feature can be modified by adjusting the following
variables:
- =magic-latex-enable-block-highlight=: show font properties like =\large=
(default =t=).
- =magic-latex-enable-block-align=: reflect block alignment such as =\center=
(default =nil=).
- =magic-latex-enable-pretty-symbols=: substitute symbols in place of code, e.g.
greek letters (default =t=).
- =magic-latex-enable-suscript=: show subscripts and superscripts (default =t=).
- =magic-latex-enable-inline-image=: show images inline (default =nil=).
By default, the underlying latex code is echoed in the echo area.
* Keybindings
| Key Binding | Description |

View File

@ -22,6 +22,9 @@
(defvar latex-enable-folding nil
"Whether to use `TeX-fold-mode' or not in tex/latex buffers.")
(defvar latex-enable-magic nil
"Whether to enable \"magic\" symbols in the buffer.")
(defvar latex-nofill-env '("equation"
"equation*"
"align"

View File

@ -10,21 +10,22 @@
;;; License: GPLv3
(setq latex-packages
'(
auctex
(auctex-latexmk :toggle (string= "LatexMk" latex-build-command))
(company-auctex :toggle (configuration-layer/package-usedp 'company))
evil-matchit
(reftex :location built-in)
flycheck
flyspell
ggtags
helm-gtags
smartparens
typo
yasnippet
which-key
))
'(
auctex
(auctex-latexmk :toggle (string= "LatexMk" latex-build-command))
(company-auctex :toggle (configuration-layer/package-usedp 'company))
evil-matchit
(reftex :location built-in)
flycheck
flyspell
ggtags
helm-gtags
(magic-latex-buffer :toggle latex-enable-magic)
smartparens
typo
yasnippet
which-key
))
(defun latex/init-auctex ()
(use-package tex
@ -199,3 +200,15 @@
(defun latex/post-init-which-key ()
(push '((nil . "\\`latex/font-\\(.+\\)\\'") . (nil . "\\1"))
which-key-replacement-alist))
(defun latex/init-magic-latex-buffer ()
(use-package magic-latex-buffer
:defer t
:init
(progn
(add-hook 'LaTeX-mode-hook 'magic-latex-buffer)
(setq magic-latex-enable-block-highlight t
magic-latex-enable-suscript t
magic-latex-enable-pretty-symbols t
magic-latex-enable-block-align nil
magic-latex-enable-inline-image nil))))