From mboxrd@z Thu Jan 1 00:00:00 1970 From: R Jain Subject: Using Book class without 'parts' for Org-mode Export Date: Wed, 16 Aug 2017 13:44:02 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/html Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhycD-0006Pk-IO for emacs-orgmode@gnu.org; Wed, 16 Aug 2017 09:44:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dhycA-0006FJ-Dm for emacs-orgmode@gnu.org; Wed, 16 Aug 2017 09:44:09 -0400 Received: from mail-qk0-x22a.google.com ([2607:f8b0:400d:c09::22a]:37698) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dhycA-0006D6-9R for emacs-orgmode@gnu.org; Wed, 16 Aug 2017 09:44:06 -0400 Received: by mail-qk0-x22a.google.com with SMTP id z18so20170886qka.4 for ; Wed, 16 Aug 2017 06:44:04 -0700 (PDT) Received: from [127.0.0.1] (ncsu-nat1-7.ncstate.net. [152.7.224.7]) by smtp.gmail.com with ESMTPSA id t1sm537682qkb.91.2017.08.16.06.44.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Aug 2017 06:44:03 -0700 (PDT) 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" To: "emacs-orgmode gnu.org" Hi Everyone,

My question is about using Org-mode Export = to Latex, but starting with Chapter, then Section, and so on.=

I found a solution on Stackexchange but = when I add that code to my init file, restart emacs, and add = "#+LaTeX_CLASS: book_noparts" to my org file,  it apparently doesn't = get read. The exported .tex is an itemized list. 

=
Any help with what I'm doing wrong would be great help. Also, if = there's a better way to make custom class files within the org-file I'm = working on, please do let me know.

Thanks,=
RJ
From mboxrd@z Thu Jan 1 00:00:00 1970 From: lists@wilkesley.net Subject: Re: Using Book class without 'parts' for Org-mode Export Date: Wed, 16 Aug 2017 17:51:12 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1di1XM-0007kO-4T for emacs-orgmode@gnu.org; Wed, 16 Aug 2017 12:51:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1di1XL-00051y-3o for emacs-orgmode@gnu.org; Wed, 16 Aug 2017 12:51:20 -0400 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" To: R Jain Cc: Emacs-orgmode , "emacs-orgmode gnu.org" On 2017-08-16 14:44, R Jain wrote: > Hi Everyone, > > My question is about using Org-mode Export to Latex, but starting with > Chapter, then Section, and so on. > > I found a solution on Stackexchange [1] but when I add that code to my > init file, restart emacs, and add "#+LaTeX_CLASS: book_noparts" to my > org file, it apparently doesn't get read. The exported .tex is an > itemized list. > > Any help with what I'm doing wrong would be great help. Also, if > there's a better way to make custom class files within the org-file > I'm working on, please do let me know. > > Thanks, > RJ > > Links: > ------ > [1] > https://n1.nylas.com/link/7e7b7fc5c641bf88e42b688f208d6c1b7782ff4f8c6d4b77bb3d2eacf574a234/0?redirect=https%3A%2F%2Femacs.stackexchange.com%2Fquestions%2F33318%2Fexport-org-mode-subtrees-at-chapter-level-for-latex Here is my setup using the koma-book class. This uses H1 as the chapter title. A typical chapter starts with: ** The Clubroom Project #+latex: \chapterauthor{by Mike Anderson} (add-to-list 'org-latex-classes '("koma-book" "\\documentclass{scrbook}" ("\\chapter{%s}" . "\\chapter{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ) ) In the file to be exported: #+latex_class: koma-book #+LATEX_CLASS_OPTIONS: [a5paper,openany,font 10pt] #+latex_header: \makeatletter #+latex_header: \newcommand{\chapterauthor}[1]{% #+latex_header: {\parindent0pt\vspace*{-5pt}% #+latex_header: \linespread{1.1}\large\scshape#1% #+latex_header: \par\nobreak\vspace*{35pt}} #+latex_header: \@afterheading% #+latex_header: } #+latex_header: \makeatother #+latex_header: \graphicspath{{../../images/}} #+latex_header: \usepackage{hyperref} #+latex_header: \usepackage{pdfpages} #+latex_header: \hypersetup{ #+latex_header: colorlinks, #+latex_header: citecolor=black, #+latex_header: filecolor=black, #+latex_header: linkcolor=blue, #+latex_header: urlcolor=black #+latex_header: } #+latex_header: \KOMAoptions{twoside=false} #+latex_header: \usepackage{adjustbox} The first chapter has: #+latex: \includepdf{/home/ian/Documents/emacs/thecastle/images/frontcover.pdf} #+latex: \setcounter{tocdepth}{2} #+latex: \tableofcontents This sets the TOC depthand adds the TOC at the start of the first chapter. Hope that helps. Ian. From mboxrd@z Thu Jan 1 00:00:00 1970 From: R Jain Subject: Re: Using Book class without 'parts' for Org-mode Export Date: Wed, 16 Aug 2017 17:02:02 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/html Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1di1hp-0003zq-IE for emacs-orgmode@gnu.org; Wed, 16 Aug 2017 13:02:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1di1hl-0004Oj-Fl for emacs-orgmode@gnu.org; Wed, 16 Aug 2017 13:02:09 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:36146) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1di1hl-0004Oc-9l for emacs-orgmode@gnu.org; Wed, 16 Aug 2017 13:02:05 -0400 Received: by mail-qk0-x244.google.com with SMTP id d21so2459369qke.3 for ; Wed, 16 Aug 2017 10:02:05 -0700 (PDT) Received: from [127.0.0.1] (ncsu-nat1-7.ncstate.net. [152.7.224.7]) by smtp.gmail.com with ESMTPSA id o13sm884520qtb.45.2017.08.16.10.02.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Aug 2017 10:02:02 -0700 (PDT) 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" To: "lists wilkesley.net" Cc: Emacs-orgmode , "emacs-orgmode gnu.org" Hi Ian,

