From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: tagged code blocks Date: Fri, 24 Jun 2016 11:16:33 +0200 Message-ID: <87twgj7xqm.fsf@saiph.selenimh> References: <576CED78.7070804@fuhrer.ch> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGNEB-0000DN-17 for emacs-orgmode@gnu.org; Fri, 24 Jun 2016 05:16:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGNE9-0002QJ-0c for emacs-orgmode@gnu.org; Fri, 24 Jun 2016 05:16:41 -0400 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:44721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGNE8-0002QA-Q6 for emacs-orgmode@gnu.org; Fri, 24 Jun 2016 05:16:40 -0400 In-Reply-To: <576CED78.7070804@fuhrer.ch> (claude fuhrer's message of "Fri, 24 Jun 2016 10:21:12 +0200") 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: claude fuhrer Cc: emacs-orgmode@gnu.org Hello, claude fuhrer writes: > I'm trying to write a document where some source codes block may be > conditionally excluded from export. > > Here a small example of what I want, with the wrong syntax: > > > =========================================== > #+EXCLUDE_TAGS solution > > #+begin_src java :tag question > public class Test { > // write java code here > > } > #+end_src > > > and the solution is: > > #+begin_src java :tag solution > // the solution here > #+end_src > ========================================== > > > So then, I only need to modify the EXCLUDE_TAGS to generate a document > with or without solution. I would use drawers for this, but there are probably other ways: #+options: d:(not "SOLUTION") :QUESTION: #+begin_src emacs-lisp (+ 1 1) #+end_src :END: :SOLUTION: #+begin_src emacs-lisp 10 #+end_src :END: where "d:t" would give you the full output. Regards, -- Nicolas Goaziou