From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [babel]Skip comments on code blocks on export? Date: Fri, 27 Jan 2012 15:46:42 -0700 Message-ID: <87liosaeyu.fsf@gmx.com> References: <4F1FC7DF.7000805@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqvSj-0007Na-A1 for emacs-orgmode@gnu.org; Fri, 27 Jan 2012 18:44:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RqvSh-0001A8-O5 for emacs-orgmode@gnu.org; Fri, 27 Jan 2012 18:44:09 -0500 Received: from mailout-us.gmx.com ([74.208.5.67]:42260 helo=mailout-us.mail.com) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RqvSh-0001A3-Hl for emacs-orgmode@gnu.org; Fri, 27 Jan 2012 18:44:07 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: R.M.Krug@gmail.com Cc: emacs-orgmode Hi Rainer, You could add a function to the `org-babel-post-tangle-hook' to remove comments from the resulting code file. Functions on this hook are called from within the tangled code file. Best, Rainer M Krug writes: > Hi > > is there a way of skipping comments when exporting R code? > > The reason is, that I have roxygen tags in my code, which I do not > want to bi included when I export the document to a pdf, as they are > only irritate readers not familiar with roxygen. > On the other hand, I would like to keep them in the code when > tangling, as basic documentation and a base for when / if I convert > the code to a package. > > So my question: is there a way of suppressing comments in code on export? > I am aware that might be difficult, but possibly a parameter > > #+PROPERTY: supressLines "##" > > which supresses all code lines in code blocks starting with ## would > be great for this purpose. > > Or is there another way of handling this issue? > > Rainer -- Eric Schulte http://cs.unm.edu/~eschulte/