3

I have the following line at the start of an org file to configure it to use listings for code blocks.

#+name: setup-listings
#+begin_src emacs-lisp :results silent :export none
  (setq org-latex-listings 't)
  (require 'ox-latex)
  (add-to-list 'org-latex-packages-alist '("" "listings"))
  (add-to-list 'org-latex-packages-alist '("" "color"))
#+end_src
#+call: setup-listings()

When I export this to a latex document the listings package gets set up correctly. But this block is also put in the latex document. What do I need to do so that this one specific block is not included into the output?

  • 2
    export -> exports. Note the "s". – mankoff Mar 31 '15 at 13:29
2

This can be done with the noexport tag. Create a heading containing the source block, then go to a heading and type C-c C-q and enter :noexport:. This will no longer be listed in the export.

If you just want to hide the source block, you may be able to add a tag for just the source block, but I haven't tried it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.