7
2
When I use org-export-as-latex
or org-export-as-html
orgmode turns my buffer into a .tex
file or .html
file. But I don't want all the extra junk that it adds to the file: I want to handle the documentclass
and everything myself and just \input
the org mode generated file. (Or the analogous things for html with php).
So if my org file just has:
* Section
- Stuff
- Things
I want the org mode command to output just
\section{Section}
\begin{itemize}
\item Stuff
\item Things
\end{itemize}
Without any of the extra \tableofcontents
junk that ORG adds to it. I know I could define my own kind of #+LaTeX_CLASS
that could add the packages I want and so on, but I don't want to do things that way (and that wouldn't remove the \maketitle
or the spurious \vspace*
that ORG insists on inserting.
Is there a command to do this "headless" parsing and converting? I had a look but it's not obvious from the documentation. Presumably some low level ORG command is doing the parsing and converting I want, but I couldn't find what it was called from looking at the docs and C-h
pages...
This is not a question about HTML or LaTeX but about emacs ORG mode. So don't kick it off to some other site...
Check the prototype and documentation for
org-export-as-latex
. There is a flag calledbody-only
which will do part of the job. You can also pass a property list for overriding default settings. – Juancho – 2011-06-20T18:52:16.493Also, if you need real minimalism, have a look at the generic exporter at http://orgmode.org/worg/org-contrib/org-export-generic.html
– Juancho – 2011-06-20T18:56:56.320@Juancho could you explain how to pass a flag to a command? Maybe as part of an answer to this question? – Seamus – 2011-06-20T23:45:46.337
Just for trying,
M-:
then enter(org-export-as-latex nil nil nil nil t)
(the lastt
means true for the body-only parameter). You'll get a message indicating the tex buffer created. If you like the result, you can make a command or keybinding to call this. – Juancho – 2011-06-21T01:13:00.803@Juancho I get "trailing garbage following expression" and no output... – Seamus – 2011-06-21T09:54:47.250
Maybe we're using different org-mode versions; I use the latest development commit. Please have a look at the arguments for this function (type
F1-f org-export-as-latex
) and check that there is a 5th argument called BODY-ONLY. – Juancho – 2011-06-21T11:15:27.067@Juancho the arguments are in a different order, but I still can't seem to get it working. I looked at
org-export-generic
but that didn't work either:Cannot open load file: org-export-generic
– Seamus – 2011-06-21T11:20:20.153For the record, the right invocation for me was
(org-export-as-latex 3 nil nil nil t nil)
Could you add an answer so I can accept it? – Seamus – 2011-06-21T11:27:40.943