Browse Source

emacs ready with auctex

redis
parent
commit
6168ffbb38
4 changed files with 78 additions and 38 deletions
  1. +35
    -34
      config/.emacs
  2. BIN
      examples/latex-test/XdWGT.png
  3. +18
    -4
      examples/latex-test/main.tex
  4. +25
    -0
      examples/latex-test/refs.bib

+ 35
- 34
config/.emacs View File

@ -95,40 +95,40 @@
("C--" . er/contract-region)) ("C--" . er/contract-region))
;; latex ;; latex
;; (use-package tex
;; :defer t
;; :ensure auctex
;; :init
;; (progn
;; (setq-default TeX-master nil) ; Query for master file.
;; (setq TeX-auto-save t) ; Enable parse on save.
;; (setq TeX-save-query nil)
;; (setq LaTeX-includegraphics-read-file 'LaTeX-includegraphics-read-file-relative)
;; (custom-set-variables '(LaTeX-command "latex -synctex=1"))
;; ;;(setq TeX-command-force "LaTex")
;; ;;(setq latex-run-command "pdflatex")
;; (setq TeX-parse-self t) ; Enable parse on load.
;; (setenv "PATH" (concat (getenv "PATH") ":/Library/TeX/texbin/"))
;; (setq exec-path (append exec-path '("/Library/TeX/texbin/")))
;; ;; pdf-tools configuration
;; (setq TeX-PDF-mode t)
;; (add-hook 'TeX-after-compilation-finished-functions
;; #'TeX-revert-document-buffer)
;; (setq TeX-view-program-selection '((output-pdf "PDF Tools"))
;; TeX-source-correlate-start-server t)
;; (setq pdf-info-epdfinfo-program "/usr/bin/epdfinfo")
;; (add-to-list 'auto-mode-alist '("\\.pdf\\'" . pdf-view-mode))
;; (add-hook 'pdf-view-mode-hook
;; (lambda () (pdf-tools-enable-minor-modes)))
;; )
;; :config
;; (add-hook 'LaTeX-mode-hook
;; (lambda ()
;; (company-mode)
;; (turn-on-reftex)
;; (setq reftex-plug-into-AUCTeX t)
;; (reftex-isearch-minor-mode))
;; )
(use-package tex
:defer t
:ensure auctex
:init
(progn
(setq-default TeX-master nil) ; Query for master file.
(setq TeX-auto-save t) ; Enable parse on save.
(setq TeX-save-query nil)
(setq LaTeX-includegraphics-read-file 'LaTeX-includegraphics-read-file-relative)
(custom-set-variables '(LaTeX-command "latex -synctex=1"))
;;(setq TeX-command-force "LaTex")
;;(setq latex-run-command "pdflatex")
(setq TeX-parse-self t) ; Enable parse on load.
(setenv "PATH" (concat (getenv "PATH") ":/Library/TeX/texbin/"))
(setq exec-path (append exec-path '("/Library/TeX/texbin/")))
;; pdf-tools configuration
(setq TeX-PDF-mode t)
(add-hook 'TeX-after-compilation-finished-functions
#'TeX-revert-document-buffer)
(setq TeX-view-program-selection '((output-pdf "PDF Tools"))
TeX-source-correlate-start-server t)
(setq pdf-info-epdfinfo-program "/usr/bin/epdfinfo")
(add-to-list 'auto-mode-alist '("\\.pdf\\'" . pdf-view-mode))
(add-hook 'pdf-view-mode-hook
(lambda () (pdf-tools-enable-minor-modes)))
)
:config
(add-hook 'LaTeX-mode-hook
(lambda ()
(company-mode)
(turn-on-reftex)
(setq reftex-plug-into-AUCTeX t)
(reftex-isearch-minor-mode))
))
;; pdf-tools ;; pdf-tools
(use-package pdf-tools (use-package pdf-tools
@ -174,6 +174,7 @@
'(font . "DejaVu Sans Mono-16")) '(font . "DejaVu Sans Mono-16"))
(fset 'yes-or-no-p 'y-or-n-p) ;; Ask y/n instead of yes/no (fset 'yes-or-no-p 'y-or-n-p) ;; Ask y/n instead of yes/no
(add-hook 'prog-mode-hook 'display-line-numbers-mode) ;; display line number when programming (add-hook 'prog-mode-hook 'display-line-numbers-mode) ;; display line number when programming
(setq x-alt-keysym 'meta)
;; -+-+-+-+-+-+-+- ;; -+-+-+-+-+-+-+-


BIN
examples/latex-test/XdWGT.png View File

Before After
Width: 350  |  Height: 311  |  Size: 80 KiB

+ 18
- 4
examples/latex-test/main.tex View File

@ -1,18 +1,32 @@
\documentclass{article} \documentclass{article}
\usepackage{graphicx} \usepackage{graphicx}
\usepackage{lipsum} \usepackage{lipsum}
%\usepackage{biblatex}
%\addbibresource{refs}
\title{Project's title}
\author{Gerardo Marx}
\begin{document} \begin{document}
Hello \LaTeX{}.
\maketitle{}
\section{Introduction} \section{Introduction}
\label{sec:intro} \label{sec:intro}
\lipsum[1]
\begin{figure}[htb] \begin{figure}[htb]
\centering \centering
\includegraphics
\caption{Test}
\includegraphics[width=2.5in]{XdWGT}
\caption{Test figure.}
\label{test}
\end{figure} \end{figure}
\section{Methodology}
\label{sec:methods}
\lipsum[2-3]
More test with references here \cite{einstein}.
\bibliography{refs.bib}
\bibliographystyle{ieeetr}
\end{document} \end{document}
%%% Local Variables: %%% Local Variables:


+ 25
- 0
examples/latex-test/refs.bib View File

@ -0,0 +1,25 @@
@article{einstein,
author = "Albert Einstein",
title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]",
journal = "Annalen der Physik",
volume = "322",
number = "10",
pages = "891--921",
year = "1905",
DOI = "http://dx.doi.org/10.1002/andp.19053221004"
}
@book{latexcompanion,
author = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
title = "The \LaTeX\ Companion",
year = "1993",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts"
}
@misc{knuthwebsite,
author = "Donald Knuth",
title = "Knuth: Computers and Typesetting",
url = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html"
}

Loading…
Cancel
Save