emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Chose where latex preview images are placed
@ 2012-08-03 17:17 Abdó Roig-Maranges
  2012-08-03 17:55 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Abdó Roig-Maranges @ 2012-08-03 17:17 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 380 bytes --]


Hi,

I'm a regular org-mode user. I have made a couple of small tweaks to
org-mode that may be useful to someone else.

In this mail I attach a patch for the first one. It adds a configuration
variable to chose where latex preview stores the little png images of
formulas. I prefer having all of them together rather than scattered all
over the place.

Abdó Roig.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: the patch --]
[-- Type: text/x-patch, Size: 1968 bytes --]

From bacccfc3d2050df281ec620e761465719606fdb3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Abd=C3=B3=20Roig-Maranges?= <abdo.roig@gmail.com>
Date: Wed, 1 Aug 2012 19:24:50 +0200
Subject: [PATCH] Option to chose directory for latex preview images

* org.el (org-latex-preview-ltxpng-directory): new config variable.
(org-preview-latex-fragment): store latex preview images in
org-latex-preview-ltxpng-directory.

Added a variable org-latex-preview-ltxpng-directory with a path
where the preview images will be stored. The default does not
change (small little ltxpng scattered all over the place) but now
the user can chose an absolute path and put all the images on a
single place.
---
 lisp/org.el | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 8e0f987..f49a9ac 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3413,6 +3413,14 @@ imagemagick     Convert the LaTeX fragments to pdf files and use imagemagick
 	  (const :tag "dvipng" dvipng)
 	  (const :tag "imagemagick" imagemagick)))
 
+(defcustom org-latex-preview-ltxpng-directory "ltxpng/"
+  "Path to store latex preview images. A relative path here creates many
+   directories relative to the processed org files paths. An absolute path
+   puts all preview images at the same place."
+  :group 'org-latex
+  :version "24.2"
+  :type 'string)
+
 (defun org-format-latex-mathml-available-p ()
   "Return t if `org-latex-to-mathml-convert-command' is usable."
   (save-match-data
@@ -17131,8 +17139,8 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
 	(narrow-to-region beg end)
 	(goto-char beg)
 	(org-format-latex
-	 (concat "ltxpng/" (file-name-sans-extension
-			    (file-name-nondirectory
+	 (concat org-latex-preview-ltxpng-directory (file-name-sans-extension
+			     (file-name-nondirectory
 			     buffer-file-name)))
 	 default-directory 'overlays msg at 'forbuffer
 	 org-latex-create-formula-image-program)
-- 
1.7.11.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: Chose where latex preview images are placed
  2012-08-03 17:17 Chose where latex preview images are placed Abdó Roig-Maranges
@ 2012-08-03 17:55 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2012-08-03 17:55 UTC (permalink / raw)
  To: Abdó Roig-Maranges; +Cc: emacs-orgmode

Hi Abdó,

Abdó Roig-Maranges <abdo.roig@gmail.com> writes:

> I'm a regular org-mode user. I have made a couple of small tweaks to
> org-mode that may be useful to someone else.
>
> In this mail I attach a patch for the first one. It adds a configuration
> variable to chose where latex preview stores the little png images of
> formulas. I prefer having all of them together rather than scattered all
> over the place.

Applied, thanks!

PS: Please add TINYCHANGE for small patches if you didn't sign the FSF
papers. 

-- 
 Bastien

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-03 17:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-03 17:17 Chose where latex preview images are placed Abdó Roig-Maranges
2012-08-03 17:55 ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).