[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] permanent LaTeX preview
From: |
Nick Dokos |
Subject: |
Re: [O] permanent LaTeX preview |
Date: |
Thu, 29 Sep 2011 13:21:38 -0400 |
Alexander Vorobiev <address@hidden> 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.