Export comments as comments

In Org mode, you can also make comments from the Org mode, which you can export to LaTeX, but comments in Org mode are not exported to LaTeX comments. How can I create an Org mode for exporting comments in Org mode as LaTeX comments?

Here is an example. Following

* Test

Text before comment
# Comment
Text after comment

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

export to

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


Text before comment
Text after comment

Text before comment

Text after comment

But I want the comments in Org mode to be exported as LaTeX comments. So I need 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 on Emacs 23.3.1.

+5
source share
2 answers

Under the current exporter, the only method I can think of that you could export comments would be backend specific. You can use something line by line:

#+latex: comment

or

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

, HTML .., .

, , ( , ).

, , .
: .

: Org-mode

, .

​​Org 8.0, .

+4

-, . org-export-handle-comments, org-export-preprocess-string org-exp.el. , LaTeX.

org-export-as-latex org-latex.el, org-export-preprocess-string. , org-export-preprocess-string, - , , :comments, LaTeX nil. org-mode, - org-export-handle-comments org-exp.el. , :comments , , ; nil, , . org-export-as-latex :comments nil :comments "%% %s", "%" . ,

this is text before a comment
# this is a comment
this is text after a comment

this is text before a comment
% this is a comment
this is text after a comment

-, :comments . , - , , .

, org-latex.elc, , org-latex.el .

+2

All Articles