emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Problem with including file
@ 2019-05-02  5:03 Andreas Kiermeier
  2019-05-02  8:26 ` Sharon Kimble
  2019-05-02  8:37 ` Nicolas Goaziou
  0 siblings, 2 replies; 7+ messages in thread
From: Andreas Kiermeier @ 2019-05-02  5:03 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2307 bytes --]

Hi,

I've just run into a problem with exporting a file to latex.

In a nutshell, my org files usually contain various analyses and output in
R.

I generally don't include the source in the file, but instead tangle all
source blocks at the end and include the source code file in an Appendix.
This has worked in the past, but now the included file is not actually
include.

An example (close to minimal) consist of the two files below - test.org and
test.R (both in the same folder).

When exporting test.org to PDF, the source block is correctly exported,
while the included file does not appear to be included at all (see also
test.tex below).

Any thoughts would be greatly appreciated.

Thanks,

Andreas

 

--- begin test.org ----

#+STARTUP: content indent hidestars fninline

#+PROPERTY: header-args:R :session *R* :cache no

#+PROPERTY: header-args+ :results output

#+PROPERTY: header-args+ :exports results

#+PROPERTY: header-args+ :eval never-export

#+PROPERTY: header-args+ :tangle yes

#+OPTIONS: toc:nil H:5

#+LATEX_HEADER: \usepackage{minted}

 

* Intro

 

#+begin_src R :results none :exports code

ls()

#+end_src

 

* Data Analysis Source Code                                       

 

#+INCLUDE: "test.R" src R

--- end test.org ----

 

--- begin test.R ----

ls()

--- end test.R ----

 

--- begin test.tex ----

% Created 2019-05-02 Thu 14:08

% Intended LaTeX compiler: pdflatex

\documentclass[11pt]{article}

\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}

\usepackage{graphicx}

\usepackage{grffile}

\usepackage{longtable}

\usepackage{wrapfig}

\usepackage{rotating}

\usepackage[normalem]{ulem}

\usepackage{amsmath}

\usepackage{textcomp}

\usepackage{amssymb}

\usepackage{capt-of}

\usepackage{hyperref}

\usepackage{here}

\usepackage{color}

\usepackage{fancyhdr}

\usepackage{fancybox}

\usepackage{xspace}

\usepackage{minted}

\author{Andreas Kiermeier}

\date{\today}

\title{}

\hypersetup{

pdfauthor={Andreas Kiermeier},

pdftitle={},

pdfkeywords={},

pdfsubject={},

pdfcreator={Emacs 25.3.1 (Org mode 9.2.3)}, 

 pdflang={English}}

\begin{document}

 

 

\section{Intro}

\label{sec:org6eb9726}

 

\begin{minted}[]{r}

ls()

\end{minted}

 

\section{Data Analysis Source Code}

\label{sec:org98a88b4}

\end{document}

--- begin test.text ----


