LaTex in spacemacs
Steps in short
- Install latexmk:
sudo dnf install latexmk
- Add latex layer to spacemacs:
SPC f e d
to open the~.spacemacs
file;- add
latex
to thedotspacemacs-configuration-layers variable
; SPC f e R
to download layer and apply changes.
- Open a .tex file and compile a pdf with
, b
orlatex/build
If you, like me, enjoy working with 2 windows with code in the first one and the resulting pdf in the second one then do this:
- Open a .tex file:
C-x C-f
- Divide your window in two:
SPC w /
- Go to the second window and open a pdf that you just build there.
If you see pdf as plan text - enable
doc-view-mode
- Change the .tex, press
, b
to rebuild and see changes applied in the second window.
it's a png so zoon in
Pro tip: regulate the width of both screens with going into window-transient-state
(SPC w ,
) and pressing [
and ]
.
Story behind
I like compiling things and having my documents version-controlled, that’s why I like tex. I tried TexMaker and TexStudio but they both have funny UI. I use spacemacs for my day-to-day, so I tried to give it a shot. Turned out it’s quite decent.