Stopping orgmode #+INCLUDE command showing up in PDF export - emacs

I have an orgmode file that I'm exporting to PDF via LaTeX. It imports another file containing tikz code to create a diagram using the #+INCLUDE "./tikz-code.org" command. This works fine and the diagram is included in the PDF with no problems. However the #+INCLUDE "./tikz-code.org" command is also included in the PDF file. Is there a way for me to stop this happening?
Many thanks,
David
Many thanks #Nick. I'm using version 8.2.10 (which comes with Ubuntu 17.04). I'm using the apa6 LaTeX class and my code is:
#+INCLUDE "./flow-chart.org"
#+ATTR_LATEX: :width 12cm
#+CAPTION: Chart Caption
#+LABEL: fig:flow-chart
#+RESULTS:
[[file:flow-chart.pdf]]

Related

How to only export results of code blocks and not the code that generates it

I'd expect
#+begin_src plantuml :file foo.png :exports results
foo -> bar: JSON request
foo -> batz : instantiate batz\npassing resources from request
#+end_src
to only produce the resulting image in the exported document, but it exports both the plantuml code that produces it and the resulting image.
Any ideas what I can do to only export the images that are generated by the code block short of commenting out the code blocks after first generating the images?
I'm not allowed to comment so will provide an answer: this works fine for me with org 9.3.7 (i.e. only the image is exported, at least to PDF via LaTeX) so maybe it's a bug in the version of org you are using?
If posting this annoys anybody, I will delete.

Embed contents of source file inside source block in an org mode document (latex)

In pseudo-code I'd like to do the following in my org-mode file:
#+BEGIN_src python
[[./a_python_script_whose_contents_i_want_in_my_document.py]]
#+END_src
i.e. have the entire contents of a separate file be embedded in my org-mode document when I export it to latex.
How do I embed the contents of a separate file within an org-mode document, and have that content be formatted as source code when exporting?
There is no way to do that in org-mode with a source block that I know of. This will give you what you want if you have minted setup:
\inputminted{python}{your-script.py}
or if you use lsting
\lstinputlisting[language=Python]{source_filename.py}

export from Emacs in rtf using current font-lock?

I'd like to export my latex files (and maybe other files) as rtf files, so that the syntax highlighting will be kept (that is - keep it 'plain text' with colors).
I tried using Org-mode to convert to HTML (thinking later to copy it into LibreOffice and hope for good results), but I couldn't make Org export it with the correct colors.
Is there a way to export buffer to rtf using the current font-lock ?
I think you're looking for M-x htmlfontify-buffer.
You can also take a look at http://www.emacswiki.org/emacs/Htmlize

Can I inline a org file inside another org file?

In latex we can split a big document(paper.tex) into several tex files(abstract.tex,intro.tex ...) which can be inserted inline using \input{paper.tex}.
Is there a similar facility in org-mode?
Just use the include command i.e.
#+INCLUDE abstract.org
#+INCLUDE intro.org
This will inline abstract.org and intro.org in the current org file. See also the org-mode documentation on include files.
Without test, but I think you can just simply add the latex command \input{paper.tex} in any place of .org file you want. It will render the .tex file to final file.
PS: other option: Include-files which are mentioned in the comment.

Using imagemagick instead of mathjax when exporting HTML in org-mode

I want to use imagemagick to create image files instead of MathJax when exporting to HTML.
How would I go about doing this?
I came across LaTeX Fragments from the manual, and it mentions org-format-latex-header variable, but I am unsure what to set this to in order to use imagemagick.
The documentation states you should be able to use the following option at the start of your buffer:
#+OPTIONS: tex:imagemagick
If this doesn't work you may also want to try the latex (not tex) key. i.e.:
#+OPTIONS: latex:imagemagick