From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: tables, comment in one line, export to html Date: Tue, 26 Apr 2016 18:25:34 +0200 Message-ID: References: <87inzdhn50.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1av5nt-00080a-C2 for emacs-orgmode@gnu.org; Tue, 26 Apr 2016 12:25:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1av5ns-0007ff-BN for emacs-orgmode@gnu.org; Tue, 26 Apr 2016 12:25:37 -0400 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:37459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1av5ns-0007fb-4K for emacs-orgmode@gnu.org; Tue, 26 Apr 2016 12:25:36 -0400 Received: by mail-wm0-x235.google.com with SMTP id n3so13465300wmn.0 for ; Tue, 26 Apr 2016 09:25:35 -0700 (PDT) In-Reply-To: <87inzdhn50.fsf@mat.ucm.es> 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" To: Uwe Brauer Cc: emacs-orgmode Hi Uwe On Tue, Apr 19, 2016 at 1:08 PM, Uwe Brauer wrote: > I would like to have a table entry in which the last colum contains > comments which I don't want to export to html. > > Like this > > | Joe Smith | 7 | 25 | 5 | | 37 | | #+begin_comment from group B B #+end_comment | > > But this does not work. So how can I achieve it? I have the same need now and just hacked something simple together to export | / | / | | | | | 1n | 2y | 3y | | / | | / | | | | 1y | 2n | 3y | | / | | / | | 1y | 2y | 3n | | / | / | / | | / | / | / | | | 1n | 2n | 3y | 4n | 5n | 6n | | / | | | | | | | | / | / | / | / | | / | / | | | 1n | 2n | 3n | 4y | 5n | 6n | # Same result with a less useful notation: | / | | | | | | | | / | / | / | | | / | / | | / | | / | / | | | | | | 1n | 2n | 3n | 4y | 5n | 6n | # Deletion must not get trapped with this: | / | | | | | | | | / | | | | | | | | | / | / | / | | | | | | 1y | 2y | 3y | 4y | 5y | 6y | as e. g. ASCII to : 2y 3y : : 1y 3y : : 1y 2y : : 3y : : 4y : : 4y : : / / / : 1y 2y 3y 4y 5y 6y with (add-hook 'org-export-before-processing-hook 'f-ox-filter-table-column-del) (defun f-ox-filter-table-column-del (back-end) "Delete the columns $2 to $> marked as \"/\" on a row with \"/\" in $1. If you want a non-empty column $1 to be deleted make it $2 by inserting an empty column before or rearrange column order in some other way. Make sure \"/\" is in $1 again after that." (while (re-search-forward "^[ \t]*| +/ +|\\(.*?|\\)?? +\\(/\\) +|" nil t) (goto-char (match-beginning 2)) (org-table-delete-column) (beginning-of-line))) Michael