all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* preview latex fragment from source code buffer
@ 2013-03-04 17:46 Sebastian Hofer
  2013-03-04 18:57 ` Bastien
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Hofer @ 2013-03-04 17:46 UTC (permalink / raw)
  To: emacs-orgmode

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

Best regards
Sebastian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: preview latex fragment from source code buffer
  2013-03-04 17:46 preview latex fragment from source code buffer Sebastian Hofer
@ 2013-03-04 18:57 ` Bastien
  2013-03-04 19:40   ` Sebastian Hofer
  0 siblings, 1 reply; 3+ messages in thread
From: Bastien @ 2013-03-04 18:57 UTC (permalink / raw)
  To: Sebastian Hofer; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: preview latex fragment from source code buffer
  2013-03-04 18:57 ` Bastien
@ 2013-03-04 19:40   ` Sebastian Hofer
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Hofer @ 2013-03-04 19:40 UTC (permalink / raw)
  To: Bastien; +Cc: Sebastian Hofer, emacs-orgmode

At Mon, 04 Mar 2013 19:57:42 +0100,
Bastien wrote:
> 
> 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!

Okay, thanks for adding it to worg!

Sebastian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-04 19:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-04 17:46 preview latex fragment from source code buffer Sebastian Hofer
2013-03-04 18:57 ` Bastien
2013-03-04 19:40   ` Sebastian Hofer

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.