emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] dot in pdf directly
@ 2009-11-09 21:16 andrea Crotti
  2009-11-09 22:24 ` Sebastian Rose
  0 siblings, 1 reply; 10+ messages in thread
From: andrea Crotti @ 2009-11-09 21:16 UTC (permalink / raw)
  To: emacs-orgmode

Still a couple of questions, I found something here
in the newsgroup but nothing helped me...

First, how many and where can I find all the possible

#+begin_...?

I mean why is
#+begin_dot and not

#+begin_src dot?

I would like to insert my dot info and on exporting getting a pdf with
embedded the generated eps, it would be great!

I don't have very clear the grammar I can use in the #+begin_.. line,
is there a clear explanation somewhere?

Thanks for the fantastic work!

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

* Re: [babel] dot in pdf directly
  2009-11-09 21:16 [babel] dot in pdf directly andrea Crotti
@ 2009-11-09 22:24 ` Sebastian Rose
  2009-11-10  1:13   ` Eric Schulte
  0 siblings, 1 reply; 10+ messages in thread
From: Sebastian Rose @ 2009-11-09 22:24 UTC (permalink / raw)
  To: andrea Crotti; +Cc: emacs-orgmode

andrea Crotti <andrea.crotti.0@gmail.com> writes:
> Still a couple of questions, I found something here
> in the newsgroup but nothing helped me...
>
> First, how many and where can I find all the possible
>
> #+begin_...?
>
> I mean why is
> #+begin_dot and not
>
> #+begin_src dot?
>
> I would like to insert my dot info and on exporting getting a pdf with
> embedded the generated eps, it would be great!
>
> I don't have very clear the grammar I can use in the #+begin_.. line,
> is there a clear explanation somewhere?


The difference is, 

   #+begin_src mode-name

just tells the exporter that the following block is a `mode-name' block,
where mode-name == the name of the emacs mode you'd use to edit a file
in that language.

This handy if you want to edit the block's contents (C-c '). Eventually,
the source code inside the block will be highlighted on export to
XHTML. The mode is important then, too. Contents of blocks like this are
exported verbatim.




In contrast, blocks like

   #+begin_ditaa

will never export verbatim. Instead, the contents are treated specially
or even send to an external program, that will create an image (e.g. -
in most cases), that will in turn replace the block in the exported
result.


  Sebastian

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

* Re: [babel] dot in pdf directly
  2009-11-09 22:24 ` Sebastian Rose
@ 2009-11-10  1:13   ` Eric Schulte
  2009-11-10  6:20     ` andrea Crotti
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Schulte @ 2009-11-10  1:13 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: emacs-orgmode, andrea Crotti

Sebastian Rose <sebastian_rose@gmx.de> writes:

> andrea Crotti <andrea.crotti.0@gmail.com> writes:
>> Still a couple of questions, I found something here
>> in the newsgroup but nothing helped me...
>>
>> First, how many and where can I find all the possible
>>
>> #+begin_...?
>>
>> I mean why is
>> #+begin_dot and not
>>
>> #+begin_src dot?
>>
>> I would like to insert my dot info and on exporting getting a pdf with
>> embedded the generated eps, it would be great!
>>
>> I don't have very clear the grammar I can use in the #+begin_.. line,
>> is there a clear explanation somewhere?
>
>
> The difference is, 
>
>    #+begin_src mode-name
>
> just tells the exporter that the following block is a `mode-name' block,
> where mode-name == the name of the emacs mode you'd use to edit a file
> in that language.
>
> This handy if you want to edit the block's contents (C-c '). Eventually,
> the source code inside the block will be highlighted on export to
> XHTML. The mode is important then, too. Contents of blocks like this are
> exported verbatim.
>
>
>
>
> In contrast, blocks like
>
>    #+begin_ditaa
>
> will never export verbatim. Instead, the contents are treated specially
> or even send to an external program, that will create an image (e.g. -
> in most cases), that will in turn replace the block in the exported
> result.
>
>

The exception to the above is that *if* you have org-babel loaded, then
some begin_src blocks will become activated.  The source blocks
activated by org-babel are the contents of the variable
`org-babel-interpreters'.  They can be used to activate for example dot
blocks, and will then have the result of possibly evaluating dot blocks
on export in the same manner as org-exp-blocks.

The two separate mechanisms are confusion, but for now are necessary to
allow org-mode users to evaluate some simple block types (like dot) on
export without having to load up all of org-babel.

I hope the above isn't too confusing :) -- Eric

>
>   Sebastian
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [babel] dot in pdf directly
  2009-11-10  1:13   ` Eric Schulte
@ 2009-11-10  6:20     ` andrea Crotti
  2009-11-10 14:40       ` Sebastian Rose
  0 siblings, 1 reply; 10+ messages in thread
From: andrea Crotti @ 2009-11-10  6:20 UTC (permalink / raw)
  To: emacs-orgmode

Eric Schulte <schulte.eric <at> gmail.com> writes:

