emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* latex header lines vs latex block
@ 2014-09-09 11:26 Thorsten Jolitz
  2014-09-09 11:30 ` Sebastien Vauban
  0 siblings, 1 reply; 8+ messages in thread
From: Thorsten Jolitz @ 2014-09-09 11:26 UTC (permalink / raw)
  To: emacs-orgmode


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

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

* Re: latex header lines vs latex block
  2014-09-09 11:26 latex header lines vs latex block Thorsten Jolitz
@ 2014-09-09 11:30 ` Sebastien Vauban
  2014-09-09 13:16   ` Thorsten Jolitz
  2014-09-09 14:52   ` Thorsten Jolitz
  0 siblings, 2 replies; 8+ messages in thread
From: Sebastien Vauban @ 2014-09-09 11:30 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

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

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

* Re: latex header lines vs latex block
  2014-09-09 11:30 ` Sebastien Vauban
@ 2014-09-09 13:16   ` Thorsten Jolitz
  2014-09-09 14:52   ` Thorsten Jolitz
  1 sibling, 0 replies; 8+ messages in thread
From: Thorsten Jolitz @ 2014-09-09 13:16 UTC (permalink / raw)
  To: emacs-orgmode

Sebastien Vauban <sva-news@mygooglest.com>
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

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

* Re: latex header lines vs latex block
  2014-09-09 11:30 ` Sebastien Vauban
  2014-09-09 13:16   ` Thorsten Jolitz
@ 2014-09-09 14:52   ` Thorsten Jolitz
  2014-09-10  7:28     ` Sebastien Vauban
  2014-09-10 10:23     ` Mike McLean
  1 sibling, 2 replies; 8+ messages in thread
From: Thorsten Jolitz @ 2014-09-09 14:52 UTC (permalink / raw)
  To: emacs-orgmode

Sebastien Vauban <sva-news@mygooglest.com>
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

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

* Re: latex header lines vs latex block
  2014-09-09 14:52   ` Thorsten Jolitz
@ 2014-09-10  7:28     ` Sebastien Vauban
  2014-09-10  7:45       ` Sebastien Vauban
  2014-09-10 10:23     ` Mike McLean
  1 sibling, 1 reply; 8+ messages in thread
From: Sebastien Vauban @ 2014-09-10  7:28 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Thorsten Jolitz wrote:
> Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
> 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

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

* Re: latex header lines vs latex block
  2014-09-10  7:28     ` Sebastien Vauban
@ 2014-09-10  7:45       ` Sebastien Vauban
  2014-09-10  8:09         ` Thorsten Jolitz
  0 siblings, 1 reply; 8+ messages in thread
From: Sebastien Vauban @ 2014-09-10  7:45 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Sebastien Vauban wrote:
> Thorsten Jolitz wrote:
>> Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
>> 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

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

* Re: latex header lines vs latex block
  2014-09-10  7:45       ` Sebastien Vauban
@ 2014-09-10  8:09         ` Thorsten Jolitz
  0 siblings, 0 replies; 8+ messages in thread
From: Thorsten Jolitz @ 2014-09-10  8:09 UTC (permalink / raw)
  To: emacs-orgmode

Sebastien Vauban <sva-news@mygooglest.com>
writes:

> Sebastien Vauban wrote:
>> Thorsten Jolitz wrote:
>>> Sebastien Vauban <sva-news@mygooglest.com>
>>> 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

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

* Re: latex header lines vs latex block
  2014-09-09 14:52   ` Thorsten Jolitz
  2014-09-10  7:28     ` Sebastien Vauban
@ 2014-09-10 10:23     ` Mike McLean
  1 sibling, 0 replies; 8+ messages in thread
From: Mike McLean @ 2014-09-10 10:23 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

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

On Tue, Sep 9, 2014 at 10:52 AM, Thorsten Jolitz <tjolitz@gmail.com> wrote:

> Sebastien Vauban <sva-news@mygooglest.com>
> 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
>
>
>

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

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

end of thread, other threads:[~2014-09-10 10:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-09 11:26 latex header lines vs latex block Thorsten Jolitz
2014-09-09 11:30 ` Sebastien Vauban
2014-09-09 13:16   ` Thorsten Jolitz
2014-09-09 14:52   ` Thorsten Jolitz
2014-09-10  7:28     ` Sebastien Vauban
2014-09-10  7:45       ` Sebastien Vauban
2014-09-10  8:09         ` Thorsten Jolitz
2014-09-10 10:23     ` Mike McLean

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