[-- Attachment #2: Type: text/html, Size: 6859 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem with including file
  2019-05-02  5:03 Problem with including file Andreas Kiermeier
@ 2019-05-02  8:26 ` Sharon Kimble
  2019-05-02  8:40   ` Andreas Kiermeier
  2019-05-02  8:37 ` Nicolas Goaziou
  1 sibling, 1 reply; 7+ messages in thread
From: Sharon Kimble @ 2019-05-02  8:26 UTC (permalink / raw)
  To: Andreas Kiermeier; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 3142 bytes --]

"Andreas Kiermeier" <andreas.kiermeier@gmail.com> writes:
Andreas.

Just a very quick glance at your problem, and in the tex output you've shown there is a double closing bracket on 'pdflang={English}}'. If you correct that then your output might be better, I don't know, but its certainly worth a try.

Thanks
Sharon.

> Hi,
>
> I’ve just run into a problem with exporting a file to latex.
>
> In a nutshell, my org files usually contain various analyses and output in R.
>
> I generally don’t include the source in the file, but instead tangle all source blocks at the end and include the source code file in an Appendix. This has worked in
> the past, but now the included file is not actually include.
>
> An example (close to minimal) consist of the two files below - test.org and test.R (both in the same folder).
>
> When exporting test.org to PDF, the source block is correctly exported, while the included file does not appear to be included at all (see also test.tex below).
>
> Any thoughts would be greatly appreciated.
>
> Thanks,
>
> Andreas
>
> --- begin test.org ----
>
> #+STARTUP: content indent hidestars fninline
>
> #+PROPERTY: header-args:R :session *R* :cache no
>
> #+PROPERTY: header-args+ :results output
>
> #+PROPERTY: header-args+ :exports results
>
> #+PROPERTY: header-args+ :eval never-export
>
> #+PROPERTY: header-args+ :tangle yes
>
> #+OPTIONS: toc:nil H:5
>
> #+LATEX_HEADER: \usepackage{minted}
>
> * Intro
>
> #+begin_src R :results none :exports code
>
> ls()
>
> #+end_src
>
> * Data Analysis Source Code                                      
>
> #+INCLUDE: "test.R" src R
>
> --- end test.org ----
>
> --- begin test.R ----
>
> ls()
>
> --- end test.R ----
>
> --- begin test.tex ----
>
> % Created 2019-05-02 Thu 14:08
>
> % Intended LaTeX compiler: pdflatex
>
> \documentclass[11pt]{article}
>
> \usepackage[utf8]{inputenc}
>
> \usepackage[T1]{fontenc}
>
> \usepackage{graphicx}
>
> \usepackage{grffile}
>
> \usepackage{longtable}
>
> \usepackage{wrapfig}
>
> \usepackage{rotating}
>
> \usepackage[normalem]{ulem}
>
> \usepackage{amsmath}
>
> \usepackage{textcomp}
>
> \usepackage{amssymb}
>
> \usepackage{capt-of}
>
> \usepackage{hyperref}
>
> \usepackage{here}
>
> \usepackage{color}
>
> \usepackage{fancyhdr}
>
> \usepackage{fancybox}
>
> \usepackage{xspace}
>
> \usepackage{minted}
>
> \author{Andreas Kiermeier}
>
> \date{\today}
>
> \title{}
>
> \hypersetup{
>
> pdfauthor={Andreas Kiermeier},
>
> pdftitle={},
>
> pdfkeywords={},
>
> pdfsubject={},
>
> pdfcreator={Emacs 25.3.1 (Org mode 9.2.3)},
>
>  pdflang={English}}
>
> \begin{document}
>
> \section{Intro}
>
> \label{sec:org6eb9726}
>
> \begin{minted}[]{r}
>
> ls()
>
> \end{minted}
>
> \section{Data Analysis Source Code}
>
> \label{sec:org98a88b4}
>
> \end{document}
>
> --- begin test.text ----
>

-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk
Debian 9.9, fluxbox 1.3.7, emacs 26.2, org 9.2.3

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem with including file
  2019-05-02  5:03 Problem with including file Andreas Kiermeier
  2019-05-02  8:26 ` Sharon Kimble
@ 2019-05-02  8:37 ` Nicolas Goaziou
  2019-05-02  8:45   ` Andreas Kiermeier
  1 sibling, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2019-05-02  8:37 UTC (permalink / raw)
  To: Andreas Kiermeier; +Cc: emacs-orgmode

Hello,

"Andreas Kiermeier" <andreas.kiermeier@gmail.com> writes:

> --- begin test.org ----
>
> #+STARTUP: content indent hidestars fninline
>
> #+PROPERTY: header-args:R :session *R* :cache no
>
> #+PROPERTY: header-args+ :results output
>
> #+PROPERTY: header-args+ :exports results

Here, you prevent source blocks' contents from being exported.


[...]

> #+begin_src R :results none :exports code
>
> ls()
>
> #+end_src

This one is exported because ":exports code"
>
>
>  
>
> * Data Analysis Source Code                                       
>
>  
>
> #+INCLUDE: "test.R" src R

This one, which is equivalent to

    #+begin_src R
    ls()
    #+end_src

defaults to :exports results and, therefore, is not exported.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem with including file
  2019-05-02  8:26 ` Sharon Kimble
@ 2019-05-02  8:40   ` Andreas Kiermeier
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Kiermeier @ 2019-05-02  8:40 UTC (permalink / raw)
  To: 'Sharon Kimble'; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 3715 bytes --]

Hi Sharon,

The tex file is straight out of the export, and the second ”}” matches the “\hypersetup{“ a few lines earlier.

Thanks,

Andreas

 

From: Sharon Kimble <boudiccas@skimble.plus.com> 
Sent: Thursday, 2 May 2019 17:57
To: Andreas Kiermeier <andreas.kiermeier@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [O] Problem with including file

 

"Andreas Kiermeier" <andreas.kiermeier@gmail.com <mailto:andreas.kiermeier@gmail.com> > writes: 
Andreas. 

Just a very quick glance at your problem, and in the tex output you've shown there is a double closing bracket on 'pdflang={English}}'. If you correct that then your output might be better, I don't know, but its certainly worth a try.

