emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* worg latex example "11 Styling the Frontmatter"
@ 2012-03-08 16:29 Myles English
  2012-03-08 16:45 ` Myles English
  0 siblings, 1 reply; 8+ messages in thread
From: Myles English @ 2012-03-08 16:29 UTC (permalink / raw)
  To: emacs-orgmode Mode

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

Hi,

I am trying to get a custom title page and abstract before the TOC in a
pdf.

Worg has an example on this page:

http://orgmode.org/worg/org-tutorials/org-latex-export.html

at the section titled "11 Styling the Frontmatter"
However, the example doesn't work for me as expected.

To reproduce:

+ save the attached files (testAbs.org, title.tex) in the same directory
+ open testAbs.org and do "C-c e d" to export to pdf

I would expect the Abstract and text to be shown in the final pdf but it
is absent.

If I put a character between the lines #+LATEX_HEADER
and #+BEGIN_abstract then the abstract title and text are shown as
expected.

The above is using release_7.8.03-566-gf8efc63.  Am I doing something
wrong?

Thanks,

Myles


[-- Attachment #2: testAbs.org --]
[-- Type: text/plain, Size: 622 bytes --]

#+LATEX_HEADER: \input{/home/myles/tmp/bugs/title.tex}

#+BEGIN_abstract
  Here is my abstract, it is a fine abstract.
#+END_abstract
#+LATEX: \tableofcontents
#+LATEX: \listoftables
#+LATEX: \listoffigures

* Foo
foo

* Bar
bar

#+BEGIN_SRC emacs-lisp :exports none
(defun org-export-latex-no-toc (depth)  
    (when depth
      (format "%% Org-mode is exporting headings to %s levels.\n"
              depth)))
  (setq org-export-latex-format-toc-function 'org-export-latex-no-toc)
#+END_SRC

#+RESULTS:
: org-export-latex-no-toc

(add-to-list 'load-path
	     "~/.emacs.d/plugins/org-mode/lisp")
(require 'org-install)

[-- Attachment #3: title.tex --]
[-- Type: text/plain, Size: 67 bytes --]

\renewcommand\maketitle{\begin{titlepage}%
FOO
\end{titlepage}%
}


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

* Re: worg latex example "11 Styling the Frontmatter"
  2012-03-08 16:29 worg latex example "11 Styling the Frontmatter" Myles English
@ 2012-03-08 16:45 ` Myles English
  2012-03-08 18:39   ` Nick Dokos
  2012-03-08 19:01   ` Thomas S. Dye
  0 siblings, 2 replies; 8+ messages in thread
From: Myles English @ 2012-03-08 16:45 UTC (permalink / raw)
  To: Myles English; +Cc: emacs-orgmode Mode

>> On Thu, 08 Mar 2012 16:29:36 +0000, Myles English said:

  > Hi, I am trying to get a custom title page and abstract before the
  > TOC in a pdf.

  > Worg has an example on this page:

  > http://orgmode.org/worg/org-tutorials/org-latex-export.html

  > at the section titled "11 Styling the Frontmatter" However, the
  > example doesn't work for me as expected.

  > To reproduce:

  > + save the attached files (testAbs.org, title.tex) in the same
  > directory + open testAbs.org and do "C-c e d" to export to pdf

  > I would expect the Abstract and text to be shown in the final pdf
  > but it is absent.

  > If I put a character between the lines #+LATEX_HEADER
  > and #+BEGIN_abstract then the abstract title and text are shown as
  > expected.

  > The above is using release_7.8.03-566-gf8efc63.  Am I doing
  > something wrong?

  > Thanks,

  > Myles

So the two files are:

