Re: [O] latex header lines vs latex block

2014-09-10 Thread Mike McLean
On Tue, Sep 9, 2014 at 10:52 AM, Thorsten Jolitz  wrote:

> Sebastien Vauban 
> writes:
>
> > See
> http://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg00744.html
> > for Nicolas' answer on this point:
> >
> >   ╭
> >   │ I suggest to use existing solutions instead: configure
> >   │ `org-latex-classes'.
> >   ╰
>
>
> a related question: is this the right format to create the preamble
> string:
>
> #+BEGIN_SRC emacs-lisp
> '(;; Name
>   "obb-article-full-page"
>   ;; Preamble
>   (concat
>"\\documentclass{article}\n"
>"[DEFAULT-PACKAGES]\n"
>"[PACKAGES]\n"
>"[EXTRA]\n"
>"\\usepackage[cm]{fullpage}\n")
>   ;; Sectioning Structure
>   ("\\part{%s}" . "\\part*{%s}")
>   ("\\chapter{%s}" . "\\chapter*{%s}") ...)
> #+END_SRC
>
> not sure if I need the line-feeds ...
>

I don't think you do. I build my org-latex-classes with add-to-list, so an
example of mine is:

(add-to-list 'org-latex-classes
 '("MikeMcLean"
   "\\documentclass{MikeMcLean}
 [DEFAULT-PACKAGES]
 [PACKAGES]
 [EXTRA]
 "
   ("\\chapter{%s}" . "\\chapter*{%s}")
   ("\\section{%s}" . "\\section*{%s}")
   ("\\subsection{%s}" . "\\subsection*{%s}")
   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
   ("\\paragraph{%s}" . "\\paragraph*{%s}")
   ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))

The MikeMcLean document class (all of my 3-4 main classes, really) are a
moderate wrapper around the memoir class. A document I produce for myself
looks different than one that I produce as part of my employment or
volunteer effort(s), even though I produce them all from Org.

- Sets some class options
- Requires some packages I use a lot (minted, e.g.)
- Defines some fonts and colors.
- Sets page options (footers, chapter headers, sectioning, etc.)
- Defines a title page





>
> --
> cheers,
> Thorsten
>
>
>


Re: [O] latex header lines vs latex block

2014-09-10 Thread Thorsten Jolitz
Sebastien Vauban 
writes:

> Sebastien Vauban wrote:
>> Thorsten Jolitz wrote:
>>> Sebastien Vauban 
>>> writes:
>>>
 See
 http://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg00744.html
 for Nicolas' answer on this point:

   ╭
   │ I suggest to use existing solutions instead: configure
   │ `org-latex-classes'.
   ╰
