emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@altern.org>
To: Sebastian Hofer <sebhofer@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: preview latex fragment from source code buffer
Date: Mon, 04 Mar 2013 19:57:42 +0100	[thread overview]
Message-ID: <87boazc7rt.fsf@bzg.ath.cx> (raw)
In-Reply-To: <87k3pnrrc3.wl%sebastian.hofer@univie.ac.at> (Sebastian Hofer's message of "Mon, 04 Mar 2013 18:46:04 +0100")

Hi Sebastian,

Sebastian Hofer <sebhofer@gmail.com> writes:

> I missed the functionality to preview a latex fragment directly from
> the latex source buffer. Fortunately this functionality is trivial to
> add. I've been using it for a while now and find it very convenient,
> so I suggest adding it to org.
>
> #+BEGIN_SRC 
> (define-key org-src-mode-map "\C-c\C-x\C-l" 'org-edit-preview-latex-fragment)
>
> (defun org-edit-preview-latex-fragment ()
>   "Write latex fragment from source to parent buffer and preview it."
>   (interactive)
>   (org-src-in-org-buffer (org-preview-latex-fragment)))
> #+END_SRC

I added an entry in Org hacks:
http://orgmode.org/worg/org-hacks.html#sec-1-11-1

I don't think it should be in core, as it is a small conveniency
that can be surprising -- the user could expect the preview to
happen in the src buffer, while it happens in the Org buffer...
also, adding more keybinding like this may raise the issue of
conflicting keybinding with the current src buffer mode.

Thanks for sharing this!

-- 
 Bastien

  reply	other threads:[~2013-03-04 18:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04 17:46 preview latex fragment from source code buffer Sebastian Hofer
2013-03-04 18:57 ` Bastien [this message]
2013-03-04 19:40   ` Sebastian Hofer

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=87boazc7rt.fsf@bzg.ath.cx \
    --to=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=sebhofer@gmail.com \
    /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).