emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Using Book class without 'parts' for Org-mode Export
@ 2017-08-16 13:44 R Jain
  2017-08-16 16:51 ` lists
  0 siblings, 1 reply; 5+ messages in thread
From: R Jain @ 2017-08-16 13:44 UTC (permalink / raw)
  To: emacs-orgmode gnu.org

[-- Attachment #1: Type: text/html, Size: 1046 bytes --]

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

* Re: Using Book class without 'parts' for Org-mode Export
  2017-08-16 13:44 Using Book class without 'parts' for Org-mode Export R Jain
@ 2017-08-16 16:51 ` lists
  2017-08-16 17:02   ` R Jain
  2017-08-16 22:02   ` Tim Cross
  0 siblings, 2 replies; 5+ messages in thread
From: lists @ 2017-08-16 16:51 UTC (permalink / raw)
  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.

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

* Re: Using Book class without 'parts' for Org-mode Export
  2017-08-16 16:51 ` lists
@ 2017-08-16 17:02   ` R Jain
  2017-08-17 19:36     ` lists
  2017-08-16 22:02   ` Tim Cross
  1 sibling, 1 reply; 5+ messages in thread
From: R Jain @ 2017-08-16 17:02 UTC (permalink / raw)
  To: lists wilkesley.net; +Cc: Emacs-orgmode, emacs-orgmode gnu.org

[-- Attachment #1: Type: text/html, Size: 4566 bytes --]

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

* Re: Using Book class without 'parts' for Org-mode Export
  2017-08-16 16:51 ` lists
  2017-08-16 17:02   ` R Jain
@ 2017-08-16 22:02   ` Tim Cross
  1 sibling, 0 replies; 5+ messages in thread
From: Tim Cross @ 2017-08-16 22:02 UTC (permalink / raw)
  To: lists; +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

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

* Re: Using Book class without 'parts' for Org-mode Export
  2017-08-16 17:02   ` R Jain
@ 2017-08-17 19:36     ` lists
  0 siblings, 0 replies; 5+ messages in thread
From: lists @ 2017-08-17 19:36 UTC (permalink / raw)
  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.

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

end of thread, other threads:[~2017-08-17 19:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-16 13:44 Using Book class without 'parts' for Org-mode Export R Jain
2017-08-16 16:51 ` lists
2017-08-16 17:02   ` R Jain
2017-08-17 19:36     ` lists
2017-08-16 22:02   ` Tim Cross

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