>>>
>>>
>>> a related question: is this the right format to create the preamble
>>> string:
>>>
>>> #+BEGIN_SRC emacs-lisp
>>> '(;; Name
>>>   "obb-article-full-page"
>>>   ;; Preamble
>>>   (concat
>>>"\\documentclass{article}\n"
>>>"[DEFAULT-PACKAGES]\n"
>>>"[PACKAGES]\n"
>>>"[EXTRA]\n"
>>>"\\usepackage[cm]{fullpage}\n")
>>>   ;; Sectioning Structure
>>>   ("\\part{%s}" . "\\part*{%s}")
>>>   ("\\chapter{%s}" . "\\chapter*{%s}") ...)
>>> #+END_SRC
>>>
>>> not sure if I need the line-feeds ...
>>
>> Working example:
>>
>> (add-to-list 'org-latex-classes
>>  '("koma-article"
>>"\\documentclass{scrartcl}
>>[NO-DEFAULT-PACKAGES]
>>[EXTRA]"
>>("\\section{%s}" . "\\section*{%s}")
>>("\\subsection{%s}" . "\\subsection*{%s}")
>>("\\subsubsection{%s}" . "\\subsubsection*{%s}")
>>("\\paragraph{%s}" . "\\paragraph*{%s}")
>>("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
>
> For your example to work, you'd have to replace the quote (') by
> a backquote (`) so that the `concat' can be executed...

Yes, the preamble as one string, no extra linefeeds, and no quoted
function calls ... I figured that out by trial-and-error already, but
thanks for you tips anyway!

-- 
cheers,
Thorsten




Re: [O] latex header lines vs latex block

2014-09-10 Thread Sebastien Vauban
Sebastien Vauban wrote:
> Thorsten Jolitz wrote:
>> Sebastien Vauban 
>> writes:
>>
>>> See http://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg00744.html
>>> for Nicolas' answer on this point:
>>>
>>>   ╭
>>>   │ I suggest to use existing solutions instead: configure
>>>   │ `org-latex-classes'.
>>>   ╰
>>
>>
>> a related question: is this the right format to create the preamble
>> string:
>>
>> #+BEGIN_SRC emacs-lisp
>> '(;; Name
>>   "obb-article-full-page"
>>   ;; Preamble
>>   (concat
>>"\\documentclass{article}\n"
>>"[DEFAULT-PACKAGES]\n"
>>"[PACKAGES]\n"
>>"[EXTRA]\n"
>>"\\usepackage[cm]{fullpage}\n")
>>   ;; Sectioning Structure
>>   ("\\part{%s}" . "\\part*{%s}")
>>   ("\\chapter{%s}" . "\\chapter*{%s}") ...)
>> #+END_SRC
>>
>> not sure if I need the line-feeds ...
>
> Working example:
>
> (add-to-list 'org-latex-classes
>  '("koma-article"
>"\\documentclass{scrartcl}
>[NO-DEFAULT-PACKAGES]
>[EXTRA]"
>("\\section{%s}" . "\\section*{%s}")
>("\\subsection{%s}" . "\\subsection*{%s}")
>("\\subsubsection{%s}" . "\\subsubsection*{%s}")
>("\\paragraph{%s}" . "\\paragraph*{%s}")
>("\\subparagraph{%s}" . "\\subparagraph*{%s}")))

For your example to work, you'd have to replace the quote (') by
a backquote (`) so that the `concat' can be executed...

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] latex header lines vs latex block

2014-09-10 Thread Sebastien Vauban
Thorsten Jolitz wrote:
> Sebastien Vauban 
> writes:
>
>> See http://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg00744.html
>> for Nicolas' answer on this point:
>>
>>   ╭
>>   │ I suggest to use existing solutions instead: configure
>>   │ `org-latex-classes'.
>>   ╰
>
>
> a related question: is this the right format to create the preamble
> string:
>
> #+BEGIN_SRC emacs-lisp
> '(;; Name
>   "obb-article-full-page"
>   ;; Preamble
>   (concat
>"\\documentclass{article}\n"
>"[DEFAULT-PACKAGES]\n"
>"[PACKAGES]\n"
>"[EXTRA]\n"
>"\\usepackage[cm]{fullpage}\n")
>   ;; Sectioning Structure
>   ("\\part{%s}" . "\\part*{%s}")
>   ("\\chapter{%s}" . "\\chapter*{%s}") ...)
> #+END_SRC
>
> not sure if I need the line-feeds ...

Working example:

--8<---cut here---start->8---
(add-to-list 'org-latex-classes
 '("koma-article"
   "\\documentclass{scrartcl}
   [NO-DEFAULT-PACKAGES]
   [EXTRA]"
   ("\\section{%s}" . "\\section*{%s}")
   ("\\subsection{%s}" . "\\subsection*{%s}")
   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
   ("\\paragraph{%s}" . "\\paragraph*{%s}")
   ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
--8<---cut here---end--->8---

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] latex header lines vs latex block

2014-09-09 Thread Thorsten Jolitz
Sebastien Vauban 
writes:

