emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Exporting org-mode source
@ 2014-05-03  5:41 Vikas Rawal
  2014-05-03  7:03 ` Sebastien Vauban
  0 siblings, 1 reply; 13+ messages in thread
From: Vikas Rawal @ 2014-05-03  5:41 UTC (permalink / raw)
  To: org-mode mailing list

I want to export a block of org-mode source code in a tutorial I am writing. 

I have tried variations of the following. But nothing seems to give me org-mode code in the exported pdf.

#+BEGIN_SRC org :results code replace

org-mode code here

#+END_SRC

What is the right way to do it? 

Vikas

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

* Re: Exporting org-mode source
  2014-05-03  5:41 Exporting org-mode source Vikas Rawal
@ 2014-05-03  7:03 ` Sebastien Vauban
  2014-05-04  4:41   ` Vikas Rawal
  0 siblings, 1 reply; 13+ messages in thread
From: Sebastien Vauban @ 2014-05-03  7:03 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Vikas Rawal wrote:
> I want to export a block of org-mode source code in a tutorial I am
> writing.
>
> I have tried variations of the following. But nothing seems to give me
> org-mode code in the exported pdf.
>
> #+BEGIN_SRC org :results code replace
> org-mode code here
> #+END_SRC
>
> What is the right way to do it?

The following Org code block...

#+begin_src org
,#+begin_src <LANGUAGE> <HEADER-ARGS>
<BODY>
,#+end_src
#+end_src

... works for me (that is, is fontified correctly in the HTML export).

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: Exporting org-mode source
  2014-05-03  7:03 ` Sebastien Vauban
@ 2014-05-04  4:41   ` Vikas Rawal
  2014-05-04  5:12     ` Vikas Rawal
  0 siblings, 1 reply; 13+ messages in thread
From: Vikas Rawal @ 2014-05-04  4:41 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: org-mode mailing list

> 
> The following Org code block...
> 
> #+begin_src org
> ,#+begin_src <LANGUAGE> <HEADER-ARGS>
> <BODY>
> ,#+end_src
> #+end_src
> 
> ... works for me (that is, is fontified correctly in the HTML export).
> 


I think I could not express my objective clearly.

I want the org code block to be exported literally. So, for example, I would like the following block to be exported as if it was plain text, * in headlines being exported as such.

#+begin_src org :results replace
,#+begin_src org
** What are the major disputes in the literature
*** adulterated text
Instrument cultivated alteration any favourable expression law far
nor. Both new like tore but year. An from mean on with when sing pain.
Oh to as principles devonshire companions unsatiable an delightful.
The ourselves suffering the sincerity. Inhabit her manners adapted age
certain. Debating offended at branched striking be subjects.
,#+end_src
#+end_src


Vikas

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

* Re: Exporting org-mode source
  2014-05-04  4:41   ` Vikas Rawal
@ 2014-05-04  5:12     ` Vikas Rawal
  2014-05-04  7:57       ` Han Fan
  0 siblings, 1 reply; 13+ messages in thread
From: Vikas Rawal @ 2014-05-04  5:12 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: org-mode mailing list

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

> 
> I think I could not express my objective clearly.
> 
> I want the org code block to be exported literally. So, for example, I would like the following block to be exported as if it was plain text, * in headlines being exported as such.
> 
> #+begin_src org :results replace
> ,#+begin_src org
> ** What are the major disputes in the literature
> *** adulterated text
> Instrument cultivated alteration any favourable expression law far
> nor. Both new like tore but year. An from mean on with when sing pain.
> Oh to as principles devonshire companions unsatiable an delightful.
> The ourselves suffering the sincerity. Inhabit her manners adapted age
> certain. Debating offended at branched striking be subjects.
> ,#+end_src
> #+end_src
> 

This seems to give the best output so far:

: ** What are the major disputes in the literature
: *** adulterated text
: Instrument cultivated alteration any favourable expression law far
: nor. Both new like tore but year. An from mean on with when sing pain.
: Oh to as principles devonshire companions unsatiable an delightful.
: The ourselves suffering the sincerity. Inhabit her manners adapted age
: certain. Debating offended at branched striking be subjects.

Is this the right way? I figures this from worg sources.

Vikas

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

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

* Re: Exporting org-mode source
  2014-05-04  5:12     ` Vikas Rawal
