emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Alexander Vorobiev <alexander.vorobiev@gmail.com>
Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: permanent LaTeX preview
Date: Thu, 29 Sep 2011 13:21:38 -0400	[thread overview]
Message-ID: <23900.1317316898@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Alexander Vorobiev <alexander.vorobiev@gmail.com> of "Thu, 29 Sep 2011 11:57:24 CDT." <CAGOCFPVMrF=kRg7Dtfvbd2ryFyvareEf1YxE12QcrSuYsYzk_g@mail.gmail.com>

Alexander Vorobiev <alexander.vorobiev@gmail.com> 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.

  reply	other threads:[~2011-09-29 17:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-29 16:57 permanent LaTeX preview Alexander Vorobiev
2011-09-29 17:21 ` Nick Dokos [this message]
2011-09-29 18:37   ` Rasmus
2011-09-29 19:12     ` Nick Dokos
2011-09-29 19:25       ` Rasmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=23900.1317316898@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=alexander.vorobiev@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).