Thanks 
Sharon. 

> Hi, 
> 
> I’ve just run into a problem with exporting a file to latex. 
> 
> In a nutshell, my org files usually contain various analyses and output in R. 
> 
> I generally don’t include the source in the file, but instead tangle all source blocks at the end and include the source code file in an Appendix. This has worked in

> the past, but now the included file is not actually include. 
> 
> An example (close to minimal) consist of the two files below - test.org and test.R (both in the same folder). 
> 
> When exporting test.org to PDF, the source block is correctly exported, while the included file does not appear to be included at all (see also test.tex below).

> 
> Any thoughts would be greatly appreciated. 
> 
> Thanks, 
> 
> Andreas 
> 
> --- begin test.org ---- 
> 
> #+STARTUP: content indent hidestars fninline 
> 
> #+PROPERTY: header-args:R :session *R* :cache no 
> 
> #+PROPERTY: header-args+ :results output 
> 
> #+PROPERTY: header-args+ :exports results 
> 
> #+PROPERTY: header-args+ :eval never-export 
> 
> #+PROPERTY: header-args+ :tangle yes 
> 
> #+OPTIONS: toc:nil H:5 
> 
> #+LATEX_HEADER: \usepackage{minted} 
> 
> * Intro 
> 
> #+begin_src R :results none :exports code 
> 
> ls() 
> 
> #+end_src 
> 
> * Data Analysis Source Code                                      
> 
> #+INCLUDE: "test.R" src R 
> 
> --- end test.org ---- 
> 
> --- begin test.R ---- 
> 
> ls() 
> 
> --- end test.R ---- 
> 
> --- begin test.tex ---- 
> 
> % Created 2019-05-02 Thu 14:08 
> 
> % Intended LaTeX compiler: pdflatex 
> 
> \documentclass[11pt]{article} 
> 
> \usepackage[utf8]{inputenc} 
> 
> \usepackage[T1]{fontenc} 
> 
> \usepackage{graphicx} 
> 
> \usepackage{grffile} 
> 
> \usepackage{longtable} 
> 
> \usepackage{wrapfig} 
> 
> \usepackage{rotating} 
> 
> \usepackage[normalem]{ulem} 
> 
> \usepackage{amsmath} 
> 
> \usepackage{textcomp} 
> 
> \usepackage{amssymb} 
> 
> \usepackage{capt-of} 
> 
> \usepackage{hyperref} 
> 
> \usepackage{here} 
> 
> \usepackage{color} 
> 
> \usepackage{fancyhdr} 
> 
> \usepackage{fancybox} 
> 
> \usepackage{xspace} 
> 
> \usepackage{minted} 
> 
> \author{Andreas Kiermeier} 
> 
> \date{\today} 
> 
> \title{} 
> 
> \hypersetup{ 
> 
> pdfauthor={Andreas Kiermeier}, 
> 
> pdftitle={}, 
> 
> pdfkeywords={}, 
> 
> pdfsubject={}, 
> 
> pdfcreator={Emacs 25.3.1 (Org mode 9.2.3)}, 
> 
>  pdflang={English}} 
> 
> \begin{document} 
> 
> \section{Intro} 
> 
> \label{sec:org6eb9726} 
> 
> \begin{minted}[]{r} 
> 
> ls() 
> 
> \end{minted} 
> 
> \section{Data Analysis Source Code} 
> 
> \label{sec:org98a88b4} 
> 
> \end{document} 
> 
> --- begin test.text ---- 
> 

-- 
A taste of linux = http://www.sharons.org.uk 
TGmeds = http://www.tgmeds.org.uk 
DrugFacts = https://www.drugfacts.org.uk 
Debian 9.9, fluxbox 1.3.7, emacs 26.2, org 9.2.3 