@ 2014-05-04  7:57       ` Han Fan
  2014-05-04  8:04         ` Vikas Rawal
  0 siblings, 1 reply; 13+ messages in thread
From: Han Fan @ 2014-05-04  7:57 UTC (permalink / raw)
  To: emacs-orgmode


Vikas Rawal <vikaslists <at> agrarianresearch.org> writes:


> I think I could not express my objective clearly.I want the org code block 
to be exported literally. 


Indent lines that begin with *, is this what you want?
#+BEGIN_SRC org
 ** What are the major disputes in the literature
 *** adulterated text
 Instrument cultivated alteration any favourable expression law far
 nor. Both new like tore but year. An from mean on with when sing pain.
 Oh to as principles devonshire companions unsatiable an delightful.
 The ourselves suffering the sincerity. Inhabit her manners adapted age
 certain. Debating offended at branched striking be subjects.
#+END_SRC

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

* Re: Exporting org-mode source
  2014-05-04  7:57       ` Han Fan
@ 2014-05-04  8:04         ` Vikas Rawal
  2014-05-04  9:05           ` Han Fan
  2014-05-04  9:11           ` Fletcher Charest
  0 siblings, 2 replies; 13+ messages in thread
From: Vikas Rawal @ 2014-05-04  8:04 UTC (permalink / raw)
  To: Han Fan; +Cc: org-mode mailing list

> 
> Vikas Rawal <vikaslists <at> agrarianresearch.org> writes:
> 
> 
>> I think I could not express my objective clearly.I want the org code block 
> to be exported literally. 
> 
> 
> Indent lines that begin with *, is this what you want?

I am not exactly sure what you are suggesting. The block below does not work for me. It is not exported literally.


> #+BEGIN_SRC org
> ** What are the major disputes in the literature
> *** adulterated text
> Instrument cultivated alteration any favourable expression law far
> nor. Both new like tore but year. An from mean on with when sing pain.
> Oh to as principles devonshire companions unsatiable an delightful.
> The ourselves suffering the sincerity. Inhabit her manners adapted age
> certain. Debating offended at branched striking be subjects.
> #+END_SRC
> 
> 

Vikas

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

* Re: Exporting org-mode source
  2014-05-04  8:04         ` Vikas Rawal
@ 2014-05-04  9:05           ` Han Fan
  2014-05-04  9:11           ` Fletcher Charest
  1 sibling, 0 replies; 13+ messages in thread
From: Han Fan @ 2014-05-04  9:05 UTC (permalink / raw)
  To: emacs-orgmode

Vikas Rawal <vikaslists <at> agrarianresearch.org> writes:

> 
> > 
> > Vikas Rawal <vikaslists <at> agrarianresearch.org> writes:
> > 
> > 
> >> I think I could not express my objective clearly.I want the org code 
block 
> > to be exported literally. 
> > 
> > 
> > Indent lines that begin with *, is this what you want?
> 
> I am not exactly sure what you are suggesting. The block below does not 
work for me. It is not exported literally.
> 
> > #+BEGIN_SRC org
> > ** What are the major disputes in the literature
> > *** adulterated text
> > Instrument cultivated alteration any favourable expression law far
> > nor. Both new like tore but year. An from mean on with when sing pain.
> > Oh to as principles devonshire companions unsatiable an delightful.
> > The ourselves suffering the sincerity. Inhabit her manners adapted age
> > certain. Debating offended at branched striking be subjects.
> > #+END_SRC
> > 
> > 
> 
> Vikas
> 
> 
There is a white space before *, but I didn't see that in your quote, is
that because of your newsgroup reader client?
See the link below:
http://article.gmane.org/gmane.emacs.orgmode/85805
Lines start with * is exported to headings only when there is no white
space before *.

Sorry for my broken English.

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

* Re: Exporting org-mode source
  2014-05-04  8:04         ` Vikas Rawal
  2014-05-04  9:05           ` Han Fan
@ 2014-05-04  9:11           ` Fletcher Charest
  2014-05-04  9:46             ` Han Fan
  1 sibling, 1 reply; 13+ messages in thread
From: Fletcher Charest @ 2014-05-04  9:11 UTC (permalink / raw)
  To: Vikas Rawal; +Cc: org-mode mailing list

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

Hi,

Sorry if I misunderstood... If you create an Org source block like this
with nothing inside:

#+begin_src org

#+end_src

...then, with your cursor inside, enter it with C-c ', write your org tree,
and validate with C-c ' again, then export... Does it do what you want?

FC



On Sun, May 4, 2014 at 10:04 AM, Vikas Rawal <
vikaslists@agrarianresearch.org> wrote:

> >
> > Vikas Rawal <vikaslists <at> agrarianresearch.org> writes:
> >
> >
> >> I think I could not express my objective clearly.I want the org code
> block
> > to be exported literally.
> >
> >
> > Indent lines that begin with *, is this what you want?
>
> I am not exactly sure what you are suggesting. The block below does not
> work for me. It is not exported literally.
>
>
> > #+BEGIN_SRC org
> > ** What are the major disputes in the literature
> > *** adulterated text
> > Instrument cultivated alteration any favourable expression law far
> > nor. Both new like tore but year. An from mean on with when sing pain.
> > Oh to as principles devonshire companions unsatiable an delightful.
> > The ourselves suffering the sincerity. Inhabit her manners adapted age
> > certain. Debating offended at branched striking be subjects.
> > #+END_SRC
> >
> >
>
> Vikas
>

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

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

* Re: Exporting org-mode source
  2014-05-04  9:11           ` Fletcher Charest