> 
> The two separate mechanisms are confusion, but for now are necessary to
> allow org-mode users to evaluate some simple block types (like dot) on
> export without having to load up all of org-babel.
> 
> I hope the above isn't too confusing :) -- Eric
> 


No no thanks a lot not it's very clear.
Coming back to my original question, am I able to insert directly
the eps generated in my final generated pdf??

Maybe I have to
#+begin_dot -Tpdf -o file.pdf
...
#+end_dot

And then somewhere write some latex code to include it?
#+begin_latex
\includegraphics..
#+end_latex

or can it even be easier?

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

* Re: Re: [babel] dot in pdf directly
  2009-11-10  6:20     ` andrea Crotti
@ 2009-11-10 14:40       ` Sebastian Rose
  2009-11-10 15:41         ` Eric Schulte
  0 siblings, 1 reply; 10+ messages in thread
From: Sebastian Rose @ 2009-11-10 14:40 UTC (permalink / raw)
  To: andrea Crotti; +Cc: emacs-orgmode

andrea Crotti <andrea.crotti.0@gmail.com> writes:
> Eric Schulte <schulte.eric <at> gmail.com> writes:
>
>> 
>> The two separate mechanisms are confusion, but for now are necessary to
>> allow org-mode users to evaluate some simple block types (like dot) on
>> export without having to load up all of org-babel.
>> 
>> I hope the above isn't too confusing :) -- Eric
>> 
>
>
> No no thanks a lot not it's very clear.
> Coming back to my original question, am I able to insert directly
> the eps generated in my final generated pdf??
>
> Maybe I have to
> #+begin_dot -Tpdf -o file.pdf
> ...
> #+end_dot
>
> And then somewhere write some latex code to include it?
> #+begin_latex
> \includegraphics..
> #+end_latex

Yes, you can include the eps image like this at any point - not sure if
you need to run the export twice, once the dot block changes.


But the dot block itself will always be executed and replaced by the
resulting image. This is absolutely fine in 99% of all cases.

Suppose you want to refer to the image several times, how about this
then: 

   1. Create a file your-org-directory/images/images.org
   2. Put all images into that file, that you need to reference more
      than once, or that you need to be out of sight to avoid clutter.
   3. Include your images using the relative path to
      ../your-org-directory/images/resulting-image.eps 




Sebastian

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

* Re: Re: [babel] dot in pdf directly
  2009-11-10 14:40       ` Sebastian Rose
@ 2009-11-10 15:41         ` Eric Schulte
  2009-11-10 17:13           ` andrea Crotti
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Schulte @ 2009-11-10 15:41 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: emacs-orgmode, andrea Crotti

Sebastian Rose <sebastian_rose@gmx.de> writes:

> andrea Crotti <andrea.crotti.0@gmail.com> writes:
>> Eric Schulte <schulte.eric <at> gmail.com> writes:
>>
>>> 
>>> The two separate mechanisms are confusion, but for now are necessary to
>>> allow org-mode users to evaluate some simple block types (like dot) on
>>> export without having to load up all of org-babel.
>>> 
>>> I hope the above isn't too confusing :) -- Eric
>>> 
>>
>>
>> No no thanks a lot not it's very clear.
>> Coming back to my original question, am I able to insert directly
>> the eps generated in my final generated pdf??
>>
>> Maybe I have to
>> #+begin_dot -Tpdf -o file.pdf
>> ...
>> #+end_dot
>>
>> And then somewhere write some latex code to include it?
>> #+begin_latex
>> \includegraphics..
>> #+end_latex
>
> Yes, you can include the eps image like this at any point - not sure if
> you need to run the export twice, once the dot block changes.
>
>
> But the dot block itself will always be executed and replaced by the
> resulting image. This is absolutely fine in 99% of all cases.
>
> Suppose you want to refer to the image several times, how about this
> then: 
>
>    1. Create a file your-org-directory/images/images.org
>    2. Put all images into that file, that you need to reference more
>       than once, or that you need to be out of sight to avoid clutter.
>    3. Include your images using the relative path to
>       ../your-org-directory/images/resulting-image.eps 
>

Note that the solution I'm about to propose relies on the use of
org-babel and #+begin_src dot blocks rather than #+begin_dot blocks.

When in these situations I will often set the block so that neither the
code or the resulting image is exported, and so that the results of
block evaluation are silent.

#+begin_src dot :file file.pdf :cmdline -Tpdf :exports none :results silent
...
#+end_src

Then I manually add file links to the image throughout my document.

[[file:file.pdf]]

Whenever I change the contents of the block I manually re-evaluate the
block with C-c C-c and the image to which all of the links point is
updated.

Best -- Eric

