emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* funny problem for table of contents when publishing org-latex with #+INCLUDE other.org
@ 2011-11-12 20:28 jack song
  2012-01-13 15:36 ` tg
  0 siblings, 1 reply; 2+ messages in thread
From: jack song @ 2011-11-12 20:28 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi, All

I got a funny (or strange) problem when I published to latex with #+INCLUDE
other org file

problem: if there is no any * first line in the index.org file before the
#+INCLUDE otherfile.org, there will be no table of contents. Other wise it
works.

For example, there are one index file and other files (all are org files),
like index.org and chapter1.org

a, No table of contents in latex file, IF index.org is below,
"""
#+LaTeX_CLASS: book

#+TITLE: some title

#+BEGIN_abstract
This note describes measurement of something.
#+end_abstract

#+LATEX: \tableofcontents
#+LATEX: \listoftables
#+LATEX: \listoffigures

#+INCLUDE: chapter1.org
"""

b, there is a table of content, IF I simply change "#+INCLUDE: chapter1.org"
to
* first line , anything
#+INCLUDE: chapter1.org

Please help to correct if it is a bug. Thanks a lot.

PS, I have org 7.7 on windows 7.
in .emacs file, there is
(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)

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

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

* Re: funny problem for table of contents when publishing org-latex with #+INCLUDE other.org
  2011-11-12 20:28 funny problem for table of contents when publishing org-latex with #+INCLUDE other.org jack song
@ 2012-01-13 15:36 ` tg
  0 siblings, 0 replies; 2+ messages in thread
From: tg @ 2012-01-13 15:36 UTC (permalink / raw)
  To: emacs-orgmode

On Sat, 12 Nov 2011 15:28:25 -0500, jack song wrote:
> I got a funny (or strange) problem when I published to latex with #+INCLUDE
> other org file
> 
> problem: if there is no any * first line in the index.org file before the
> #+INCLUDE otherfile.org, there will be no table of contents. Other wise it
> works.

This bug also occured to me, I could reproduce it with the following files
using org-mode 7.7 and 7.8.03:

test.org:
------------------------------------------------------------------------------
#+TITLE: Test
#+AUTHOR: Foo Bar

start

#+INCLUDE inc.org

end
------------------------------------------------------------------------------

inc.org:
------------------------------------------------------------------------------
inc

* Foo

bar
------------------------------------------------------------------------------

The relevant part of the exported latex document is:

------------------------------------------------------------------------------
\begin{document}

\maketitle

\setcounter{tocdepth}{3}
\tableofcontents
\vspace*{1cm}
\section{Foo}
\label{sec-1}


bar

\end{document}
------------------------------------------------------------------------------

Everything is removed between the start of the document and the first section
of the included file.

A workaround is to add a non-exported section to the main file:

test2.org:
------------------------------------------------------------------------------
#+TITLE: Test
#+AUTHOR: Foo Bar

start

* :NOEXPORT:

#+INCLUDE inc.org

end
------------------------------------------------------------------------------

In this case the latex export looks like:

test2.tex:
------------------------------------------------------------------------------
\begin{document}

\maketitle

\setcounter{tocdepth}{3}
\tableofcontents
\vspace*{1cm}

start

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


bar


end

\end{document}
------------------------------------------------------------------------------

This workaround is not perfect, though, the part before the first section
in the included file is still missing.

> a, No table of contents in latex file, IF index.org is below,

The table of contents remained in the exported document in all cases for me.

-- 
tg

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

end of thread, other threads:[~2012-01-13 15:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-12 20:28 funny problem for table of contents when publishing org-latex with #+INCLUDE other.org jack song
2012-01-13 15:36 ` tg

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