@ 2014-05-04  9:46             ` Han Fan
  2014-05-04 22:52               ` Vikas Rawal
  0 siblings, 1 reply; 13+ messages in thread
From: Han Fan @ 2014-05-04  9:46 UTC (permalink / raw)
  To: emacs-orgmode

Fletcher Charest <fletcher.charest@gmail.com> writes:

> Hi,
>
> Sorry if I misunderstood... If you create an Org source block like this with nothing inside:
>
> #+begin_src org
>
> #+end_src
>
> ...then, with your cursor inside, enter it with C-c ', write your org tree, and validate with C-c ' again, then export... Does it do
> what you want?
>
> FC
>
> On Sun, May 4, 2014 at 10:04 AM, Vikas Rawal <vikaslists@agrarianresearch.org> wrote:
>
>     >
>     > Vikas Rawal <vikaslists <at> agrarianresearch.org> writes:
>     >
>     >
>     >> I think I could not express my objective clearly.I want the org code block
>     > to be exported literally.
>     >
>     >
>     > Indent lines that begin with *, is this what you want?
>    
>     I am not exactly sure what you are suggesting. The block below does not work for me. It is not exported literally.
>
>     > #+BEGIN_SRC org
>     > ** What are the major disputes in the literature
>     > *** adulterated text
>     > Instrument cultivated alteration any favourable expression law far
>     > nor. Both new like tore but year. An from mean on with when sing pain.
>     > Oh to as principles devonshire companions unsatiable an delightful.
>     > The ourselves suffering the sincerity. Inhabit her manners adapted age
>     > certain. Debating offended at branched striking be subjects.
>     > #+END_SRC
>     >
>     >
>    
>     Vikas

Perfect solution.

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

* Re: Exporting org-mode source
  2014-05-04  9:46             ` Han Fan
@ 2014-05-04 22:52               ` Vikas Rawal
  2014-05-08  8:07                 ` Sebastien Vauban
  0 siblings, 1 reply; 13+ messages in thread
From: Vikas Rawal @ 2014-05-04 22:52 UTC (permalink / raw)
  To: Han Fan; +Cc: org-mode mailing list


On 04-May-2014, at 11:46 am, Han Fan <visayafan@gmail.com> wrote:

> Fletcher Charest <fletcher.charest@gmail.com> writes:
> 
>> Hi,
>> 
>> Sorry if I misunderstood... If you create an Org source block like this with nothing inside:
>> 
>> #+begin_src org
>> 
>> #+end_src
>> 
>> ...then, with your cursor inside, enter it with C-c ', write your org tree, and validate with C-c ' again, then export... Does it do
>> what you want?
>> 
>> FC
> 
This is what works for me

#+begin_src org :exports code

#+end_src

It does not work without ":exports code”

I found the solution here: http://lists.gnu.org/archive/html/emacs-orgmode/2011-01/msg01117.html

Vikas

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

* Re: Exporting org-mode source
  2014-05-04 22:52               ` Vikas Rawal
