emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Feature request: org-export-format-source-code-or-example and srcname
@ 2009-12-02 17:41 Nicolas Girard
  2009-12-02 20:23 ` [babel] " Eric Schulte
  2009-12-17  7:40 ` Carsten Dominik
  0 siblings, 2 replies; 5+ messages in thread
From: Nicolas Girard @ 2009-12-02 17:41 UTC (permalink / raw)
  To: emacs-orgmode

Hi,
when using the listings LaTeX package, it would be very useful if the
value of srcname was added to the output. For instance,

#+srcname: my_code_chunk
#+begin_src latex :results latex :exports code :tangle no
\usepackage{fontspec,xunicode,xltxtra}
#+end_src

would give:

\lstset{language=TeX}[caption={my\_code\_chunk}]
\begin{lstlisting}
\usepackage{fontspec,xunicode,xltxtra}
\end{lstlisting}

(note the added "[caption={my\_code\_chunk}]")

Cheers,
Nicolas

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

* Re: [babel] Feature request: org-export-format-source-code-or-example and srcname
  2009-12-02 17:41 Feature request: org-export-format-source-code-or-example and srcname Nicolas Girard
@ 2009-12-02 20:23 ` Eric Schulte
  2009-12-17  7:40 ` Carsten Dominik
  1 sibling, 0 replies; 5+ messages in thread
From: Eric Schulte @ 2009-12-02 20:23 UTC (permalink / raw)
  To: Nicolas Girard; +Cc: emacs-orgmode

Hi Nicolas,

There have been a couple of requests for this functionality, and the
main slowdown in not previously implementing this as part of the
org-babel source block export was not having a good standard way to
specify the srcname (or possibly header arguments) in HTML LaTeX and
ASCII export.  The LaTeX caption option you mentioned below looks like a
good solution for users who are using the listings package.

A previous suggestion was to use macros which the user could overdefine
to customize the behavior.  I do not know much about org-mode export
macros but this approach sounds promising to me.

Thanks for providing more motivation for this development.  If you have
any more suggestions I'd be interested to hear them.

Best -- Eric

Nicolas Girard <nicolas.girard@nerim.net> writes:

> Hi,
> when using the listings LaTeX package, it would be very useful if the
> value of srcname was added to the output. For instance,
>
> #+srcname: my_code_chunk
> #+begin_src latex :results latex :exports code :tangle no
> \usepackage{fontspec,xunicode,xltxtra}
> #+end_src
>
> would give:
>
> \lstset{language=TeX}[caption={my\_code\_chunk}]
> \begin{lstlisting}
> \usepackage{fontspec,xunicode,xltxtra}
> \end{lstlisting}
>
> (note the added "[caption={my\_code\_chunk}]")
>
> Cheers,
> Nicolas
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please 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] 5+ messages in thread

* Re: Feature request: org-export-format-source-code-or-example and srcname
  2009-12-02 17:41 Feature request: org-export-format-source-code-or-example and srcname Nicolas Girard
  2009-12-02 20:23 ` [babel] " Eric Schulte
@ 2009-12-17  7:40 ` Carsten Dominik
  2009-12-17  9:17   ` Sébastien Vauban
  1 sibling, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2009-12-17  7:40 UTC (permalink / raw)
  To: Nicolas Girard; +Cc: emacs-orgmode

Hi

>
> Hi,
> when using the listings LaTeX package, it would be very useful if the
> value of srcname was added to the output. For instance,
>
> #+srcname: my_code_chunk
> #+begin_src latex :results latex :exports code :tangle no
> \usepackage{fontspec,xunicode,xltxtra}
> #+end_src
>
> would give:
>
> \lstset{language=TeX}[caption={my\_code\_chunk}]
> \begin{lstlisting}
> \usepackage{fontspec,xunicode,xltxtra}
> \end{lstlisting}
>
> (note the added "[caption={my\_code\_chunk}]")
>
> Cheers, Nicolas

Is there anyone besides Nicolas what would like to see the source name  
in the exported listing?

Is that something that should be done in org-babel, or in the normal  
export stuff?

- Carsten

On Dec 2, 2009, at 6:41 PM, Nicolas Girard wrote:
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

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

* Re: Feature request: org-export-format-source-code-or-example and srcname
  2009-12-17  7:40 ` Carsten Dominik
@ 2009-12-17  9:17   ` Sébastien Vauban
  2010-01-05 15:56     ` Eric Schulte
  0 siblings, 1 reply; 5+ messages in thread
From: Sébastien Vauban @ 2009-12-17  9:17 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Carsten and Nicolas,

(BTW, Nicolas, excellent modifications made to the agenda look & feel!)

