emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Name of code pieces when exported to PDF
@ 2016-09-26 14:28 claude fuhrer
  2016-09-26 15:34 ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: claude fuhrer @ 2016-09-26 14:28 UTC (permalink / raw)
  To: emacs-orgmode

Hello

To explain a small program, I've broken it down into small pieces. My
org file looks something like

# =========================================================================
#+NAME MainClass
#+BEGIN_SRC java :noweb tangle :tangle Test.java
public class Test
{
    <<secondBlock>>
    <<thirdBlock>>
}
#+END_SRC

some text

#+NAME secondBlock
#+BEGIN_SRC java :noweb tangle
     int a, b;
#+END_SRC

and then

#+NAME thirdBlock
#+BEGIN_SRC java :noweb tangle
     a = 17;
     b = a / 2;
#+END_SRC
# =========================================================================

Org-babel-tangle give me exactly what I want.

But, is it possible to have the "NAME" value displayed in the
lstlisting parameters when I export the org document as pdf ? I've
included the following lines in the beginning of my org file

#+LaTeX_HEADER:\lstset{language=Java,
#+LaTeX_HEADER:        numbers=left,
#+LaTeX_HEADER:        basicstyle=\footnotesize\ttfamily,
#+LaTeX_HEADER:        basicstyle=\ttfamily,
#+LaTeX_HEADER:        backgroundcolor=\color{LightYellow},
#+LaTeX_HEADER:        stringstyle=\color{blue},
#+LaTeX_HEADER:        frame=single,
#+LaTeX_HEADER:        columns=fullflexible,
#+LaTeX_HEADER:        numberstyle=\scriptsize\color{red},
#+LaTeX_HEADER:        commentstyle=\color{ForestGreen}}

The package listing provides a "title" or "caption" keyword, but I do
not know how to pass the "NAME" argument. Can you please help me or
give me a pointer ? Thank you in advance for your help.

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

end of thread, other threads:[~2016-09-27 11:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-26 14:28 Name of code pieces when exported to PDF claude fuhrer
2016-09-26 15:34 ` Nicolas Goaziou
2016-09-26 16:48   ` claude fuhrer
2016-09-26 18:13     ` Sebastian Christ
2016-09-26 21:32       ` Nick Dokos
2016-09-26 21:43         ` John Kitchin
2016-09-27  0:17           ` Nick Dokos
2016-09-27 11:11         ` Sebastian Christ

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