emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Name of code pieces when exported to PDF


From: claude fuhrer
Subject: [O] Name of code pieces when exported to PDF
Date: Mon, 26 Sep 2016 16:28:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]