Thanks for the reply. The part which I'm = tripping over is:

#+latex: \chapterauthor{by Mike = Anderson}
(add-to-list 'org-latex-classes
    =       '("koma-book"
          =    "\\documentclass{scrbook}"
        =      ("\\chapter{%s}" . "\\chapter{%s}")
    =          ("\\subsection{%s}" . = "\\subsection*{%s}")
            =  ("\\subsection{%s}" . "\\subsection*{%s}")
      =        ("\\paragraph{%s}" . "\\paragraph*{%s}")
=              )
    =  )

Where should I add this definition?=

My setup is:

Main.= tex
writeup.tex


Writeup.= tex is suppsed to have all the chapters without preamble. Main.tex has the = preamble, abstract, \input{writeup}, and bibliography.=

Thanks,
Rishabh

On Aug 16 2017, at 12:51 pm, lists@wilkesley.net wrote:
On =
2017-08-16 14:44, R Jain wrote:
> Hi Everyone,
>=20
> My question is about using Org-mode Export to Latex, but starting =
with
> Chapter, then Section, and so on.
>=20
> I found a solution on Stackexchange [1] but when I add that code to =
my
> init file, restart emacs, and add "#+LaTeX_CLASS: =
book_noparts" to my
> org file,  it apparently doesn't get read. The exported .tex is an
> itemized list.
>=20
> Any help with what I'm doing wrong would be great help. Also, if
> there's a better way to make custom class files within the org-file
> I'm working on, please do let me know.
>=20
> Thanks,
> RJ
>=20
> Links:
> ------
> [1]
> https://n1.nylas.com/link/7e7b7fc5c641bf88e42b688f208d6c1b7782ff4f8c6d=
4b77bb3d2eacf574a234/0?redirect=3Dhttps%3A%2F%2Femacs.stackexchange.=
com%2Fquestions%2F33318%2Fexport-org-mode-subtrees-at-chapter-level-for-lat=
ex

Here is my setup using the koma-book class. This uses H1 as the chapter=20
title. A typical chapter starts with:

** The Clubroom Project
#+latex: \chapterauthor{by Mike Anderson}


(add-to-list 'org-latex-classes
           '("koma-book"
              "\\documentclass{scrbook}"
              ("\\chapter{%s}" . "\\chapter{%s}")
              ("\\subsection{%s}" . "\\subsection*{%s}"=
)
              ("\\subsection{%s}" . "\\subsection*{%s}"=
)
              ("\\paragraph{%s}" . "\\paragraph*{%s}")
              )
)


In the file to be exported:

#+latex_class: koma-book
#+LATEX_CLASS_OPTIONS: [a5paper,openany,font 10pt]
#+latex_header: \makeatletter
#+latex_header: \newcommand{\chapterauthor}[1]{%
#+latex_header:   {\parindent0pt\vspace*{-5pt}%
#+latex_header:   \linespread{1.1}\large\scshape#1%
#+latex_header:   \par\nobreak\vspace*{35pt}}
#+latex_header:   \@afterheading%
#+latex_header: }
#+latex_header: \makeatother
#+latex_header: \graphicspath{{../../images/}}
#+latex_header: \usepackage{hyperref}
#+latex_header: \usepackage{pdfpages}
#+latex_header: \hypersetup{
#+latex_header:     colorlinks,
#+latex_header:     citecolor=3Dblack,
#+latex_header:     filecolor=3Dblack,
#+latex_header:     linkcolor=3Dblue,
#+latex_header:     urlcolor=3Dblack
#+latex_header: }
#+latex_header: \KOMAoptions{twoside=3Dfalse}
#+latex_header: \usepackage{adjustbox}

The first chapter has:

#+latex:=20
\includepdf{/home/ian/Documents/emacs/thecastle/images/frontcover.pdf}
#+latex: \setcounter{tocdepth}{2}
#+latex: \tableofcontents

This sets the TOC depthand adds the TOC at the start of the first=20
chapter.

Hope that helps.

