emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-preview-latex-fragment and preview-copy-region-as-mml
@ 2012-01-30 10:49 Uwe Brauer
  2012-01-30 11:25 ` Antoine Levitt
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Brauer @ 2012-01-30 10:49 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: auctex-devel

Hello

I am starting to use org-preview-latex-fragment also in non
org buffers, including message buffers.

What would be extremely helpful is to actually send the
images generates in the message buffers as images.

Preview-latex provides such a functionality
preview-copy-region-as-mml, from  a LaTeX buffer.

Of course the 2 preview functions org-preview and the
latex-preview function work differently. I had a look 
preview-copy-region-as-mml  and it is not clear to me how to
make if work for png generated by org-preview-latex-fragment
in a message buffer. 

Maybe some of the maintainers of org mode or auctex are
interested in having a look?

Uwe Brauer 

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

* Re: org-preview-latex-fragment and preview-copy-region-as-mml
  2012-01-30 10:49 org-preview-latex-fragment and preview-copy-region-as-mml Uwe Brauer
@ 2012-01-30 11:25 ` Antoine Levitt
  2012-01-30 18:23   ` a kludge (was: org-preview-latex-fragment and preview-copy-region-as-mml) Uwe Brauer
  0 siblings, 1 reply; 3+ messages in thread
From: Antoine Levitt @ 2012-01-30 11:25 UTC (permalink / raw)
  To: auctex-devel; +Cc: emacs-orgmode, ding

30/01/12 11:49, Uwe Brauer
> Hello
>
> I am starting to use org-preview-latex-fragment also in non
> org buffers, including message buffers.
>
> What would be extremely helpful is to actually send the
> images generates in the message buffers as images.
>
> Preview-latex provides such a functionality
> preview-copy-region-as-mml, from  a LaTeX buffer.
>
> Of course the 2 preview functions org-preview and the
> latex-preview function work differently. I had a look 
> preview-copy-region-as-mml  and it is not clear to me how to
> make if work for png generated by org-preview-latex-fragment
> in a message buffer. 
>
> Maybe some of the maintainers of org mode or auctex are
> interested in having a look?
>
> Uwe Brauer 

(ccing gnus mailing list, in case someone is interested)

I ran into that the other day.

I think it would be very useful to have preview-buffer work
on non-latex buffers.

http://www.gnu.org/software/auctex/manual/preview-latex.html#ToDo has
the following paragraph which suggests this might not be trivial:

The current ‘gs.el’ interface is fundamentally flawed, not only because
of a broken implementation. A general batchable and daemonizable
rendering infrastructure that can work on all kinds of preview images
for embedding into buffers is warranted. The current implementation has
a rather adhoc flavor and is not easily extended. It will not work
outside of AUCTeX, either.

An additional convenience would be integration within gnus. Typical use
cases are:

- I receive a plain text mail from someone discussing maths, with inline
  $\frac a b$. Ideally, I would just press a binding that would render the
  maths with preview-buffer.

- I want to send math in an email. I would write inline $\frac a b$, and
  gnus would create a multipart message with the $$s in the plain text
  part, and images in the HTML part.


_______________________________________________
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel

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

* a kludge (was: org-preview-latex-fragment and preview-copy-region-as-mml)
  2012-01-30 11:25 ` Antoine Levitt
@ 2012-01-30 18:23   ` Uwe Brauer
  0 siblings, 0 replies; 3+ messages in thread
From: Uwe Brauer @ 2012-01-30 18:23 UTC (permalink / raw)
  To: auctex-devel; +Cc: emacs-orgmode, ding

[-- Attachment #1: Type: text/plain, Size: 990 bytes --]

>> On Mon, 30 Jan 2012 12:25:13 +0100, Antoine Levitt <antoine.levitt@gmail.com> wrote:

   >> 
   >> Uwe Brauer 

   > (ccing gnus mailing list, in case someone is interested)

   > I ran into that the other day.

   > I think it would be very useful to have preview-buffer work
   > on non-latex buffers.

Concerning org-preview-latex-fragment: I have some code
which indeed attaches the png generated by this
function. However it is very primitive. 

org-preview-latex-fragment generates pngs in a subdirectory
called ltxpng. These pngs are then inserted  in
the buffer where org-preview-latex-fragment was executed. Since
one cannot be sure that the ltxpng  directory is non-empty, IMHO it
should be deleted before generating the png.

This is done by function 
my-delete-ltxpngdir, which needs the trashcan pkg.

Then a very simple modification of an already existing
function does the rest:
message-attach-all-png-from-ltxpngfolder.

I attach it if you want to test it.

Uwe Brauer 


[-- Attachment #2: my-preview-mml-send-png.el --]
[-- Type: application/emacs-lisp, Size: 3158 bytes --]

[-- Attachment #3: Type: text/plain, Size: 147 bytes --]

_______________________________________________
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel

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

end of thread, other threads:[~2012-01-30 18:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-30 10:49 org-preview-latex-fragment and preview-copy-region-as-mml Uwe Brauer
2012-01-30 11:25 ` Antoine Levitt
2012-01-30 18:23   ` a kludge (was: org-preview-latex-fragment and preview-copy-region-as-mml) Uwe Brauer

Code repositories for project(s) associated with this 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).