> See http://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg00744.html
> for Nicolas' answer on this point:
>
>   ╭
>   │ I suggest to use existing solutions instead: configure
>   │ `org-latex-classes'.
>   ╰


a related question: is this the right format to create the preamble
string:

#+BEGIN_SRC emacs-lisp
'(;; Name
  "obb-article-full-page"
  ;; Preamble
  (concat
   "\\documentclass{article}\n"
   "[DEFAULT-PACKAGES]\n"
   "[PACKAGES]\n"
   "[EXTRA]\n"
   "\\usepackage[cm]{fullpage}\n")
  ;; Sectioning Structure
  ("\\part{%s}" . "\\part*{%s}")
  ("\\chapter{%s}" . "\\chapter*{%s}") ...)
#+END_SRC

not sure if I need the line-feeds ...

-- 
cheers,
Thorsten




Re: [O] latex header lines vs latex block

2014-09-09 Thread Thorsten Jolitz
Sebastien Vauban 
writes:

> Thorsten Jolitz wrote:
>> Hi List, 
>>
>> I often see many lines like this if Org files:
>>
>> ,
>> | #+LaTeX_CLASS: koma-book
>> | #+LaTeX_HEADER: \usepackage[utf8]{inputenc}
>> | #+LaTeX_HEADER: \usepackage[T1]{fontenc} 
>> | #+LaTeX_HEADER: \usepackage{palatino}
>> | #+LaTeX_HEADER: \bibliographystyle{alpha}
>> | #+LaTeX_HEADER: \bibliography{../bandbook.bib}
>> | #+LaTeX_HEADER: \usepackage{fixltx2e}
>> | #+LaTeX_HEADER: \usepackage{graphicx} [...]
>> `
>>
>> would it be the same to just put a 
>>
>> #+BEGIN_LATEX
>> ... latex-header code ...
>> #+END_LATEX
>>
>> instead of many header lines?
>
> No, that would NOT go in the LaTeX "header" part (that is, the
> preamble).
>
> See http://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg00744.html
> for Nicolas' answer on this point:
>
>   ╭
>   │ I suggest to use existing solutions instead: configure
>   │ `org-latex-classes'.
>   ╰

good point, thanks for the tip!

-- 
cheers,
Thorsten




Re: [O] latex header lines vs latex block

2014-09-09 Thread Sebastien Vauban
Thorsten Jolitz wrote:
> Hi List, 
>
> I often see many lines like this if Org files:
>
> ,
> | #+LaTeX_CLASS: koma-book
> | #+LaTeX_HEADER: \usepackage[utf8]{inputenc}
> | #+LaTeX_HEADER: \usepackage[T1]{fontenc} 
> | #+LaTeX_HEADER: \usepackage{palatino}
> | #+LaTeX_HEADER: \bibliographystyle{alpha}
> | #+LaTeX_HEADER: \bibliography{../bandbook.bib}
> | #+LaTeX_HEADER: \usepackage{fixltx2e}
> | #+LaTeX_HEADER: \usepackage{graphicx} [...]
> `
>
> would it be the same to just put a 
>
> #+BEGIN_LATEX
> ... latex-header code ...
> #+END_LATEX
>
> instead of many header lines?

No, that would NOT go in the LaTeX "header" part (that is, the
preamble).

See http://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg00744.html
for Nicolas' answer on this point:

  ╭
  │ I suggest to use existing solutions instead: configure
  │ `org-latex-classes'.
  ╰

Best regards,
  Seb

-- 
Sebastien Vauban




[O] latex header lines vs latex block

2014-09-09 Thread Thorsten Jolitz

Hi List, 

I often see many lines like this if Org files:

,
| #+LaTeX_CLASS: koma-book
| #+LaTeX_HEADER: \usepackage[utf8]{inputenc}
| #+LaTeX_HEADER: \usepackage[T1]{fontenc} 
| #+LaTeX_HEADER: \usepackage{palatino}
| #+LaTeX_HEADER: \bibliographystyle{alpha}
| #+LaTeX_HEADER: \bibliography{../bandbook.bib}
| #+LaTeX_HEADER: \usepackage{fixltx2e}
| #+LaTeX_HEADER: \usepackage{graphicx} [...]
`

would it be the same to just put a 

#+BEGIN_LATEX
... latex-header code ...
#+END_LATEX

instead of many header lines?

-- 
cheers,
Thorsten