* "Generic" Source block language specification? @ 2012-11-21 14:08 Rainer M Krug 2012-11-22 23:17 ` Eric Schulte 2012-11-23 18:11 ` Jambunathan K 0 siblings, 2 replies; 13+ messages in thread From: Rainer M Krug @ 2012-11-21 14:08 UTC (permalink / raw) To: emacs-orgmode -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi I have in a document a definition of a projection, which is essentially a text as follow: #+BEGIN_src +proj=aea +lat_1=-28.25 +lat_2=-29.75 +lat_0=29 +lon_0=30.75 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs #+END_src Now this does obviously not export, as the source block language is missing. Is there a way that I can get the same formating of the source in the exportes output but without the syntax highlighting? BEGIN_EXAMPLE END_EXAMPLE is similar, but I would like the block to be formated as the SRC blocks. Thanks, Rainer - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlCs4F8ACgkQoYgNqgF2egpPpACfXJXUHN58kG2geD0AfJXm0/uD yEQAnRQHlfgj5tZ5zjPNd1Bkt+JiDlP5 =rkEH -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: "Generic" Source block language specification? 2012-11-21 14:08 "Generic" Source block language specification? Rainer M Krug @ 2012-11-22 23:17 ` Eric Schulte 2012-11-23 8:17 ` Rainer M Krug 2012-11-23 18:11 ` Jambunathan K 1 sibling, 1 reply; 13+ messages in thread From: Eric Schulte @ 2012-11-22 23:17 UTC (permalink / raw) To: Rainer; +Cc: emacs-orgmode Rainer M Krug <r.m.krug@gmail.com> writes: > Hi > > I have in a document a definition of a projection, which is essentially a text as follow: > > #+BEGIN_src > +proj=aea +lat_1=-28.25 > +lat_2=-29.75 > +lat_0=29 > +lon_0=30.75 > +x_0=0 > +y_0=0 > +datum=WGS84 > +units=m > +no_defs > #+END_src > > Now this does obviously not export, as the source block language is missing. Is there a way that I > can get the same formating of the source in the exportes output but without the syntax highlighting? > > BEGIN_EXAMPLE > END_EXAMPLE > > is similar, but I would like the block to be formated as the SRC blocks. > I bet "fundamental" would work, e.g., #+begin_src fundamental +proj=aea +lat_1=-28.25 +lat_2=-29.75 +lat_0=29 +lon_0=30.75 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs #+end_src > > Thanks, > > Rainer -- Eric Schulte http://cs.unm.edu/~eschulte ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: "Generic" Source block language specification? 2012-11-22 23:17 ` Eric Schulte @ 2012-11-23 8:17 ` Rainer M Krug 2012-11-23 15:02 ` Eric Schulte 0 siblings, 1 reply; 13+ messages in thread From: Rainer M Krug @ 2012-11-23 8:17 UTC (permalink / raw) To: Eric Schulte; +Cc: emacs-orgmode -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 23/11/12 00:17, Eric Schulte wrote: > Rainer M Krug <r.m.krug@gmail.com> writes: > >> Hi >> >> I have in a document a definition of a projection, which is essentially a text as follow: >> >> #+BEGIN_src +proj=aea +lat_1=-28.25 +lat_2=-29.75 +lat_0=29 +lon_0=30.75 +x_0=0 +y_0=0 >> +datum=WGS84 +units=m +no_defs #+END_src >> >> Now this does obviously not export, as the source block language is missing. Is there a way >> that I can get the same formating of the source in the exportes output but without the syntax >> highlighting? >> >> BEGIN_EXAMPLE END_EXAMPLE >> >> is similar, but I would like the block to be formated as the SRC blocks. >> > > I bet "fundamental" would work, e.g., Yes, it does - works perfectly. Is this documented? Thanks, Rainer > > #+begin_src fundamental +proj=aea +lat_1=-28.25 +lat_2=-29.75 +lat_0=29 +lon_0=30.75 +x_0=0 > +y_0=0 +datum=WGS84 +units=m +no_defs #+end_src > >> >> Thanks, >> >> Rainer > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlCvMSIACgkQoYgNqgF2egpKrQCdFYFJKZ/f7Ix+XOrO3sv2qpno wwoAnjz66rQYFBr0+Wr699pdrBx8aGT1 =NPZQ -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: "Generic" Source block language specification? 2012-11-23 8:17 ` Rainer M Krug @ 2012-11-23 15:02 ` Eric Schulte 2012-11-23 15:26 ` Rainer M Krug 0 siblings, 1 reply; 13+ messages in thread From: Eric Schulte @ 2012-11-23 15:02 UTC (permalink / raw) To: Rainer M Krug; +Cc: emacs-orgmode Rainer M Krug <r.m.krug@gmail.com> writes: > On 23/11/12 00:17, Eric Schulte wrote: >> Rainer M Krug <r.m.krug@gmail.com> writes: >> >>> Hi >>> >>> I have in a document a definition of a projection, which is essentially a text as follow: >>> >>> #+BEGIN_src +proj=aea +lat_1=-28.25 +lat_2=-29.75 +lat_0=29 +lon_0=30.75 +x_0=0 +y_0=0 >>> +datum=WGS84 +units=m +no_defs #+END_src >>> >>> Now this does obviously not export, as the source block language is missing. Is there a way >>> that I can get the same formating of the source in the exportes output but without the syntax >>> highlighting? >>> >>> BEGIN_EXAMPLE END_EXAMPLE >>> >>> is similar, but I would like the block to be formated as the SRC blocks. >>> >> >> I bet "fundamental" would work, e.g., > > Yes, it does - works perfectly. Is this documented? > Yes. Whatever language string is placed at the top of the source block will define the mode used for export and in-block editing. I believe that is documented. Cheers, > > Thanks, > > Rainer > >> >> #+begin_src fundamental +proj=aea +lat_1=-28.25 +lat_2=-29.75 +lat_0=29 +lon_0=30.75 +x_0=0 >> +y_0=0 +datum=WGS84 +units=m +no_defs #+end_src >> >>> >>> Thanks, >>> >>> Rainer >> > -- Eric Schulte http://cs.unm.edu/~eschulte ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: "Generic" Source block language specification? 2012-11-23 15:02 ` Eric Schulte @ 2012-11-23 15:26 ` Rainer M Krug 2012-11-23 16:40 ` Eric Schulte 2012-11-23 17:35 ` Nick Dokos 0 siblings, 2 replies; 13+ messages in thread From: Rainer M Krug @ 2012-11-23 15:26 UTC (permalink / raw) To: Eric Schulte; +Cc: emacs-orgmode -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 23/11/12 16:02, Eric Schulte wrote: > Rainer M Krug <r.m.krug@gmail.com> writes: > >> On 23/11/12 00:17, Eric Schulte wrote: >>> Rainer M Krug <r.m.krug@gmail.com> writes: >>> >>>> Hi >>>> >>>> I have in a document a definition of a projection, which is essentially a text as >>>> follow: >>>> >>>> #+BEGIN_src +proj=aea +lat_1=-28.25 +lat_2=-29.75 +lat_0=29 +lon_0=30.75 +x_0=0 +y_0=0 >>>> +datum=WGS84 +units=m +no_defs #+END_src >>>> >>>> Now this does obviously not export, as the source block language is missing. Is there a >>>> way that I can get the same formating of the source in the exportes output but without >>>> the syntax highlighting? >>>> >>>> BEGIN_EXAMPLE END_EXAMPLE >>>> >>>> is similar, but I would like the block to be formated as the SRC blocks. >>>> >>> >>> I bet "fundamental" would work, e.g., >> >> Yes, it does - works perfectly. Is this documented? >> > > Yes. Whatever language string is placed at the top of the source block will define the mode > used for export and in-block editing. I believe that is documented. OK - then I thought that I can use all languages *for formating* which are defined in the listings package in LaTeX, but it doesn't matter what I take: it always formats it in as a source block but obviously without syntax highlighting. For editing: C-c ' only works ehen using "fundamental" - other non-existent languages are not accepted (obviously). So I assume in org, there is support for "fundamental", but I could not find it in the documentation when I looked. At the moment, my org info documentation seems to be not accessible (blank page when opening it). Cheers, Rainer > > Cheers, > >> >> Thanks, >> >> Rainer >> >>> >>> #+begin_src fundamental +proj=aea +lat_1=-28.25 +lat_2=-29.75 +lat_0=29 +lon_0=30.75 +x_0=0 >>> +y_0=0 +datum=WGS84 +units=m +no_defs #+end_src >>> >>>> >>>> Thanks, >>>> >>>> Rainer >>> >> > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlCvlaMACgkQoYgNqgF2egpgFgCeP7BZGpBUv1uU+tIzaFy4XvH5 C3gAn1ri7W9R4OJEKHq/RpVAELcFvpyM =Ezlp -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: "Generic" Source block language specification? 2012-11-23 15:26 ` Rainer M Krug @ 2012-11-23 16:40 ` Eric Schulte 2012-11-23 17:35 ` Nick Dokos 1 sibling, 0 replies; 13+ messages in thread From: Eric Schulte @ 2012-11-23 16:40 UTC (permalink / raw) To: Rainer M Krug; +Cc: emacs-orgmode Rainer M Krug <r.m.krug@gmail.com> writes: > On 23/11/12 16:02, Eric Schulte wrote: >> Rainer M Krug <r.m.krug@gmail.com> writes: >> >>> On 23/11/12 00:17, Eric Schulte wrote: >>>> Rainer M Krug <r.m.krug@gmail.com> writes: >>>> >>>>> Hi >>>>> >>>>> I have in a document a definition of a projection, which is essentially a text as >>>>> follow: >>>>> >>>>> #+BEGIN_src +proj=aea +lat_1=-28.25 +lat_2=-29.75 +lat_0=29 +lon_0=30.75 +x_0=0 +y_0=0 >>>>> +datum=WGS84 +units=m +no_defs #+END_src >>>>> >>>>> Now this does obviously not export, as the source block language is missing. Is there a >>>>> way that I can get the same formating of the source in the exportes output but without >>>>> the syntax highlighting? >>>>> >>>>> BEGIN_EXAMPLE END_EXAMPLE >>>>> >>>>> is similar, but I would like the block to be formated as the SRC blocks. >>>>> >>>> >>>> I bet "fundamental" would work, e.g., >>> >>> Yes, it does - works perfectly. Is this documented? >>> >> >> Yes. Whatever language string is placed at the top of the source block will define the mode >> used for export and in-block editing. I believe that is documented. > > OK - then I thought that I can use all languages *for formating* which are defined in the listings > package in LaTeX, but it doesn't matter what I take: it always formats it in as a source block but > obviously without syntax highlighting. > > For editing: C-c ' only works ehen using "fundamental" - other non-existent languages are not > accepted (obviously). > > So I assume in org, there is support for "fundamental", but I could not find it in the > documentation when I looked. > When editing a code block, Org-mode will take the name of the language, append "-mode", and then try to call the result as a function. So for example, an R code block will call "R-mode" to edit the contents using R-mode. Thus any *-mode is a valid code block name. > > At the moment, my org info documentation seems to be not accessible >(blank page when opening it). > > Cheers, > > Rainer > >> >> Cheers, >> >>> >>> Thanks, >>> >>> Rainer >>> >>>> >>>> #+begin_src fundamental +proj=aea +lat_1=-28.25 +lat_2=-29.75 +lat_0=29 +lon_0=30.75 +x_0=0 >>>> +y_0=0 +datum=WGS84 +units=m +no_defs #+end_src >>>> >>>>> >>>>> Thanks, >>>>> >>>>> Rainer >>>> >>> >> > -- Eric Schulte http://cs.unm.edu/~eschulte ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: "Generic" Source block language specification? 2012-11-23 15:26 ` Rainer M Krug 2012-11-23 16:40 ` Eric Schulte @ 2012-11-23 17:35 ` Nick Dokos 1 sibling, 0 replies; 13+ messages in thread From: Nick Dokos @ 2012-11-23 17:35 UTC (permalink / raw) To: Rainer M Krug; +Cc: emacs-orgmode, Eric Schulte Rainer M Krug <r.m.krug@gmail.com> wrote: > On 23/11/12 16:02, Eric Schulte wrote: > > Rainer M Krug <r.m.krug@gmail.com> writes: > > > >> On 23/11/12 00:17, Eric Schulte wrote: > >>> Rainer M Krug <r.m.krug@gmail.com> writes: > >>> > >>>> Hi > >>>> > >>>> I have in a document a definition of a projection, which is essentially a text as > >>>> follow: > >>>> > >>>> #+BEGIN_src +proj=aea +lat_1=-28.25 +lat_2=-29.75 +lat_0=29 +lon_0=30.75 +x_0=0 +y_0=0 > >>>> +datum=WGS84 +units=m +no_defs #+END_src > >>>> > >>>> Now this does obviously not export, as the source block language is missing. Is there a > >>>> way that I can get the same formating of the source in the exportes output but without > >>>> the syntax highlighting? > >>>> > >>>> BEGIN_EXAMPLE END_EXAMPLE > >>>> > >>>> is similar, but I would like the block to be formated as the SRC blocks. > >>>> > >>> > >>> I bet "fundamental" would work, e.g., > >> > >> Yes, it does - works perfectly. Is this documented? > >> > > > > Yes. Whatever language string is placed at the top of the source block will define the mode > > used for export and in-block editing. I believe that is documented. > > OK - then I thought that I can use all languages *for formating* which are defined in the listings > package in LaTeX, but it doesn't matter what I take: it always formats it in as a source block but > obviously without syntax highlighting. > > For editing: C-c ' only works ehen using "fundamental" - other non-existent languages are not > accepted (obviously). > > So I assume in org, there is support for "fundamental", but I could not find it in the > documentation when I looked. > > At the moment, my org info documentation seems to be not accessible (blank page when opening it). > In order for this to work, emacs has to have a mode to handle it: "fundamental" as a language works, because emacs has a mode called fundamental-mode. I append the relevant portion of the documentation (section 14.2, Editing source code) I hope it comes in useful until you get your info problems resolved, but note that it's also available online at http://orgmode.org/org.html#Editing-source-code See org-src-lang-modes below for the details: ,---- | | 14.2 Editing source code | ======================== | | Use `C-c '' to edit the current code block. This brings up a language | major-mode edit buffer containing the body of the code block. Saving | this buffer will write the new contents back to the Org buffer. Use | `C-c '' again to exit. | | The `org-src-mode' minor mode will be active in the edit buffer. The | following variables can be used to configure the behavior of the edit | buffer. See also the customization group `org-edit-structure' for | further configuration options. | | `org-src-lang-modes' | If an Emacs major-mode named `<lang>-mode' exists, where `<lang>' | is the language named in the header line of the code block, then | the edit buffer will be placed in that major-mode. This variable | can be used to map arbitrary language names to existing major | modes. | | `org-src-window-setup' | Controls the way Emacs windows are rearranged when the edit buffer | is created. | | `org-src-preserve-indentation' | This variable is especially useful for tangling languages such as | Python, in which whitespace indentation in the output is critical. | | `org-src-ask-before-returning-to-edit-buffer' | By default, Org will ask before returning to an open edit buffer. | Set this variable to nil to switch without asking. | | To turn on native code fontification in the _Org_ buffer, configure | the variable `org-src-fontify-natively'. | `---- HTH, Nick ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: "Generic" Source block language specification? 2012-11-21 14:08 "Generic" Source block language specification? Rainer M Krug 2012-11-22 23:17 ` Eric Schulte @ 2012-11-23 18:11 ` Jambunathan K 2012-11-25 0:28 ` Nicolas Goaziou 2012-11-25 16:03 ` Rainer M Krug 1 sibling, 2 replies; 13+ messages in thread From: Jambunathan K @ 2012-11-23 18:11 UTC (permalink / raw) To: Nicolas Goaziou; +Cc: Rainer, emacs-orgmode Rainer M Krug <r.m.krug@gmail.com> writes: > Hi > > I have in a document a definition of a projection, which is essentially a text as follow: > > #+BEGIN_src > +proj=aea +lat_1=-28.25 > +lat_2=-29.75 > +lat_0=29 > +lon_0=30.75 > +x_0=0 > +y_0=0 > +datum=WGS84 > +units=m > +no_defs > #+END_src > > Now this does obviously not export, as the source block language is missing. Is there a way that I > can get the same formating of the source in the exportes output but without the syntax highlighting? > > BEGIN_EXAMPLE > END_EXAMPLE > > is similar, but I would like the block to be formated as the SRC > blocks. Marking the src block as `fundamental' has a drawback. One can no longer have in-buffer fontification of src blocks. A better option would be to have a custom variable which produces black-and-white src blocks on export. ODT already has this option. C-h v org-e-odt-fontify-srcblocks RET I am CCing Nicolas, to check whether he would be interested in introducing an export knob for this. > Thanks, > Rainer -- ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: "Generic" Source block language specification? 2012-11-23 18:11 ` Jambunathan K @ 2012-11-25 0:28 ` Nicolas Goaziou 2012-11-25 15:28 ` Rainer M Krug 2012-11-25 16:03 ` Rainer M Krug 1 sibling, 1 reply; 13+ messages in thread From: Nicolas Goaziou @ 2012-11-25 0:28 UTC (permalink / raw) To: Jambunathan K; +Cc: Rainer, emacs-orgmode Hello, Jambunathan K <kjambunathan@gmail.com> writes: > Rainer M Krug <r.m.krug@gmail.com> writes: > >> Hi >> >> I have in a document a definition of a projection, which is essentially a text as follow: >> >> #+BEGIN_src >> +proj=aea +lat_1=-28.25 >> +lat_2=-29.75 >> +lat_0=29 >> +lon_0=30.75 >> +x_0=0 >> +y_0=0 >> +datum=WGS84 >> +units=m >> +no_defs >> #+END_src >> >> Now this does obviously not export, as the source block language is missing. Is there a way that I >> can get the same formating of the source in the exportes output but without the syntax highlighting? >> >> BEGIN_EXAMPLE >> END_EXAMPLE >> >> is similar, but I would like the block to be formated as the SRC >> blocks. > > Marking the src block as `fundamental' has a drawback. One can no > longer have in-buffer fontification of src blocks. > > A better option would be to have a custom variable which produces > black-and-white src blocks on export. > > ODT already has this option. > > C-h v org-e-odt-fontify-srcblocks RET > > I am CCing Nicolas, to check whether he would be interested in > introducing an export knob for this. I still don't get what is wrong with example blocks (wrt export). Would someone care to elaborate? Regards, -- Nicolas Goaziou ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: "Generic" Source block language specification? 2012-11-25 0:28 ` Nicolas Goaziou @ 2012-11-25 15:28 ` Rainer M Krug 2012-11-25 15:37 ` Nicolas Goaziou 0 siblings, 1 reply; 13+ messages in thread From: Rainer M Krug @ 2012-11-25 15:28 UTC (permalink / raw) To: Nicolas Goaziou; +Cc: Rainer, emacs-orgmode, Jambunathan K -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 25/11/12 01:28, Nicolas Goaziou wrote: > Hello, > > Jambunathan K <kjambunathan@gmail.com> writes: > >> Rainer M Krug <r.m.krug@gmail.com> writes: >> >>> Hi >>> >>> I have in a document a definition of a projection, which is essentially a text as follow: >>> >>> #+BEGIN_src +proj=aea +lat_1=-28.25 +lat_2=-29.75 +lat_0=29 +lon_0=30.75 +x_0=0 +y_0=0 >>> +datum=WGS84 +units=m +no_defs #+END_src >>> >>> Now this does obviously not export, as the source block language is missing. Is there a way >>> that I can get the same formating of the source in the exportes output but without the >>> syntax highlighting? >>> >>> BEGIN_EXAMPLE END_EXAMPLE >>> >>> is similar, but I would like the block to be formated as the SRC blocks. >> >> Marking the src block as `fundamental' has a drawback. One can no longer have in-buffer >> fontification of src blocks. >> >> A better option would be to have a custom variable which produces black-and-white src blocks >> on export. >> >> ODT already has this option. >> >> C-h v org-e-odt-fontify-srcblocks RET >> >> I am CCing Nicolas, to check whether he would be interested in introducing an export knob for >> this. > > I still don't get what is wrong with example blocks (wrt export). Would someone care to > elaborate? Yes. In a document, I have several source blocks with "real" code (i.e. bash and R in this case) Now I have one block, which is not really source code, but which is "kind of" source code, in my case a definition of a projection for a GIS project. Now I would like to have this definition of the projection displayed in the exported document as the other source blocks, If I put it into an EXAMPLE block, it is exported to LaTeX as verbatin and not listing, and all customisations ai have for listings (smaller font, grey background, ...) do *not* apply to the EXAMPLE block, but woyuld to a "fundamental" source block. So the EXAMPLE block is in this case not equivalent to the fundamental source block. Hope this clarifies the difference, Cheers, Rainer > > > Regards, > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlCyOSUACgkQoYgNqgF2egrxdACeKk1/9hvuGv4PGEj9EAXipjOK CW8An0KJAUM0ejDcy9n1Gq2jxEHkvmZp =oKbK -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: "Generic" Source block language specification? 2012-11-25 15:28 ` Rainer M Krug @ 2012-11-25 15:37 ` Nicolas Goaziou 2012-11-25 16:01 ` Rainer M Krug 0 siblings, 1 reply; 13+ messages in thread From: Nicolas Goaziou @ 2012-11-25 15:37 UTC (permalink / raw) To: Rainer M Krug; +Cc: Rainer, emacs-orgmode, Jambunathan K Rainer M Krug <r.m.krug@gmail.com> writes: > In a document, I have several source blocks with "real" code (i.e. bash and R in this case) Now I > have one block, which is not really source code, but which is "kind of" source code, in my case a > definition of a projection for a GIS project. Now I would like to have this definition of the > projection displayed in the exported document as the other source blocks, If I put it into an > EXAMPLE block, it is exported to LaTeX as verbatin and not listing, and all customisations ai have > for listings (smaller font, grey background, ...) do *not* apply to the EXAMPLE block, but woyuld > to a "fundamental" source block. So the EXAMPLE block is in this case not equivalent to the > fundamental source block. > > Hope this clarifies the difference, Yes, thanks. Since you use "listings" package, can't you define a new language (i.e. with \lstdefinelanguage{pseudocode}) and then use "#+begin_src pseudocode" block? Regards, -- Nicolas Goaziou ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: "Generic" Source block language specification? 2012-11-25 15:37 ` Nicolas Goaziou @ 2012-11-25 16:01 ` Rainer M Krug 0 siblings, 0 replies; 13+ messages in thread From: Rainer M Krug @ 2012-11-25 16:01 UTC (permalink / raw) To: Nicolas Goaziou; +Cc: Rainer, emacs-orgmode, Jambunathan K -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 25/11/12 16:37, Nicolas Goaziou wrote: > Rainer M Krug <r.m.krug@gmail.com> writes: > >> In a document, I have several source blocks with "real" code (i.e. bash and R in this case) >> Now I have one block, which is not really source code, but which is "kind of" source code, in >> my case a definition of a projection for a GIS project. Now I would like to have this >> definition of the projection displayed in the exported document as the other source blocks, >> If I put it into an EXAMPLE block, it is exported to LaTeX as verbatin and not listing, and >> all customisations ai have for listings (smaller font, grey background, ...) do *not* apply >> to the EXAMPLE block, but woyuld to a "fundamental" source block. So the EXAMPLE block is in >> this case not equivalent to the fundamental source block. >> >> Hope this clarifies the difference, > > Yes, thanks. > > Since you use "listings" package, can't you define a new language (i.e. with > \lstdefinelanguage{pseudocode}) and then use "#+begin_src pseudocode" block? Well - this does not seem to be necessary. If I use #+begin_src fundamental ... #+end_src the block will be formated following the rules for "listings". Even if I use #+begin_src BlaBlaBla ... #+end_src it does not produce an error message in LaTeX. Nice with fundamental: I can use C-c ' to open the block in a new buffer and edit it there - very handy. If I would like to have some highlighting in the source block in the LaTeX export, I obviously would have to define a new language - nice idea actually for the final output. Thanks, Rainer > > > Regards, > - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlCyQN8ACgkQoYgNqgF2egon2QCgi2XwZtHYDSvbUvp5OQm9/1sM w3IAnj6qBems+qPepvahxB+GxKJMNONK =UAoO -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: "Generic" Source block language specification? 2012-11-23 18:11 ` Jambunathan K 2012-11-25 0:28 ` Nicolas Goaziou @ 2012-11-25 16:03 ` Rainer M Krug 1 sibling, 0 replies; 13+ messages in thread From: Rainer M Krug @ 2012-11-25 16:03 UTC (permalink / raw) To: Jambunathan K; +Cc: emacs-orgmode, Rainer, Nicolas Goaziou -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 23/11/12 19:11, Jambunathan K wrote: > Rainer M Krug <r.m.krug@gmail.com> writes: > >> Hi >> >> I have in a document a definition of a projection, which is essentially a text as follow: >> >> #+BEGIN_src +proj=aea +lat_1=-28.25 +lat_2=-29.75 +lat_0=29 +lon_0=30.75 +x_0=0 +y_0=0 >> +datum=WGS84 +units=m +no_defs #+END_src >> >> Now this does obviously not export, as the source block language is missing. Is there a way >> that I can get the same formating of the source in the exportes output but without the syntax >> highlighting? >> >> BEGIN_EXAMPLE END_EXAMPLE >> >> is similar, but I would like the block to be formated as the SRC blocks. > > Marking the src block as `fundamental' has a drawback. One can no longer have in-buffer > fontification of src blocks. But this only applies for this source block, for which no message is defined anyway and consequently no highlighting is usefull (at the moment)? Or do I miss something in your argument? Rainer > > A better option would be to have a custom variable which produces black-and-white src blocks on > export. > > ODT already has this option. > > C-h v org-e-odt-fontify-srcblocks RET > > I am CCing Nicolas, to check whether he would be interested in introducing an export knob for > this. > >> Thanks, Rainer > - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlCyQWcACgkQoYgNqgF2egpqAgCeKL/mg3oqXZLHoCi2ijAkJW1L nCMAn0wJXsul485qXJsJ/gk3DuGfMq2u =9O5N -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2012-11-25 16:04 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-11-21 14:08 "Generic" Source block language specification? Rainer M Krug 2012-11-22 23:17 ` Eric Schulte 2012-11-23 8:17 ` Rainer M Krug 2012-11-23 15:02 ` Eric Schulte 2012-11-23 15:26 ` Rainer M Krug 2012-11-23 16:40 ` Eric Schulte 2012-11-23 17:35 ` Nick Dokos 2012-11-23 18:11 ` Jambunathan K 2012-11-25 0:28 ` Nicolas Goaziou 2012-11-25 15:28 ` Rainer M Krug 2012-11-25 15:37 ` Nicolas Goaziou 2012-11-25 16:01 ` Rainer M Krug 2012-11-25 16:03 ` Rainer M Krug
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).