Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export comments as comments

In Org-mode you can make comments and from Org-mode you can export to LaTeX but Org-mode comments are not exported to LaTeX comments. How can Org-mode be made to export Org-mode comments as LaTeX comments?

Here is an example. The following

* Test

Text before comment
# Comment
Text after comment

Text before comment
#+BEGIN_COMMENT
Comment
#+END_COMMENT
Text after comment

exports to

\section{Test}
\label{sec-1}


Text before comment
Text after comment

Text before comment

Text after comment

But I want the Org-mode comments to be exported as LaTeX comments. Thus, I want the following LaTeX output:

\section{Test}
\label{sec-1}


Text before comment
% Comment
Text after comment

Text before comment
\begin{comment}
Comment
\end{comment}
Text after comment

I am running Org-mode 7.6 in Emacs 23.3.1.

like image 823
N.N. Avatar asked Mar 26 '12 13:03

N.N.


1 Answers

Under the current exporter the only method I can think of that would allow you to export comments would be backend-specific. You could use something along the lines of:

#+latex: comment

or

#+begin_latex
\begin{comment}
  comment
\end{comment}
#+end_latex

However both are contrived and you would need to do the equivalent for HTML etc if you intend to export to more than one format.

There is a new exporter in development however where this should not be overly difficult to implement (comments are already identified as blocks in the parser so it would simply need a method to convert them on export).

I'm forwarding this request to the mailing list to see if this can be included.
Edit: Thread located here.

Edit: Response from the maintainer of Org-Mode

the current exporters don't allow this, but the new export engine by Nicolas makes it possible.

The plan is to merge the new export engine into Org's core before version 8.0, so please stay tuned.

like image 179
Jonathan Leech-Pepin Avatar answered Sep 28 '22 08:09

Jonathan Leech-Pepin