,--------------------------- testAbs.org ------------------------------
| #+LATEX_HEADER: \input{/home/myles/tmp/bugs/title.tex}         
| #+BEGIN_abstract                                                       
|   Here is my abstract, it is a fine abstract.                          
| #+END_abstract                                                         
| #+LATEX: \tableofcontents                                              
| #+LATEX: \listoftables                                                 
| #+LATEX: \listoffigures                                                
|                                                                        
| * Foo                                                                  
| foo                                                                    
|                                                                        
| * Bar                                                                  
| bar                                                                    
|                                                                        
| #+BEGIN_SRC emacs-lisp :exports none                                   
| (defun org-export-latex-no-toc (depth) (when depth (format "%% Org-mode
|     is exporting headings to %s levels.\n" depth))) (setq              
|     org-export-latex-format-toc-function 'org-export-latex-no-toc)     
| #+END_SRC                                                              
`------------------------------------------------------------------------

,------------------------------title.tex--------
|                                               
| \renewcommand\maketitle{\begin{titlepage}%
| FOO
| \end{titlepage}% }                            
`-----------------------------------------------

Myles

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

* Re: worg latex example "11 Styling the Frontmatter"
  2012-03-08 16:45 ` Myles English
@ 2012-03-08 18:39   ` Nick Dokos
  2012-03-09  1:32     ` Myles English
  2012-03-08 19:01   ` Thomas S. Dye
  1 sibling, 1 reply; 8+ messages in thread
From: Nick Dokos @ 2012-03-08 18:39 UTC (permalink / raw)
  To: emacs-orgmode Mode; +Cc: Myles English, nicholas.dokos

Myles English <mylesenglish@gmail.com> wrote:

> 
> So the two files are:
> 
> ,--------------------------- testAbs.org ------------------------------
> | #+LATEX_HEADER: \input{/home/myles/tmp/bugs/title.tex}         
> | #+BEGIN_abstract                                                       
> |   Here is my abstract, it is a fine abstract.                          
> | #+END_abstract                                                         
> | #+LATEX: \tableofcontents                                              
> | #+LATEX: \listoftables                                                 
> | #+LATEX: \listoffigures                                                
> |                                                                        
> | * Foo                                                                  
> | foo                                                                    
> |                                                                        
> | * Bar                                                                  
> | bar                                                                    
> |                                                                        
> | #+BEGIN_SRC emacs-lisp :exports none                                   
> | (defun org-export-latex-no-toc (depth) (when depth (format "%% Org-mode
> |     is exporting headings to %s levels.\n" depth))) (setq              
> |     org-export-latex-format-toc-function 'org-export-latex-no-toc)     
> | #+END_SRC                                                              
> `------------------------------------------------------------------------
> 
> ,------------------------------title.tex--------
> |                                               
> | \renewcommand\maketitle{\begin{titlepage}%
> | FOO
> | \end{titlepage}% }                            
> `-----------------------------------------------
> 

You have commented out the closing brace in title.tex. It should be

--8<---------------cut here---------------start------------->8---
\renewcommand\maketitle{\begin{titlepage}%
FOO
\end{titlepage}%
}                            
--8<---------------cut here---------------end--------------->8---

Nick

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

* Re: worg latex example "11 Styling the Frontmatter"
  2012-03-08 16:45 ` Myles English
  2012-03-08 18:39   ` Nick Dokos
@ 2012-03-08 19:01   ` Thomas S. Dye
  2012-03-09  1:29     ` Myles English
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas S. Dye @ 2012-03-08 19:01 UTC (permalink / raw)
  To: emacs-orgmode Mode; +Cc: Myles English

Aloha Myles,

Your example works for me with emacs -q.  I had to change the \input{}
command to \input{title}, since I'm not working at /home/myles.  I saved
the tex file to title.tex, put it in the same directory as the org file,
evaluated the source block (with :results silent), and exported.  I got
a 2 page pdf with FOO on the first page and a second page with all the
rest.

I'm not sure what is going wrong at your end, but suspect the \input{}
command might not be picking up your .tex file.  Do you see something in
the .log file produced by LaTeX?

All the best,
Tom

Myles English <mylesenglish@gmail.com> writes:

>>> On Thu, 08 Mar 2012 16:29:36 +0000, Myles English said:
>
>   > Hi, I am trying to get a custom title page and abstract before the
>   > TOC in a pdf.
>
>   > Worg has an example on this page:
>
>   > http://orgmode.org/worg/org-tutorials/org-latex-export.html
>
>   > at the section titled "11 Styling the Frontmatter" However, the
>   > example doesn't work for me as expected.
>
>   > To reproduce:
>
>   > + save the attached files (testAbs.org, title.tex) in the same
>   > directory + open testAbs.org and do "C-c e d" to export to pdf
>
>   > I would expect the Abstract and text to be shown in the final pdf
>   > but it is absent.
>
>   > If I put a character between the lines #+LATEX_HEADER
>   > and #+BEGIN_abstract then the abstract title and text are shown as
>   > expected.
>
>   > The above is using release_7.8.03-566-gf8efc63.  Am I doing
>   > something wrong?
>
>   > Thanks,
>
>   > Myles
>
> So the two files are:
>
> ,--------------------------- testAbs.org ------------------------------
> | #+LATEX_HEADER: \input{/home/myles/tmp/bugs/title.tex}         
> | #+BEGIN_abstract                                                       
> |   Here is my abstract, it is a fine abstract.                          
> | #+END_abstract                                                         
> | #+LATEX: \tableofcontents                                              
> | #+LATEX: \listoftables                                                 
> | #+LATEX: \listoffigures                                                
> |                                                                        
> | * Foo                                                                  
> | foo                                                                    
> |                                                                        
> | * Bar                                                                  
> | bar                                                                    
> |                                                                        
> | #+BEGIN_SRC emacs-lisp :exports none                                   
> | (defun org-export-latex-no-toc (depth) (when depth (format "%% Org-mode
> |     is exporting headings to %s levels.\n" depth))) (setq              
> |     org-export-latex-format-toc-function 'org-export-latex-no-toc)     
> | #+END_SRC                                                              
> `------------------------------------------------------------------------
>
> ,------------------------------title.tex--------
> |                                               
> | \renewcommand\maketitle{\begin{titlepage}%
> | FOO
> | \end{titlepage}% }                            
> `-----------------------------------------------
>
> Myles
>
>

-- 
Thomas S. Dye
http://www.tsdye.com

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

* Re: worg latex example "11 Styling the Frontmatter"
  2012-03-08 19:01   ` Thomas S. Dye
@ 2012-03-09  1:29     ` Myles English
  2012-03-09  4:20       ` Thomas S. Dye
  0 siblings, 1 reply; 8+ messages in thread
From: Myles English @ 2012-03-09  1:29 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs-orgmode Mode


>> On Thu, 08 Mar 2012 09:01:01 -1000, Thomas S Dye said:

  > Aloha Myles, Your example works for me with emacs -q.  I had to
  > change the \input{} command to \input{title}, since I'm not working
  > at /home/myles.  I saved the tex file to title.tex, put it in the
  > same directory as the org file, evaluated the source block
  > (with :results silent), and exported.  I got a 2 page pdf with FOO
  > on the first page and a second page with all the rest.

  > I'm not sure what is going wrong at your end, but suspect the
  > \input{} command might not be picking up your .tex file.  Do you see
  > something in the .log file produced by LaTeX?

  > All the best, Tom

  > Myles English <mylesenglish@gmail.com> writes:

  >>>> On Thu, 08 Mar 2012 16:29:36 +0000, Myles English said:
  >> 
  >> > Hi, I am trying to get a custom title page and abstract before
  >> the > TOC in a pdf.
  >> 
  >> > Worg has an example on this page:
  >> 
  >> > http://orgmode.org/worg/org-tutorials/org-latex-export.html
  >> 
  >> > at the section titled "11 Styling the Frontmatter" However, the >
  >> example doesn't work for me as expected.
  >> 
  >> > To reproduce:
  >> 
  >> > + save the attached files (testAbs.org, title.tex) in the same >
  >> directory + open testAbs.org and do "C-c e d" to export to pdf
  >> 
  >> > I would expect the Abstract and text to be shown in the final pdf
  >> > but it is absent.
  >> 
  >> > If I put a character between the lines #+LATEX_HEADER >
  >> and #+BEGIN_abstract then the abstract title and text are shown as
  >> > expected.
  >> 
  >> > The above is using release_7.8.03-566-gf8efc63.  Am I doing >
  >> something wrong?

Tom,

Thanks very much for checking it.  It does pick up the title.tex file
and I don't get a log file but the testAbs.tex file (see below) shows
that the abstract title is missing and the abstract text is entered as
the \title{}.

If I start emacs -q then execute this block, it seems to report that
orgmode is a mixture of version 7.7 and 7.8.

#+BEGIN_SRC emacs-lisp :exports none
(add-to-list 'load-path
	     "~/.emacs.d/plugins/org-mode/lisp")
(require 'org-install)
(org-version)
#+END_SRC

#+results:
: Org-mode version 7.7 (release_7.8.03.566.gf8efc)

Does that look normal?  Exporting as before then gives the file below.

Myles


File testAbs.tex contains:

% Created 2012-03-09 Fri 01:11
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{soul}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{hyperref}
\tolerance=1000
\input{title.tex}
\providecommand{\alert}[1]{\textbf{#1}}

\title{Here is my abstract, it is a fine abstract.}
\author{}
\date{\today}
\hypersetup{
  pdfkeywords={},
  pdfsubject={},
  pdfcreator={Emacs Org-mode version 7.7}}

\begin{document}

\maketitle

% Org-mode is exporting headings to 3 levels.
\tableofcontents
\listoftables
\listoffigures

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

foo
\section{Bar}
\label{sec-2}

bar
\section{src}
\label{sec-3}

\end{document}

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

* Re: worg latex example "11 Styling the Frontmatter"
  2012-03-08 18:39   ` Nick Dokos
@ 2012-03-09  1:32     ` Myles English
  0 siblings, 0 replies; 8+ messages in thread
From: Myles English @ 2012-03-09  1:32 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode Mode

>> On Thu, 08 Mar 2012 13:39:28 -0500, Nick Dokos said:

  > Myles English <mylesenglish@gmail.com> wrote:
  >> 
  >> So the two files are:
  >> 
  >> ,--------------------------- testAbs.org
  >> ------------------------------ | #+LATEX_HEADER:
  >> \input{/home/myles/tmp/bugs/title.tex} | #+BEGIN_abstract | Here is
  >> my abstract, it is a fine abstract.  | #+END_abstract | #+LATEX:
  >> \tableofcontents | #+LATEX: \listoftables | #+LATEX:
  >> \listoffigures | | * Foo | foo | | * Bar | bar | | #+BEGIN_SRC
  >> emacs-lisp :exports none | (defun org-export-latex-no-toc (depth)
  >> (when depth (format "%% Org-mode | is exporting headings to %s
  >> levels.\n" depth))) (setq | org-export-latex-format-toc-function
  >> 'org-export-latex-no-toc) | #+END_SRC
  >> `------------------------------------------------------------------------
  >> 
  >> ,------------------------------title.tex-------- | |
  >> \renewcommand\maketitle{\begin{titlepage}% | FOO | \end{titlepage}%
  >> } `-----------------------------------------------
  >> 

  > You have commented out the closing brace in title.tex. It should be

  > \renewcommand\maketitle{\begin{titlepage}% FOO \end{titlepage}% }

  > Nick

Thanks for noticing that, I have changed it and still get the strange
behaviour described in my previous post.

Any other ideas?

Myles

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

* Re: worg latex example "11 Styling the Frontmatter"
  2012-03-09  1:29     ` Myles English
@ 2012-03-09  4:20       ` Thomas S. Dye
  2012-03-09 11:04         ` Myles English
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas S. Dye @ 2012-03-09  4:20 UTC (permalink / raw)
  To: Myles English; +Cc: emacs-orgmode Mode

Hi Myles,

Thanks for making me look more closely at this.  There are two things:

1) #+BEGIN_abstract ... #+END_abstract requires org-special-blocks.  So,

#+BEGIN_SRC emacs-lisp :exports none :results silent
(require 'org-special-blocks)
(defun org-export-latex-no-toc (depth)  
    (when depth
      (format "%% Org-mode is exporting headings to %s levels.\n"
              depth)))
  (setq org-export-latex-format-toc-function 'org-export-latex-no-toc)
#+END_SRC

2) The abstract text ends up in the title because there is no export
option template at the top of your org file.  With point at the start of
the buffer, C-c C-e t.

Then, if you export to LaTeX or pdf, all should be well.

I don't know about the two org versions, but have seen posts to the list
where odd behavior was caused by old installations lurking where the
newer one could see.  Have you switched installation methods in the last
year or so?  From what I'm able to understand, that is sometimes the
culprit.

hth,
Tom


Myles English <mylesenglish@gmail.com> writes:

>>> On Thu, 08 Mar 2012 09:01:01 -1000, Thomas S Dye said:
>
>   > Aloha Myles, Your example works for me with emacs -q.  I had to
>   > change the \input{} command to \input{title}, since I'm not working
>   > at /home/myles.  I saved the tex file to title.tex, put it in the
>   > same directory as the org file, evaluated the source block
>   > (with :results silent), and exported.  I got a 2 page pdf with FOO
>   > on the first page and a second page with all the rest.
>
>   > I'm not sure what is going wrong at your end, but suspect the
>   > \input{} command might not be picking up your .tex file.  Do you see
>   > something in the .log file produced by LaTeX?
>
>   > All the best, Tom
>
>   > Myles English <mylesenglish@gmail.com> writes:
>
>   >>>> On Thu, 08 Mar 2012 16:29:36 +0000, Myles English said:
>   >> 
>   >> > Hi, I am trying to get a custom title page and abstract before
>   >> the > TOC in a pdf.
>   >> 
>   >> > Worg has an example on this page:
>   >> 
>   >> > http://orgmode.org/worg/org-tutorials/org-latex-export.html
>   >> 
>   >> > at the section titled "11 Styling the Frontmatter" However, the >
>   >> example doesn't work for me as expected.
>   >> 
>   >> > To reproduce:
>   >> 
>   >> > + save the attached files (testAbs.org, title.tex) in the same >
>   >> directory + open testAbs.org and do "C-c e d" to export to pdf
>   >> 
>   >> > I would expect the Abstract and text to be shown in the final pdf
>   >> > but it is absent.
>   >> 
>   >> > If I put a character between the lines #+LATEX_HEADER >
>   >> and #+BEGIN_abstract then the abstract title and text are shown as
>   >> > expected.
>   >> 
>   >> > The above is using release_7.8.03-566-gf8efc63.  Am I doing >
>   >> something wrong?
>
> Tom,
>
> Thanks very much for checking it.  It does pick up the title.tex file
> and I don't get a log file but the testAbs.tex file (see below) shows
> that the abstract title is missing and the abstract text is entered as
> the \title{}.
>
> If I start emacs -q then execute this block, it seems to report that
> orgmode is a mixture of version 7.7 and 7.8.
>
> #+BEGIN_SRC emacs-lisp :exports none
> (add-to-list 'load-path
> 	     "~/.emacs.d/plugins/org-mode/lisp")
> (require 'org-install)
> (org-version)
> #+END_SRC
>
> #+results:
> : Org-mode version 7.7 (release_7.8.03.566.gf8efc)
>
> Does that look normal?  Exporting as before then gives the file below.
>
> Myles
>
>
> File testAbs.tex contains:
>
> % Created 2012-03-09 Fri 01:11
> \documentclass[11pt]{article}
> \usepackage[utf8]{inputenc}
> \usepackage[T1]{fontenc}
> \usepackage{fixltx2e}
> \usepackage{graphicx}
> \usepackage{longtable}
> \usepackage{float}
> \usepackage{wrapfig}
> \usepackage{soul}
> \usepackage{textcomp}
> \usepackage{marvosym}
> \usepackage{wasysym}
> \usepackage{latexsym}
> \usepackage{amssymb}
> \usepackage{hyperref}
> \tolerance=1000
> \input{title.tex}
> \providecommand{\alert}[1]{\textbf{#1}}
>
> \title{Here is my abstract, it is a fine abstract.}
> \author{}
> \date{\today}
> \hypersetup{
>   pdfkeywords={},
>   pdfsubject={},
>   pdfcreator={Emacs Org-mode version 7.7}}
>
> \begin{document}
>
> \maketitle
>
> % Org-mode is exporting headings to 3 levels.
> \tableofcontents
> \listoftables
> \listoffigures
>
> \section{Foo}
> \label{sec-1}
>
> foo
> \section{Bar}
> \label{sec-2}
>
> bar
> \section{src}
> \label{sec-3}
>
> \end{document}
>
>

-- 
Thomas S. Dye
http://www.tsdye.com

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

* Re: worg latex example "11 Styling the Frontmatter"
  2012-03-09  4:20       ` Thomas S. Dye
@ 2012-03-09 11:04         ` Myles English
  0 siblings, 0 replies; 8+ messages in thread
From: Myles English @ 2012-03-09 11:04 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs-orgmode Mode

>> On Thu, 08 Mar 2012 18:20:10 -1000, Thomas S Dye said:

  > Hi Myles, Thanks for making me look more closely at this.  There are
  > two things:

  > 1) #+BEGIN_abstract ... #+END_abstract requires org-special-blocks.
  > So,

  > 2) The abstract text ends up in the title because there is no export
  > option template at the top of your org file.  With point at the
  > start of the buffer, C-c C-e t.

That's solved it, thanks very much!  Turn out that the whole export
option template is not needed; just the #+TITLE: piece.

Myles

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

end of thread, other threads:[~2012-03-09 11:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-08 16:29 worg latex example "11 Styling the Frontmatter" Myles English
2012-03-08 16:45 ` Myles English
2012-03-08 18:39   ` Nick Dokos
2012-03-09  1:32     ` Myles English
2012-03-08 19:01   ` Thomas S. Dye
2012-03-09  1:29     ` Myles English
2012-03-09  4:20       ` Thomas S. Dye
2012-03-09 11:04         ` Myles English

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).