emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Embedding an image in base64; exporting to ascii, html, and latex?
@ 2014-04-07 20:01 Grant Rettke
  2014-04-08  1:43 ` Skip Collins
  2014-04-17 15:40 ` Bastien
  0 siblings, 2 replies; 8+ messages in thread
From: Grant Rettke @ 2014-04-07 20:01 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

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

Hi,

Got curious about how one might embed an image in base64 encoding inside an
org mode document and allow export
to asciii, html, and latex.

Goal is to keep the document all-in-one; so that users may work with the
document
and "worry about nothing else beyond that one document".

Perhaps this isn't a new or good idea?

Has it been done before?

Searching yielded no results.

Regards,

Grant Rettke | AAAS, ACM, AMA, COG, FSF, IEEE, Sigma Xi
grettke@acm.org | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson

[-- Attachment #2: Type: text/html, Size: 1110 bytes --]

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

* Re: Embedding an image in base64; exporting to ascii, html, and latex?
  2014-04-07 20:01 Embedding an image in base64; exporting to ascii, html, and latex? Grant Rettke
@ 2014-04-08  1:43 ` Skip Collins
  2014-04-17 15:40 ` Bastien
  1 sibling, 0 replies; 8+ messages in thread
From: Skip Collins @ 2014-04-08  1:43 UTC (permalink / raw)
  To: Grant Rettke; +Cc: emacs-orgmode@gnu.org

On Mon, Apr 7, 2014 at 4:01 PM, Grant Rettke <gcr@wisdomandwonder.com> wrote:
> Goal is to keep the document all-in-one

Maybe have a look at this proposal for a zipped up org format, sort of
like docx for MS Word:
http://comments.gmane.org/gmane.emacs.orgmode/75454
It looks like there was some an attempt to implement the proposal.

Using a zip file with a more-or-less standardized structure might help
make org files, images, and configurations more portable.

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

* Re: Embedding an image in base64; exporting to ascii, html, and latex?
  2014-04-07 20:01 Embedding an image in base64; exporting to ascii, html, and latex? Grant Rettke
  2014-04-08  1:43 ` Skip Collins
@ 2014-04-17 15:40 ` Bastien
  2014-04-17 18:38   ` Skip Collins
  1 sibling, 1 reply; 8+ messages in thread
From: Bastien @ 2014-04-17 15:40 UTC (permalink / raw)
  To: Grant Rettke; +Cc: emacs-orgmode@gnu.org

Hi Grant,

Grant Rettke <gcr@wisdomandwonder.com> writes:

> Got curious about how one might embed an image in base64 encoding
> inside an org mode document and allow export
> to asciii, html, and latex.

I somehow remember Ken Mankoff suggested this a while ago.

I see how base64 images can be used for HTML, but I don't know
how to use them for LaTeX -- and I doubt it makes sense.  But for
HTML, yes, we can explore this feature... on my MAYBE list!

Thanks,

-- 
 Bastien

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

* Re: Embedding an image in base64; exporting to ascii, html, and latex?
  2014-04-17 15:40 ` Bastien
@ 2014-04-17 18:38   ` Skip Collins
  2014-04-17 18:49     ` Bastien
  0 siblings, 1 reply; 8+ messages in thread
From: Skip Collins @ 2014-04-17 18:38 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode@gnu.org, Grant Rettke

> I see how base64 images can be used for HTML, but I don't know
> how to use them for LaTeX -- and I doubt it makes sense.  But for
> HTML, yes, we can explore this feature... on my MAYBE list!

I would vote against inclusion of ascii-encoded binary files in org.
This violates the "it's just text" spirit of org.

On the other hand, it would be very nice for org-mode to support the
inclusion of org files in a zipped container. Developing a standard
folder structure to include images and other files in a single ".orgz"
that could be directly edited in emacs would be wonderful. This could
be very useful for doing reproducible research. It would allow easy
file exchange. Inclusion of specific export formats could also be
easily supported.

A quick test show that Emacs Archive mode already allows editing of
org files contained in zip files. Using external programs such as
latex almost works. An exported pdf file is generated correctly, but
it ends up not inside the zip file, but in the same folder that
contains the zip file. It has a name that starts with the zip
filename, but it has "/" and the intended name of the pdf file
appended.

It might not be that much work to fix export code and image import
macros to fully support a standard org archive format.

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

* Re: Embedding an image in base64; exporting to ascii, html, and latex?
  2014-04-17 18:38   ` Skip Collins
@ 2014-04-17 18:49     ` Bastien
  2014-04-18 13:27       ` Skip Collins
  0 siblings, 1 reply; 8+ messages in thread
From: Bastien @ 2014-04-17 18:49 UTC (permalink / raw)
  To: Skip Collins; +Cc: emacs-orgmode@gnu.org, Grant Rettke

Skip Collins <skip.collins@gmail.com> writes:

> On the other hand, it would be very nice for org-mode to support the
> inclusion of org files in a zipped container.

How would that be different that zipping org files along with pictures
and related needed content?

-- 
 Bastien

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

* Re: Embedding an image in base64; exporting to ascii, html, and latex?
  2014-04-17 18:49     ` Bastien
@ 2014-04-18 13:27       ` Skip Collins
  2014-04-18 13:37         ` Bastien
  2014-04-19 20:37         ` John Kitchin
  0 siblings, 2 replies; 8+ messages in thread
From: Skip Collins @ 2014-04-18 13:27 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode@gnu.org, Grant Rettke

On Thu, Apr 17, 2014 at 2:49 PM, Bastien <bzg@gnu.org> wrote:
> How would that be different that zipping org files along with pictures
> and related needed content?

Not different at all. Integrating the zipping into org-mode itself
could standardize the process and make it more
repeatable, portable, and convenient. Microsoft Word .docx files have
something like this structure inside:
.
├── [Content_Types].xml
├── _rels
├── docProps
│   ├── app.xml
│   ├── core.xml
│   └── thumbnail.jpeg
└── word
    ├── _rels
    │   └── document.xml.rels
    ├── document.xml
    ├── fontTable.xml
    ├── media
    │   └── image1.png
    ├── settings.xml
    ├── styles.xml
    ├── stylesWithEffects.xml
    ├── theme
    │   └── theme1.xml
    └── webSettings.xml

An analogous structure inside a filename.orgz container might be
useful. Perhaps something like:
.
├── orgmain.org
├── config.org
├── media
│   └── image1.png
├── elisp
│   ├── init.el
│   └── myorgmacros.el
├── babel
└── export
    ├── styles
    └── output
        ├── orgmain.pdf
        └── orgmain.html

A little elisp wizardry could ensure that invoking
emacs filename.orgz
would actually open and edit orgmain.org inside filename.orgz.

Much of the tree structure could be optional, only included when
certain features are used. Obviously, it would be necessary to put
exported files outside of the .orgz file. But optionally including a
copy inside could be useful. More important would be the inclusion of
all non-standard input files needed to generate the output, things
like images, elisp files, latex and html style files, etc. Maybe even
a copy of the Emacs initialization file used when saving the container
file. Finally, a standardized format for config.org would include
things like Emacs version, Org version, creation date, modification
date, a list of manually included files, etc.

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

* Re: Embedding an image in base64; exporting to ascii, html, and latex?
  2014-04-18 13:27       ` Skip Collins
@ 2014-04-18 13:37         ` Bastien
  2014-04-19 20:37         ` John Kitchin
  1 sibling, 0 replies; 8+ messages in thread
From: Bastien @ 2014-04-18 13:37 UTC (permalink / raw)
  To: Skip Collins; +Cc: emacs-orgmode@gnu.org, Grant Rettke

Hi Skip,

I now see how this could be useful for sharing documents with
Org files and Emacs configuration bits, but I doubt this would
prove really useful: in LibreOffice, the bundle makes sense
because it contains all what people need for both reading and
writing docs; while in Emacs land, Org are more for writing
and their PDF/HTML output for reading...  not sure if my point
is clear, I hope so -- that said, I like your idea and would
be glad to see how it could work practically.

-- 
 Bastien

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

* Re: Embedding an image in base64; exporting to ascii, html, and latex?
  2014-04-18 13:27       ` Skip Collins
  2014-04-18 13:37         ` Bastien
@ 2014-04-19 20:37         ` John Kitchin
  1 sibling, 0 replies; 8+ messages in thread
From: John Kitchin @ 2014-04-19 20:37 UTC (permalink / raw)
  To: Skip Collins; +Cc: Bastien, emacs-orgmode@gnu.org, Grant Rettke

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

I wrote some code that does some of this here:
http://kitchingroup.cheme.cmu.edu/blog/2014/03/05/Creating-a-transportable-zip-archive-of-an-org-file/

It doesn't do anything fancy like you describe, but it does get images and
files into the zip file.

John

-----------------------------------
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



On Fri, Apr 18, 2014 at 9:27 AM, Skip Collins <skip.collins@gmail.com>wrote:

> On Thu, Apr 17, 2014 at 2:49 PM, Bastien <bzg@gnu.org> wrote:
> > How would that be different that zipping org files along with pictures
> > and related needed content?
>
> Not different at all. Integrating the zipping into org-mode itself
> could standardize the process and make it more
> repeatable, portable, and convenient. Microsoft Word .docx files have
> something like this structure inside:
> .
> ├── [Content_Types].xml
> ├── _rels
> ├── docProps
> │   ├── app.xml
> │   ├── core.xml
> │   └── thumbnail.jpeg
> └── word
>     ├── _rels
>     │   └── document.xml.rels
>     ├── document.xml
>     ├── fontTable.xml
>     ├── media
>     │   └── image1.png
>     ├── settings.xml
>     ├── styles.xml
>     ├── stylesWithEffects.xml
>     ├── theme
>     │   └── theme1.xml
>     └── webSettings.xml
>
> An analogous structure inside a filename.orgz container might be
> useful. Perhaps something like:
> .
> ├── orgmain.org
> ├── config.org
> ├── media
> │   └── image1.png
> ├── elisp
> │   ├── init.el
> │   └── myorgmacros.el
> ├── babel
> └── export
>     ├── styles
>     └── output
>         ├── orgmain.pdf
>         └── orgmain.html
>
> A little elisp wizardry could ensure that invoking
> emacs filename.orgz
> would actually open and edit orgmain.org inside filename.orgz.
>
> Much of the tree structure could be optional, only included when
> certain features are used. Obviously, it would be necessary to put
> exported files outside of the .orgz file. But optionally including a
> copy inside could be useful. More important would be the inclusion of
> all non-standard input files needed to generate the output, things
> like images, elisp files, latex and html style files, etc. Maybe even
> a copy of the Emacs initialization file used when saving the container
> file. Finally, a standardized format for config.org would include
> things like Emacs version, Org version, creation date, modification
> date, a list of manually included files, etc.
>
>

[-- Attachment #2: Type: text/html, Size: 3797 bytes --]

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

end of thread, other threads:[~2014-04-19 20:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-07 20:01 Embedding an image in base64; exporting to ascii, html, and latex? Grant Rettke
2014-04-08  1:43 ` Skip Collins
2014-04-17 15:40 ` Bastien
2014-04-17 18:38   ` Skip Collins
2014-04-17 18:49     ` Bastien
2014-04-18 13:27       ` Skip Collins
2014-04-18 13:37         ` Bastien
2014-04-19 20:37         ` John Kitchin

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).