Hello,

claude fuhrer <cla...@fuhrer.ch> 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

Reply via email to