Ian.
From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Cross Subject: Re: Using Book class without 'parts' for Org-mode Export Date: Thu, 17 Aug 2017 08:02:03 +1000 Message-ID: <87efsb189w.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1di6OG-0003L1-N3 for emacs-orgmode@gnu.org; Wed, 16 Aug 2017 18:02:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1di6OF-0002b0-DU for emacs-orgmode@gnu.org; Wed, 16 Aug 2017 18:02:16 -0400 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" To: lists@wilkesley.net Cc: Emacs-orgmode , "emacs-orgmode gnu.org" , R Jain also, if you get frustrated by the number of latex_header option lines you need to add to each file, you can define a new custom entry in org-latex-classes which contains all those lines. I have a custom one which has all the latex stuff to set my work logo and a few other latex 'tweaks' to match my employer's document guidelines. To get all these settings, I just need to add a latex_class option referencing my definition in org-latex-classes. BTW I think you are probably better off using latex_header_extra for some of those definitions. In the past, I've run into problems because things don't get loaded in the right order - using latex_header_extra will usually ensure your additional custom settings come after the base latex_header settings which often load things you may need in your custom stuff. Tim lists@wilkesley.net writes: > On 2017-08-16 14:44, R Jain wrote: >> Hi Everyone, >> >> My question is about using Org-mode Export to Latex, but starting with >> Chapter, then Section, and so on. >> >> I found a solution on Stackexchange [1] but when I add that code to my >> init file, restart emacs, and add "#+LaTeX_CLASS: book_noparts" to my >> org file, it apparently doesn't get read. The exported .tex is an >> itemized list. >> >> Any help with what I'm doing wrong would be great help. Also, if >> there's a better way to make custom class files within the org-file >> I'm working on, please do let me know. >> >> Thanks, >> RJ >> >> Links: >> ------ >> [1] >> https://n1.nylas.com/link/7e7b7fc5c641bf88e42b688f208d6c1b7782ff4f8c6d4b77bb3d2eacf574a234/0?redirect=https%3A%2F%2Femacs.stackexchange.com%2Fquestions%2F33318%2Fexport-org-mode-subtrees-at-chapter-level-for-latex > > Here is my setup using the koma-book class. This uses H1 as the chapter > title. A typical chapter starts with: > > ** The Clubroom Project > #+latex: \chapterauthor{by Mike Anderson} > > > (add-to-list 'org-latex-classes > '("koma-book" > "\\documentclass{scrbook}" > ("\\chapter{%s}" . "\\chapter{%s}") > ("\\subsection{%s}" . "\\subsection*{%s}") > ("\\subsection{%s}" . "\\subsection*{%s}") > ("\\paragraph{%s}" . "\\paragraph*{%s}") > ) > ) > > > In the file to be exported: > > #+latex_class: koma-book > #+LATEX_CLASS_OPTIONS: [a5paper,openany,font 10pt] > #+latex_header: \makeatletter > #+latex_header: \newcommand{\chapterauthor}[1]{% > #+latex_header: {\parindent0pt\vspace*{-5pt}% > #+latex_header: \linespread{1.1}\large\scshape#1% > #+latex_header: \par\nobreak\vspace*{35pt}} > #+latex_header: \@afterheading% > #+latex_header: } > #+latex_header: \makeatother > #+latex_header: \graphicspath{{../../images/}} > #+latex_header: \usepackage{hyperref} > #+latex_header: \usepackage{pdfpages} > #+latex_header: \hypersetup{ > #+latex_header: colorlinks, > #+latex_header: citecolor=black, > #+latex_header: filecolor=black, > #+latex_header: linkcolor=blue, > #+latex_header: urlcolor=black > #+latex_header: } > #+latex_header: \KOMAoptions{twoside=false} > #+latex_header: \usepackage{adjustbox} > > The first chapter has: > > #+latex: > \includepdf{/home/ian/Documents/emacs/thecastle/images/frontcover.pdf} > #+latex: \setcounter{tocdepth}{2} > #+latex: \tableofcontents > > This sets the TOC depthand adds the TOC at the start of the first > chapter. > > Hope that helps. > > Ian. -- Tim Cross From mboxrd@z Thu Jan 1 00:00:00 1970 From: lists@wilkesley.net Subject: Re: Using Book class without 'parts' for Org-mode Export Date: Thu, 17 Aug 2017 20:36:38 +0100 Message-ID: <58f14590ceb4751fdd8e9524b2548dae@wilkesley.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1diQay-0000ES-G0 for emacs-orgmode@gnu.org; Thu, 17 Aug 2017 15:36:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1diQax-000211-P6 for emacs-orgmode@gnu.org; Thu, 17 Aug 2017 15:36:44 -0400 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" To: R Jain Cc: Emacs-orgmode , "emacs-orgmode gnu.org" On 2017-08-16 18:02, R Jain wrote: > Hi Ian, > > Thanks for the reply. The part which I'm tripping over is: > > #+latex: \chapterauthor{by Mike Anderson} > > (add-to-list 'org-latex-classes > '("koma-book" > "\\documentclass{scrbook}" > ("\\chapter{%s}" . "\\chapter{%s}") > ("\\subsection{%s}" . "\\subsection*{%s}") > ("\\subsection{%s}" . "\\subsection*{%s}") > ("\\paragraph{%s}" . "\\paragraph*{%s}") > ) > ) > > Where should I add this definition? > I have it in my init file in ~/.emacs.d. I use babel to tangle the file. Ian.