Re: [O] Bug: LaTeX block above first heading ignored by latex exporter [8.2.3c (release_8.2.3c-308-gc811bb @ /home/rob/sw/org-mode/lisp/)]

2013-11-29 Thread Rob Stewart
Just to be clear, what is the command I am supposed to be using to
export to latex? I.e., which command is called with combination `C-c
C-e l l` ? I thought it was `org-export-as-latex` , and that
`org-latex-export-as-latex` was deprecated?

However, I have just pulled HEAD in my git clone of
git://orgmode.org/org-mode.git and...

$ grep org-export-as-latex *
$ grep org-latex-export-as-latex *
org-loaddefs.el:;;  org-latex-export-as-latex) ox-latex
ox-latex.el (2
org-loaddefs.el:(autoload 'org-latex-export-as-latex ox-latex \
org-loaddefs.el:  (defun org-latex-export-as-latex
ox.el:  \(defun org-latex-export-as-latex
Binary file ox.elc matches
ox-latex.el:   ((?L As LaTeX buffer org-latex-export-as-latex)
ox-latex.el:(defun org-latex-export-as-latex

Which command *should* I expect to be using?

--
Rob

On 28 November 2013 11:38, Rob Stewart robstewar...@gmail.com wrote:
 On 28 November 2013 10:49, Nicolas Goaziou n.goaz...@gmail.com wrote:

 Unfortunately, I'm unable to reproduce the problem. Anyway, it sounds
 like you're using somehow the old export framework.

 I'm not entirely sure how I do this. But here's a shot at it:

 org-version
 Org-mode version 8.2.1 (release_8.2.1-190-g228ea6 @ 
 /home/rob/sw/org-mode/lisp/)

 list-load-path-shadows
 https://gist.github.com/robstewart57/7690515

 Interestingly, org-export-as-latex does not work:
 org-export-as-latex: Symbol's value as variable is void:
 org-export-latex-default-packages-alist

 But org-latex-export-to-latex does work, generating the unexpected
 latex output. So there may be a problem with using an old exporter.
 But both the output of org-version and list-load-path-shadows would
 have me believe that my org-mode installation at ~/sw/org-mode is the
 presiding org-mode setup. This directory tracks HEAD, and is up to
 date.

 Regards,

 --
 Rob



Re: [O] Bug: LaTeX block above first heading ignored by latex exporter [8.2.3c (release_8.2.3c-308-gc811bb @ /home/rob/sw/org-mode/lisp/)]

2013-11-29 Thread Rob Stewart
More..

I now realise that the command to use is `org-latex-export-to-latex`.
However, my problem persists. This time, I use batch mode, to make
clear that the org-mode repository at /home/rob/sw/org-mode/ is being
used. This reflects HEAD from the git repo.

$ emacs -batch -L ~/sw/org-mode/lisp --visit=test.org -funcall
org-latex-export-to-latex
Loading /usr/share/emacs/site-lisp/site-start.d/auctex.el (source)...
Loading /usr/share/emacs/site-lisp/site-start.d/cmake-init.el (source)...
Loading /usr/share/emacs/site-lisp/site-start.d/desktop-entry-mode-init.el
(source)...
Loading /usr/share/emacs/site-lisp/site-start.d/git-init.el (source)...
Loading /usr/share/emacs/site-lisp/site-start.d/haskell-mode-init.el (source)...
Loading haskell-site-file...
Loading /usr/share/emacs/site-lisp/site-start.d/htmlize-init.el (source)...
Loading /usr/share/emacs/site-lisp/site-start.d/preview-latex.el (source)...
Loading /usr/share/emacs/site-lisp/site-start.d/systemtap-init.el (source)...
Source file `/home/rob/sw/org-mode/lisp/org.el' newer than byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/org-macs.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/org-compat.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/ob-emacs-lisp.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/ob-core.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/ob-exp.el' newer than byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/ob-table.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/ob-ref.el' newer than byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/ob-tangle.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/org-src.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/org-list.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/org-footnote.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/org-element.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/org.el' newer than byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/org-footnote.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/org-macro.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/org-bibtex.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/org-docview.el' newer than
byte-compiled file
OVERVIEW
Loading vc-git...
Source file `/home/rob/sw/org-mode/lisp/ox-latex.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/ox.el' newer than byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/ox-ascii.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/ox-publish.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/ox-html.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/ox-icalendar.el' newer than
byte-compiled file
Source file `/home/rob/sw/org-mode/lisp/ox-latex.el' newer than
byte-compiled file
Saving file /home/rob/Documents/test.tex...
Wrote /home/rob/Documents/test.tex

This test.tex file omits (incorrectly) the following block:

\begin{abstract}
This is my abstract.
\end{abstract}

Before `\section{Introduction}`.

%
\documentclass[11pt]{article}
\author{Joe Bloggs}
\date{\today}
\title{My Title}
\hypersetup{
  pdfkeywords={},
  pdfsubject={},
  pdfcreator={Emacs 24.3.1 (Org mode 8.2.1)}}
\begin{document}

\maketitle
\tableofcontents


\section{Introduction}
\label{sec-1}

Hello.
% Emacs 24.3.1 (Org mode 8.2.1)
\end{document}
%

On 29 November 2013 13:52, Rob Stewart robstewar...@gmail.com wrote:
 Just to be clear, what is the command I am supposed to be using to
 export to latex? I.e., which command is called with combination `C-c
 C-e l l` ? I thought it was `org-export-as-latex` , and that
 `org-latex-export-as-latex` was deprecated?

 However, I have just pulled HEAD in my git clone of
 git://orgmode.org/org-mode.git and...

 $ grep org-export-as-latex *
 $ grep org-latex-export-as-latex *
 org-loaddefs.el:;;  org-latex-export-as-latex) ox-latex
 ox-latex.el (2
 org-loaddefs.el:(autoload 'org-latex-export-as-latex ox-latex \
 org-loaddefs.el:  (defun org-latex-export-as-latex
 ox.el:  \(defun org-latex-export-as-latex
 Binary file ox.elc matches
 ox-latex.el:   ((?L As LaTeX buffer org-latex-export-as-latex)
 ox-latex.el:(defun org-latex-export-as-latex

 Which command *should* I expect to be using?

 --
 Rob

 On 28 November 2013 11:38, Rob Stewart robstewar...@gmail.com wrote:
 On 28 November 2013 10:49, Nicolas Goaziou n.goaz...@gmail.com wrote:

 Unfortunately, I'm unable to reproduce the problem. Anyway, it sounds
 like you're using somehow the old export framework.

 I'm not entirely sure how I do this. But here's a shot at it:

 org-version
 Org-mode version 8.2.1 (release_8.2.1-190-g228ea6 @ 
 

Re: [O] Bug: LaTeX block above first heading ignored by latex exporter [8.2.3c (release_8.2.3c-308-gc811bb @ /home/rob/sw/org-mode/lisp/)]

2013-11-29 Thread Nicolas Goaziou
Hello,

Rob Stewart robstewar...@gmail.com writes:

 This test.tex file omits (incorrectly) the following block:

 \begin{abstract}
 This is my abstract.
 \end{abstract}

 Before `\section{Introduction}`.

Now I remember. This is a feature.

When headlines are selectively exported, i.e. when you use :export: tag
or equivalent, text before the first headline is ignored.

This was a request from François Pinard, a few months ago, on the ML.


Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: LaTeX block above first heading ignored by latex exporter [8.2.3c (release_8.2.3c-308-gc811bb @ /home/rob/sw/org-mode/lisp/)]

2013-11-29 Thread Rob Stewart
On 29 November 2013 17:44, Nicolas Goaziou n.goaz...@gmail.com wrote:

 Now I remember. This is a feature.

 When headlines are selectively exported, i.e. when you use :export: tag
 or equivalent, text before the first headline is ignored.

 This was a request from François Pinard, a few months ago, on the ML.

Ah! Thanks, I can confirm this has resolved my issue.

1. Which git commit changed this behaviour, i.e. implemented
Francois's feature request?
2. I'd like to share this lesson learned. Is there a way I could add
this to the org-mode webpages? Probably the sensible page to mention
this behaviour is: http://orgmode.org/manual/Export-settings.html .
Are the org-mode pages in a git repo somewhere? I'd  be happy to offer
a patch.

Thanks again.

--
Rob



Re: [O] Bug: LaTeX block above first heading ignored by latex exporter [8.2.3c (release_8.2.3c-308-gc811bb @ /home/rob/sw/org-mode/lisp/)]

2013-11-29 Thread Nicolas Goaziou
Rob Stewart robstewar...@gmail.com writes:

 On 29 November 2013 17:44, Nicolas Goaziou n.goaz...@gmail.com wrote:

 Now I remember. This is a feature.

 When headlines are selectively exported, i.e. when you use :export: tag
 or equivalent, text before the first headline is ignored.

 This was a request from François Pinard, a few months ago, on the ML.

 Ah! Thanks, I can confirm this has resolved my issue.

 1. Which git commit changed this behaviour, i.e. implemented
 Francois's feature request?

7cf4406088d4d7f50c35c6ba7ca3c351db2086bc

 2. I'd like to share this lesson learned. Is there a way I could add
 this to the org-mode webpages? Probably the sensible page to mention
 this behaviour is: http://orgmode.org/manual/Export-settings.html .
 Are the org-mode pages in a git repo somewhere? I'd  be happy to offer
 a patch.

This could be documented in the manual, indeed.  If you want to take
care of this, you'll need to patch org.texi in doc/ directory.


Thank you.


Regards,

-- 
Nicolas Goaziou



[O] Bug: LaTeX block above first heading ignored by latex exporter [8.2.3c (release_8.2.3c-308-gc811bb @ /home/rob/sw/org-mode/lisp/)]

2013-11-28 Thread Rob Stewart

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.


I have a simple orgmode document that has a #+BEGIN_LATEX .. #+END_LATEX
block before the first heading Introduction. When this heading is not
exported, i.e. there are no headings, then the LaTeX block is properly
exported. When this heading is exported, the LaTeX block is omitted from
the exported document.

DOCUMENT:

#+LaTeX_CLASS: article

#+TITLE: My Title
#+AUTHOR: Joe Bloggs
#+OPTIONS: H:5

#+BEGIN_LATEX
\begin{abstract}
This is my abstract.
\end{abstract}
#+END_LATEX

#+TOC: headlines 2

* Introduction :export:

Hello.


EXPECTED:

\documentclass[11pt]{article}
\author{Joe Bloggs}
\date{\today}
\title{My Title}
\hypersetup{
  pdfkeywords={},
  pdfsubject={},
  pdfcreator={Emacs 24.3.1 (Org mode 8.2.3c)}}
\begin{document}

\maketitle
\tableofcontents

\begin{abstract}
This is my abstract.
\end{abstract}

\setcounter{tocdepth}{2}
\tableofcontents

\section{Introduction}
\label{sec-1}

Hello.
% Emacs 24.3.1 (Org mode 8.2.3c)
\end{document}


ACTUAL:

\documentclass[11pt]{article}
\author{Joe Bloggs}
\date{\today}
\title{My Title}
\hypersetup{
  pdfkeywords={},
  pdfsubject={},
  pdfcreator={Emacs 24.3.1 (Org mode 8.2.3c)}}
\begin{document}

\maketitle
\tableofcontents


\section{Introduction}
\label{sec-1}

Hello.
% Emacs 24.3.1 (Org mode 8.2.3c)
\end{document}




Emacs  : GNU Emacs 24.3.1 (i686-redhat-linux-gnu, GTK+ Version 3.8.2)
 of 2013-08-14 on buildvm-06.phx2.fedoraproject.org
Package: Org-mode version 8.2.3c (release_8.2.3c-308-gc811bb @ 
/home/rob/sw/org-mode/lisp/)

current state:
==
(setq
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point 
org-babel-execute-safely-maybe)
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-html-format-inlinetask-function 'ignore
 org-export-with-drawers nil
 org-export-copy-to-kill-ring t
 org-export-date-timestamp-format %Y-%m-%d
 org-export-with-tags 'not-in-toc
 org-export-preprocess-before-selecting-backend-code-hook 
'(org-beamer-select-beamer-code)
 org-tab-first-hook '(org-hide-block-toggle-maybe 
org-src-native-tab-command-maybe
  org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-hide-inline-tasks org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-babel-pre-tangle-hook '(save-buffer)
 org-occur-hook '(org-first-headline-recenter)
 org-export-latex-after-blockquotes-hook 
'(org-special-blocks-convert-latex-special-cookies)
 org-html-format-headline-function 'ignore
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-latex-classes '((phd \\documentclass{hwthesis} (\\chapter{%s} . 
\\chapter*{%s})
  (\\section{%s} . \\section*{%s})
  (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s})
  (\\paragraph{%s} . \\paragraph*{%s})
  (\\subparagraph{%s} . \\subparagraph*{%s}))
 (article \\documentclass[11pt]{article}
  (\\section{%s} . \\section*{%s})
  (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s})
  (\\paragraph{%s} . \\paragraph*{%s})
  (\\subparagraph{%s} . \\subparagraph*{%s}))
 (report \\documentclass[11pt]{report} (\\part{%s} . 
\\part*{%s})
  (\\chapter{%s} . \\chapter*{%s}) (\\section{%s} . 
\\section*{%s})
  (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s}))
 (book \\documentclass[11pt]{book} (\\part{%s} . 
\\part*{%s})
  (\\chapter{%s} . \\chapter*{%s}) (\\section{%s} . 
\\section*{%s})
  (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s}))
 )
 org-latex-format-drawer-function '(lambda (name contents) contents)
 

Re: [O] Bug: LaTeX block above first heading ignored by latex exporter [8.2.3c (release_8.2.3c-308-gc811bb @ /home/rob/sw/org-mode/lisp/)]

2013-11-28 Thread Nicolas Goaziou
Hello,

Rob Stewart robstewar...@gmail.com writes:

 I have a simple orgmode document that has a #+BEGIN_LATEX .. #+END_LATEX
 block before the first heading Introduction. When this heading is not
 exported, i.e. there are no headings, then the LaTeX block is properly
 exported. When this heading is exported, the LaTeX block is omitted from
 the exported document.

Thank you for your report.

Unfortunately, I'm unable to reproduce the problem. Anyway, it sounds
like you're using somehow the old export framework.

Could you double check your installation and the function you're calling
to export that buffer ?


Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: LaTeX block above first heading ignored by latex exporter [8.2.3c (release_8.2.3c-308-gc811bb @ /home/rob/sw/org-mode/lisp/)]

2013-11-28 Thread Rob Stewart
On 28 November 2013 10:49, Nicolas Goaziou n.goaz...@gmail.com wrote:

 Unfortunately, I'm unable to reproduce the problem. Anyway, it sounds
 like you're using somehow the old export framework.

I'm not entirely sure how I do this. But here's a shot at it:

org-version
Org-mode version 8.2.1 (release_8.2.1-190-g228ea6 @ /home/rob/sw/org-mode/lisp/)

list-load-path-shadows
https://gist.github.com/robstewart57/7690515

Interestingly, org-export-as-latex does not work:
org-export-as-latex: Symbol's value as variable is void:
org-export-latex-default-packages-alist

But org-latex-export-to-latex does work, generating the unexpected
latex output. So there may be a problem with using an old exporter.
But both the output of org-version and list-load-path-shadows would
have me believe that my org-mode installation at ~/sw/org-mode is the
presiding org-mode setup. This directory tracks HEAD, and is up to
date.

Regards,

--
Rob