From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: preview latex fragment from source code buffer Date: Mon, 04 Mar 2013 19:57:42 +0100 Message-ID: <87boazc7rt.fsf@bzg.ath.cx> References: <87k3pnrrc3.wl%sebastian.hofer@univie.ac.at> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:40216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCaaA-0000Z5-I8 for emacs-orgmode@gnu.org; Mon, 04 Mar 2013 13:57:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCaa4-0002JP-Ex for emacs-orgmode@gnu.org; Mon, 04 Mar 2013 13:57:54 -0500 Received: from mail-we0-x22e.google.com ([2a00:1450:400c:c03::22e]:48297) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCaa4-0002JG-9D for emacs-orgmode@gnu.org; Mon, 04 Mar 2013 13:57:48 -0500 Received: by mail-we0-f174.google.com with SMTP id r6so4849246wey.5 for ; Mon, 04 Mar 2013 10:57:47 -0800 (PST) In-Reply-To: <87k3pnrrc3.wl%sebastian.hofer@univie.ac.at> (Sebastian Hofer's message of "Mon, 04 Mar 2013 18:46:04 +0100") 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: Sebastian Hofer Cc: emacs-orgmode@gnu.org Hi Sebastian, Sebastian Hofer 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