From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: permanent LaTeX preview Date: Thu, 29 Sep 2011 13:21:38 -0400 Message-ID: <23900.1317316898@alphaville.dokosmarshall.org> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:50488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9KIs-0005uG-VA for emacs-orgmode@gnu.org; Thu, 29 Sep 2011 13:21:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R9KIo-0001BJ-If for emacs-orgmode@gnu.org; Thu, 29 Sep 2011 13:21:46 -0400 Received: from g4t0016.houston.hp.com ([15.201.24.19]:33800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9KIo-0001B4-Bi for emacs-orgmode@gnu.org; Thu, 29 Sep 2011 13:21:42 -0400 In-Reply-To: Message from Alexander Vorobiev of "Thu, 29 Sep 2011 11:57:24 CDT." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Alexander Vorobiev Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org Alexander Vorobiev wrote: > Hi, > > Is it possible to stop rendered (with C-c C-x C-l) formulas from > reverting back to LaTeX source in case of: > > 1. Pressing C-c C-x C-l to render a formula in other part of the > document. All other formulas revert to LaTeX code in that case. > 2. Pressing C-c C-c to, for instance, evaluate some babel block. In > this particular case it looks like I need to reassign the C-c C-c > keybinding used to remove the images, but I don't know which function > is called to achieve that. > > In the both cases the images get replaced by the LaTeX source. What I > want is to keep the images at all times, and revert only an image I > want to edit LaTeX code for. > I don't think either is possible with the current code. Re. item 1: You can selectively render formulas by limiting the region to a subtree, so it should be possible to do what you want by adding a couple of functions and coming up with a decent user interface. Re. item 2: this is done unconditionally in the function org-ctrl-c-ctrl-c (in file lisp/org.el) and although I don't know the reason, there probably is one and it's probably important[fn:1], so you should proceed with caution. If you want to experiment, I'd suggest you start by commenting out the >>>>> marked line <<<<< below in org-ctrl-c-ctrl-c and testing extensively to see what breaks: ,---- | ... | - If the cursor is on a code block, evaluate it. The variable | `org-confirm-babel-evaluate' can be used to control prompting | before code block evaluation, by default every code block | evaluation requires confirmation. Code block evaluation can be | inhibited by setting `org-babel-no-eval-on-ctrl-c-ctrl-c'." | (interactive "P") | (let ((org-enable-table-editor t)) | (cond | ((or (and (boundp 'org-clock-overlays) org-clock-overlays) | org-occur-highlights | org-latex-fragment-image-overlays) | (and (boundp 'org-clock-overlays) (org-clock-remove-overlays)) | (org-remove-occur-highlights) | >>>>> (org-remove-latex-fragment-image-overlays) <<<<< | (message "Temporary highlights/overlays removed from current buffer")) | ... `---- Cheers, Nick Footnotes: [fn:1] I suspect that it's a necessary precondition for some of the *many* things that this function does, but I don't know for sure.