In org-mode, Latex previews are not loaded at startup when using #+STARTUP: latexpreview
. I've also tried customizing org-startup-with-latex-preview
with no effect. Only way to preview latex fragment is individually doing so by using C-c C-x C-l
As example I'm using the following org file:
#+STARTUP: showall indent latexpreview entitiespretty
* dfs
* df [2/2] :prb:
- [X] sdf
- [X] sac
* LaTeX embed:
** \gamma \alpha \beta \theta Caracteres especiales, renderizados con: C-c C-x \ Se hace permanente con #+STARTUP: entitiespretty
** Subscripts M_sun ( =M_sun= ) | Superscripts 2^2 ( =2^2= C-x 8 RET hex RET)
** $a ^2=b$ Previsualizar con =C-c C-x C-l=
** Previsualizar con =C-c C-x C-l=
\begin{equation}
x=\sqrt{b}
\end{equation}
Edit: Following tobias advice I checked with emacs -Q which seem to work, but now, I don't know what is it in my emacs init file that is making the previews to fail. Next is my init.el file:
(add-to-list 'load-path' "/home/khamsin/.emacs.d/cc-mode")
(add-to-list 'load-path' "/home/khamsin/.emacs.d/custom")
(setq ring-bell-function 'ignore)
(tool-bar-mode -1)
(menu-bar-mode -1)
(setq inhibit-startup-message t)
(require 'package)
(package-initialize)
;; Activate Solarized theme
(load-theme 'zenburn t)
;; Elpa repositories:
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t) ; Org-mode's repository
;; Acivate Line Numbers
(global-linum-mode 1)
;; Ativate indentation at RET
(global-set-key (kbd "RET") 'newline-and-indent)
;; (define-key c-mode-base-map (kbd "RET") 'newline-and-indent)
;;;;;;;;;; Org require and configuration ;;;;;;;;;;
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
;; Shift select config
(setq org-support-shift-select t)
;; Org mode margin
(setq-default fill-column 80)
(add-hook 'org-mode-hook 'turn-on-auto-fill)
;; Autopair
(defun autopair-insert-opening ()
(interactive)
(when (autopair-pair-p)
(setq autopair-action (list 'opening (autopair-find-pair) (point))))
(autopair-fallback))
;; C Style identation
(setq c-default-style "bsd"
c-basic-offset 4)
(setq-default c-basic-offset 4
tab-width 4
indent-tabs-mode t)
(add-hook 'c-mode-common-hook '(lambda () (c-toggle-auto-state 1)))
;; Set default font
(set-default-font "Ubuntu Mono-14")
(set-fontset-font "fontset-default"
'japanese-jisx0208
'("Source Han Sans JP" . "iso10646-1"))
;; Org LaTeX alignment
(custom-set-variables
;; custom-set-variables was added by Custom.
;; 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.
'(initial-frame-alist (quote ((fullscreen . maximized)))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; 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.
)
C-h v org-startup-with-latex-preview RET
, what does it say the value of that variable is? – elethan Dec 29 '15 at 22:06org-startup-with-latex-preview is a variable defined in org.el'. Its value is t Original value was nil Local in buffer prb.org; global value is the same
– Andrés Sánchez Dec 29 '15 at 22:08emacs -Q
version 24.5.1, and orgmode 8.2.10. Only the buffer-local value oforg-startup-with-latex-preview
is true. Try again withemacs -Q
! This way your personal setup does not interfere. If this works your setup is the culprit. – Tobias Dec 30 '15 at 7:11.emacs
file into(when nil ...stuff...)
and try your thing withemacs
(none of the options-q
nor-Q
). Afterwards shift the(when nil
approximately into the middle of the file where it makes sense, e.g., before;;;;;;;;;; Org require and configuration ;;;;;;;;;;
if the error occurs in the second test shift(when nil
back to approximately one quarter of the file. This way you should find the culprit quite fast. – Tobias Dec 30 '15 at 17:05