Carsten Dominik wrote:
>> when using the listings LaTeX package, it would be very useful if the
>> value of srcname was added to the output. For instance,
>>
>> #+srcname: my_code_chunk
>> #+begin_src latex :results latex :exports code :tangle no
>> \usepackage{fontspec,xunicode,xltxtra}
>> #+end_src
>>
>> would give:
>>
>> \lstset{language=TeX}[caption={my\_code\_chunk}]
>> \begin{lstlisting}
>> \usepackage{fontspec,xunicode,xltxtra}
>> \end{lstlisting}
>>
>> (note the added "[caption={my\_code\_chunk}]")
>
> Is there anyone besides Nicolas what would like to see the source name in
> the exported listing?

Yes! This is not only desired, but -- for me -- completely required: without
it, you simply can't do real literate programming documentation...

An example of how it would be nice to be (using NoWeb):

    http://www.mygooglest.com/sva/ecm-noweb.pdf

See my (unanswered) thread of 2009-12-04 at 12:13: "[babel] Org-babel vs NoWeb
(and the like)".


> Is that something that should be done in org-babel, or in the normal export
> stuff?

I would answer Org-babel, but if there is one thing I'm sure of, is that I
don't understand all the implications of my answer. So, take it with low
consideration.

Best regards,
  Seb

-- 
Sébastien Vauban



_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Feature request: org-export-format-source-code-or-example and srcname
  2009-12-17  9:17   ` Sébastien Vauban
@ 2010-01-05 15:56     ` Eric Schulte
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Schulte @ 2010-01-05 15:56 UTC (permalink / raw)
  To: Sébastien Vauban; +Cc: emacs-orgmode

Hi,

A first pass at this functionality has just been deployed.  The current
solution is very simple, but from here it should be relatively easy to
improve the look and feel of the exported names.

As described here [1], when exporting to html the source-name will be
included in a <label> element immediately preceding the <pre> block
containing the code, so

#+source: square
#+begin_src emacs-lisp :var input=1
  (* input input)
#+end_src

will export to

<label class="org-src-name">square</label>
<pre class="src src-emacs-lisp">
<span style="color: #7f7f7f;">(</span>* input input<span style="color: #7f7f7f;">)</span>
</pre>

and in LaTeX the source-name will be added as a listings title element,
so the above block will export to the following LaTeX.

\lstset{language=Lisp}\begin{lstlisting}[title={square}]
(* input input)
\end{lstlisting}

Please let me know how this should be improved.

Thanks -- Eric

Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:

> Hi Carsten and Nicolas,
>
> (BTW, Nicolas, excellent modifications made to the agenda look & feel!)
>
> Carsten Dominik wrote:
>>> when using the listings LaTeX package, it would be very useful if the
>>> value of srcname was added to the output. For instance,
>>>
>>> #+srcname: my_code_chunk
>>> #+begin_src latex :results latex :exports code :tangle no
>>> \usepackage{fontspec,xunicode,xltxtra}
>>> #+end_src
>>>
>>> would give:
>>>
>>> \lstset{language=TeX}[caption={my\_code\_chunk}]
>>> \begin{lstlisting}
>>> \usepackage{fontspec,xunicode,xltxtra}
>>> \end{lstlisting}
>>>
>>> (note the added "[caption={my\_code\_chunk}]")
>>
>> Is there anyone besides Nicolas what would like to see the source name in
>> the exported listing?
>
> Yes! This is not only desired, but -- for me -- completely required: without
> it, you simply can't do real literate programming documentation...
>
> An example of how it would be nice to be (using NoWeb):
>
>     http://www.mygooglest.com/sva/ecm-noweb.pdf
>
> See my (unanswered) thread of 2009-12-04 at 12:13: "[babel] Org-babel vs NoWeb
> (and the like)".
>
>
>> Is that something that should be done in org-babel, or in the normal export
>> stuff?
>
> I would answer Org-babel, but if there is one thing I'm sure of, is that I
> don't understand all the implications of my answer. So, take it with low
> consideration.
>
> Best regards,
>   Seb

Footnotes: 
[1]  http://eschulte.github.com/babel-dev/STARTED-Suitable-export-of-%23%2Bsrcname-and-%23%2Bresname-lines.html

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

end of thread, other threads:[~2010-01-05 15:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-02 17:41 Feature request: org-export-format-source-code-or-example and srcname Nicolas Girard
2009-12-02 20:23 ` [babel] " Eric Schulte
2009-12-17  7:40 ` Carsten Dominik
2009-12-17  9:17   ` Sébastien Vauban
2010-01-05 15:56     ` Eric Schulte

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