From mboxrd@z Thu Jan 1 00:00:00 1970 From: jack song Subject: funny problem for table of contents when publishing org-latex with #+INCLUDE other.org Date: Sat, 12 Nov 2011 15:28:25 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf307f311acf3c2104b18f7ab3 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:45683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPKBf-0002db-MX for emacs-orgmode@gnu.org; Sat, 12 Nov 2011 15:28:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RPKBe-0002Vl-JB for emacs-orgmode@gnu.org; Sat, 12 Nov 2011 15:28:27 -0500 Received: from mail-vx0-f169.google.com ([209.85.220.169]:54706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPKBe-0002Ve-D5 for emacs-orgmode@gnu.org; Sat, 12 Nov 2011 15:28:26 -0500 Received: by vcbfo11 with SMTP id fo11so3703698vcb.0 for ; Sat, 12 Nov 2011 12:28:25 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode --20cf307f311acf3c2104b18f7ab3 Content-Type: text/plain; charset=ISO-8859-1 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) --20cf307f311acf3c2104b18f7ab3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, All

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

problem= : if there is no any * first line in the index= .org file before the #+INCLUDE otherfi= le.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),=A0

a, No=A0table of contents in latex file,=A0IF index.org is below,
"""
#+= LaTeX_CLASS: book

#+TITLE: some title
#+BEGIN_abstract
This note describes measurement of so= mething.
#+end_abstract

#+LATEX: \tableo= fcontents
#+LATEX: \listoftables
#+LATEX: \listoffigure= s

#+INCLUDE: chapte= r1.org
"""

b, there i= s=A0a table of content,=A0IF I simply change "#+INCLUDE: chapter1.org" to=A0
* 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 w= indows 7.
in .emacs file, there is=A0
(defun org-export-latex-no-= toc (depth) =A0
=A0 =A0 (when depth
=A0 =A0 =A0 (format= "%% Org-mode is exporting headings to %s levels.\n"
= =A0 =A0 =A0 =A0 =A0 =A0 =A0 depth)))
=A0 (setq org-export-latex-format-toc-function 'org-export-latex-n= o-toc)

--20cf307f311acf3c2104b18f7ab3-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: tg Subject: Re: funny problem for table of contents when publishing org-latex with #+INCLUDE other.org Date: Fri, 13 Jan 2012 16:36:54 +0100 Message-ID: <20120113163654.0dc62705@tgbit.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:44515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RljC3-0004wZ-HQ for emacs-orgmode@gnu.org; Fri, 13 Jan 2012 10:37:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RljBy-0006t9-NU for emacs-orgmode@gnu.org; Fri, 13 Jan 2012 10:37:27 -0500 Received: from tgbit.net ([78.24.191.136]:59519 helo=mail.tgbit.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RljBy-0006nD-Ic for emacs-orgmode@gnu.org; Fri, 13 Jan 2012 10:37:22 -0500 Received: from sol.tgbit.net ([10.0.0.1] helo=localhost) by mail.tgbit.net with esmtpa (Exim 4.73) (envelope-from ) id 1RljBQ-0003UO-Nk for emacs-orgmode@gnu.org; Fri, 13 Jan 2012 16:36:48 +0100 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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