From eaa0576d801b81cf86030839a480246e6c34d91e Mon Sep 17 00:00:00 2001
From: Stephane Del Pino <stephane.delpino44@gmail.com>
Date: Mon, 23 Mar 2020 08:43:36 +0100
Subject: [PATCH] =?UTF-8?q?Am=C3=A9rliore=20le=20configuration=20LaTeX?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- gestion des pdf-tools
  - la sortie pdf se fait dans Emacs
  - double clic gauche "mouse-1 mouse-1" ou contrôle clic gauche
    "C-mouse-1"
  - Recadrage de l'affichage pdf en faisant "C-c C-g"
- chargement de ref-tex à l'ouverture du fichier
---
 .gitignore        |  2 ++
 Configuration.org | 14 ++++++++++++--
 init.el           |  4 +++-
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index 7b1e115..8a7f077 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,3 +20,5 @@ auto-save-list
 /url
 /Tutoriel.odt
 /Configuration.el
+/Configuration.pdf
+/Configuration.tex
diff --git a/Configuration.org b/Configuration.org
index 5c6dae1..cf478cb 100644
--- a/Configuration.org
+++ b/Configuration.org
@@ -605,7 +605,9 @@ Permet d'utiliser reduire/agrandir les affichages de répertoires
 Configuration LaTeX basique.
 #+BEGIN_SRC emacs-lisp
   (use-package tex
-    :ensure auctex)
+    :ensure auctex
+    :init
+    (add-hook 'LaTeX-mode-hook 'turn-on-reftex))
 
   (defun tex-view ()
     (interactive)
@@ -945,7 +947,15 @@ voir [[https://github.com/emacsmirror/emacswiki.org/blob/master/wgrep.el][wgrep]
 Outils d'édition de PDF dans Emacs
 #+BEGIN_SRC emacs-lisp
   (use-package pdf-tools
-    :ensure t)
+    :ensure t
+    :config
+    (when (eq system-type 'gnu/linux)
+      (pdf-tools-install) ; nice PDF viewer (needs separate installation)
+      (setq TeX-view-program-selection '((output-pdf "pdf-tools")))
+      (setq TeX-view-program-list '(("pdf-tools" "TeX-pdf-tools-sync-view"))))
+    :init
+    (add-hook 'LaTeX-mode-hook '(lambda () (local-set-key (kbd "C-c C-g") 'pdf-sync-forward-search))))
+
   (use-package org-pdfview
     :ensure t)
 #+END_SRC
diff --git a/init.el b/init.el
index 07dda5a..4cb1df2 100644
--- a/init.el
+++ b/init.el
@@ -45,11 +45,13 @@
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
+ '(TeX-command-extra-options "-synctex=1")
  '(all-the-icons-ivy-buffer-commands (quote (ivy-switch-buffer-other-window ivy-switch-buffer)))
  '(elpy-rpc-backend "jedi" t)
  '(hydra-hint-display-type (quote posframe))
  '(irony-cdb-search-directory-list (quote ("." "build")))
  '(org-confirm-babel-evaluate nil)
+ '(org-default-notes-file (concat org-directory "/notes.org"))
  '(org-export-html-postamble nil)
  '(org-hide-leading-stars t)
  '(org-src-fontify-natively t)
@@ -58,7 +60,7 @@
  '(package-selected-packages
    (quote
     (better-shell flycheck-irony tabbar cmake-font-lock alect-theme zero-dark-theme autumn-light-theme solarized-dark-theme misterioso misterioso-theme zenburn sourcerer-theme flycheck-pos-tip flycheck-clojure ox-reveal posframe processing-snippets processing-mode rg deadgrep flycheck-rust cargo racer yasnippet-classic-snippets rustic lsp-rust lsp-java company-lsp lsp-ui lsp-mode lsp yasnippet-snippets counsel-spotify exec-path-from-shell easy-kill auto-yasnippet org-pdfview pdf-tools atomic-chrome mingus simple-mpc pcre2el ag wgrep-ag wgrep haskell-mode aggressive-indent prodigy origami dumb-jump cider ggtags circe-notifications circe org-gcal mu4e-alert git-timemachine git-gutter magit hydra default-text-scale smartparens projectile auctex tern-auto-complete tern js2-refactor ac-js2 js2-mode emmet-mode web-mode iedit expand-region multiple-cursors hungry-delete beacon undo-tree virtualenvwrapper elpy flycheck doom-modeline doom-themes tao-theme poet-theme faff-theme zerodark-theme alect-themes moe-theme base16-theme zenburn-theme color-theme-modern company-jedi irony-eldoc company-irony company counsel ace-window htmlize noflet org-bullets which-key try use-package)))
- '(sp-escape-quotes-after-insert nil t))
+ '(sp-escape-quotes-after-insert nil))
 
 (custom-set-faces
  ;; custom-set-faces was added by Custom.
-- 
GitLab