>
>
>
>
> Sebastian
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [babel] dot in pdf directly
  2009-11-10 15:41         ` Eric Schulte
@ 2009-11-10 17:13           ` andrea Crotti
  2009-11-10 19:10             ` Eric Schulte
  0 siblings, 1 reply; 10+ messages in thread
From: andrea Crotti @ 2009-11-10 17:13 UTC (permalink / raw)
  To: emacs-orgmode

Eric Schulte <schulte.eric <at> gmail.com> writes:

> Note that the solution I'm about to propose relies on the use of
> org-babel and #+begin_src dot blocks rather than #+begin_dot blocks.
> 
> When in these situations I will often set the block so that neither the
> code or the resulting image is exported, and so that the results of
> block evaluation are silent.
> 
> #+begin_src dot :file file.pdf :cmdline -Tpdf :exports none :results silent
> ...
> #+end_src
> 
> Then I manually add file links to the image throughout my document.
> 
> [[file:file.pdf]]
> 
> Whenever I change the contents of the block I manually re-evaluate the
> block with C-c C-c and the image to which all of the links point is
> updated.
> 
> Best -- Eric
> 

Ok that's really perfect!
The only "problem" is that it keeps exporting the code even without
the :exports none, maybe I need some newlines?

**** s2
#+BEGIN_SRC dot :file s2.pdf :cmdline -Tpdf :exports none :results silent
    digraph s1 {
    t1;
    t2;
    }
#+END_SRC

    [[file:s2.pdf]]

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

* Re: Re: [babel] dot in pdf directly
  2009-11-10 17:13           ` andrea Crotti
@ 2009-11-10 19:10             ` Eric Schulte
  2009-11-12 18:35               ` andrea Crotti
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Schulte @ 2009-11-10 19:10 UTC (permalink / raw)
  To: andrea Crotti; +Cc: emacs-orgmode

andrea Crotti <andrea.crotti.0@gmail.com> writes:

> Eric Schulte <schulte.eric <at> gmail.com> writes:
>
>> Note that the solution I'm about to propose relies on the use of
>> org-babel and #+begin_src dot blocks rather than #+begin_dot blocks.
>> 
>> When in these situations I will often set the block so that neither the
>> code or the resulting image is exported, and so that the results of
>> block evaluation are silent.
>> 
>> #+begin_src dot :file file.pdf :cmdline -Tpdf :exports none :results silent
>> ...
>> #+end_src
>> 
>> Then I manually add file links to the image throughout my document.
>> 
>> [[file:file.pdf]]
>> 
>> Whenever I change the contents of the block I manually re-evaluate the
>> block with C-c C-c and the image to which all of the links point is
>> updated.
>> 
>> Best -- Eric
>> 
>
> Ok that's really perfect!
> The only "problem" is that it keeps exporting the code even without
> the :exports none, maybe I need some newlines?
>
> **** s2
> #+BEGIN_SRC dot :file s2.pdf :cmdline -Tpdf :exports none :results silent
>     digraph s1 {
>     t1;
>     t2;
>     }
> #+END_SRC
>
>     [[file:s2.pdf]]
>

Hi Andrea,

there was a bug related to capitalization in org-exp-blocks, I've fixed
this bug in the head of the org-mode git repo.  Please grab the latest
org-mode and see if you problem persists.

Best -- Eric

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

* Re: [babel] dot in pdf directly
  2009-11-10 19:10             ` Eric Schulte
@ 2009-11-12 18:35               ` andrea Crotti
  2009-11-12 18:43                 ` Julien Barnier
  0 siblings, 1 reply; 10+ messages in thread
From: andrea Crotti @ 2009-11-12 18:35 UTC (permalink / raw)
  To: emacs-orgmode

A question about updating org...
I also have all my .emacs.d under git, so if I put
the whole org-mode in it (46M) I wast a lot of space.
But if I don't then every time I can't just "git pull" but I need more
operations, which can be annoying, how do you deal with it?

For the capitalization I could also always write not capitalized,
it's not a problem.
Given I've always seen the org directives capitalized I thought it 
would be better..
Andrea

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

* Re: [babel] dot in pdf directly
  2009-11-12 18:35               ` andrea Crotti
@ 2009-11-12 18:43                 ` Julien Barnier
  0 siblings, 0 replies; 10+ messages in thread
From: Julien Barnier @ 2009-11-12 18:43 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

> A question about updating org...
> I also have all my .emacs.d under git, so if I put
> the whole org-mode in it (46M) I wast a lot of space.
> But if I don't then every time I can't just "git pull" but I need more
> operations, which can be annoying, how do you deal with it?

In my experience git deals very well with imbricated .git working
directory. If your .emacs.d is unde git version control, putting your
org-mode git folder in yout .emacs.d .gitignore file should be enough.

HTH,

-- 
Julien

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

end of thread, other threads:[~2009-11-12 18:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-09 21:16 [babel] dot in pdf directly andrea Crotti
2009-11-09 22:24 ` Sebastian Rose
2009-11-10  1:13   ` Eric Schulte
2009-11-10  6:20     ` andrea Crotti
2009-11-10 14:40       ` Sebastian Rose
2009-11-10 15:41         ` Eric Schulte
2009-11-10 17:13           ` andrea Crotti
2009-11-10 19:10             ` Eric Schulte
2009-11-12 18:35               ` andrea Crotti
2009-11-12 18:43                 ` Julien Barnier

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