@ 2014-05-08  8:07                 ` Sebastien Vauban
  2014-05-08  8:17                   ` Vikas Rawal
  0 siblings, 1 reply; 13+ messages in thread
From: Sebastien Vauban @ 2014-05-08  8:07 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Vikas Rawal wrote:
> On 04-May-2014, at 11:46 am, Han Fan <visayafan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> Fletcher Charest <fletcher.charest-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>> 
>>> Sorry if I misunderstood... If you create an Org source block like
>>> this with nothing inside:
>>> 
>>> #+begin_src org
>>> 
>>> #+end_src
>>> 
>>> ...then, with your cursor inside, enter it with C-c ', write your
>>> org tree, and validate with C-c ' again, then export... Does it do
>>> what you want?
> 
> This is what works for me
>
> #+begin_src org :exports code
>
> #+end_src
>
> It does not work without ":exports code”

I don't understand that, as ":exports code" is the default for Org code
blocks, as shown by:

  ╭────
  │ org-babel-default-header-args:org is a variable defined in `ob-org.el'.
  │ Its value is ((:results . "raw silent") (:exports . "code"))
  │
  │ Documentation:
  │ Default arguments for evaluating a org source block.
  ╰────

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: Exporting org-mode source
  2014-05-08  8:07                 ` Sebastien Vauban
@ 2014-05-08  8:17                   ` Vikas Rawal
  2014-05-08  9:05                     ` Sebastien Vauban
  0 siblings, 1 reply; 13+ messages in thread
From: Vikas Rawal @ 2014-05-08  8:17 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: org-mode mailing list

>> 
>> It does not work without ":exports code”
> 
> I don't understand that, as ":exports code" is the default for Org code
> blocks, as shown by:
> 
>  ╭────
>  │ org-babel-default-header-args:org is a variable defined in `ob-org.el'.
>  │ Its value is ((:results . "raw silent") (:exports . "code"))
>  │
>  │ Documentation:
>  │ Default arguments for evaluating a org source block.
>  ╰────

Indeed, my bad.

I had "#+property: exports results” in the file header, something that I have been routinely copying from one file to another, since usually do not want to export code.

Sorry.

Vikas

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

* Re: Exporting org-mode source
  2014-05-08  8:17                   ` Vikas Rawal
@ 2014-05-08  9:05                     ` Sebastien Vauban
  0 siblings, 0 replies; 13+ messages in thread
From: Sebastien Vauban @ 2014-05-08  9:05 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Vikas Rawal wrote:
>>> It does not work without ":exports code”
>> 
>> I don't understand that, as ":exports code" is the default for Org code
>> blocks, as shown by:
>> 
>>  ╭────
>>  │ org-babel-default-header-args:org is a variable defined in `ob-org.el'.
>>  │ Its value is ((:results . "raw silent") (:exports . "code"))
>>  │
>>  │ Documentation:
>>  │ Default arguments for evaluating a org source block.
>>  ╰────
>
> Indeed, my bad.
>
> I had "#+property: exports results” in the file header, something that I have
> been routinely copying from one file to another, since usually do not want to
> export code.
>
> Sorry.

Indeed, that explains a lot of the misunderstandings!

Best regards,
  Seb

-- 
Sebastien Vauban

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

end of thread, other threads:[~2014-05-08  9:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-03  5:41 Exporting org-mode source Vikas Rawal
2014-05-03  7:03 ` Sebastien Vauban
2014-05-04  4:41   ` Vikas Rawal
2014-05-04  5:12     ` Vikas Rawal
2014-05-04  7:57       ` Han Fan
2014-05-04  8:04         ` Vikas Rawal
2014-05-04  9:05           ` Han Fan
2014-05-04  9:11           ` Fletcher Charest
2014-05-04  9:46             ` Han Fan
2014-05-04 22:52               ` Vikas Rawal
2014-05-08  8:07                 ` Sebastien Vauban
2014-05-08  8:17                   ` Vikas Rawal
2014-05-08  9:05                     ` Sebastien Vauban

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