[-- Attachment #2: Type: text/html, Size: 7282 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem with including file
  2019-05-02  8:37 ` Nicolas Goaziou
@ 2019-05-02  8:45   ` Andreas Kiermeier
  2019-05-02 11:23     ` Jamie Forth
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Kiermeier @ 2019-05-02  8:45 UTC (permalink / raw)
  To: 'Nicolas Goaziou'; +Cc: emacs-orgmode

Thanks for the quick reply.
Of course you are spot on, Nicolas.
Changing to  
#+PROPERTY: header-args+ :exports code
Or 
#+PROPERTY: header-args+ :exports both
Does indeed fix the problem.
The reason I did tried to do it this way was because it's simpler than
having to say :export results for every source block.
But, it a second call to 
#+PROPERTY: header-args+ :exports code
Just before the #+INCLUDE gets everything working perfectly.
Thanks again!
Andreas

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem with including file
  2019-05-02  8:45   ` Andreas Kiermeier
@ 2019-05-02 11:23     ` Jamie Forth
  2019-05-03  1:44       ` Andreas Kiermeier
  0 siblings, 1 reply; 7+ messages in thread
From: Jamie Forth @ 2019-05-02 11:23 UTC (permalink / raw)
  To: emacs-orgmode

Hi Andreas,

"Andreas Kiermeier" <andreas.kiermeier@gmail.com> writes:

> The reason I did tried to do it this way was because it's simpler than
> having to say :export results for every source block.
> But, it a second call to 
>
> #+PROPERTY: header-args+ :exports code
> Just before the #+INCLUDE gets everything working perfectly.

A second #+PROPERTY keyword will just append an additional file property
(the second one shadowing the first). Setting the header-args in
property drawers would do what you want.

#+PROPERTY: header-args:R :session *R* :cache no
#+PROPERTY: header-args+ :results output
#+PROPERTY: header-args+ :eval never-export
#+PROPERTY: header-args+ :tangle yes

* Intro
:PROPERTIES:
:header-args: :exports results
:END:

* Data Analysis Source Code
:PROPERTIES:
:header-args: :exports code
:END:

https://orgmode.org/manual/Using-Header-Arguments.html#Header-arguments-in-Org-mode-properties

--
Jamie

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem with including file
  2019-05-02 11:23     ` Jamie Forth
@ 2019-05-03  1:44       ` Andreas Kiermeier
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Kiermeier @ 2019-05-03  1:44 UTC (permalink / raw)
  To: 'Jamie Forth', emacs-orgmode

Hi Jamie,
Thanks for the info and link.
Seems like I got too excited after Nicolas' reply and noticed exactly what
you pointed out.
I've now worked out that leaving the original buffer-wide properties in
place is OK.
But, as you suggested, I've added property drawer to the heading for the
appendix.
This needed inclusion of a few more of the buffer-wide header-arguments, but
at least it saves having to specify a property drawer for every section.
Thanks again!
Andreas

> -----Original Message-----
> From: Emacs-orgmode <emacs-orgmode-
> bounces+andreas.kiermeier=gmail.com@gnu.org> On Behalf Of Jamie Forth
> Sent: Thursday, 2 May 2019 20:53
> To: emacs-orgmode@gnu.org
> Subject: Re: [O] Problem with including file
> 
> Hi Andreas,
> 
> "Andreas Kiermeier" <andreas.kiermeier@gmail.com> writes:
> 
> > The reason I did tried to do it this way was because it's simpler than
> > having to say :export results for every source block.
> > But, it a second call to
> >
> > #+PROPERTY: header-args+ :exports code Just before the #+INCLUDE gets
> > everything working perfectly.
> 
> A second #+PROPERTY keyword will just append an additional file property
> (the second one shadowing the first). Setting the header-args in property
> drawers would do what you want.
> 
> #+PROPERTY: header-args:R :session *R* :cache no
> #+PROPERTY: header-args+ :results output
> #+PROPERTY: header-args+ :eval never-export
> #+PROPERTY: header-args+ :tangle yes
> 
> * Intro
> :PROPERTIES:
> :header-args: :exports results
> :END:
> 
> * Data Analysis Source Code
> :PROPERTIES:
> :header-args: :exports code
> :END:
> 
> https://orgmode.org/manual/Using-Header-Arguments.html#Header-
> arguments-in-Org-mode-properties
> 
> --
> Jamie
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-05-03  1:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-02  5:03 Problem with including file Andreas Kiermeier
2019-05-02  8:26 ` Sharon Kimble
2019-05-02  8:40   ` Andreas Kiermeier
2019-05-02  8:37 ` Nicolas Goaziou
2019-05-02  8:45   ` Andreas Kiermeier
2019-05-02 11:23     ` Jamie Forth
2019-05-03  1:44       ` Andreas Kiermeier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).