4

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?

1
  • 3
    export -> exports. Note the "s".
    – mankoff
    Mar 31, 2015 at 13:29

1 Answer 1

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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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