From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: orgmode read/source all options from a template file? Date: Thu, 21 Jul 2016 15:34:14 +0000 Message-ID: References: <87h9bj3xi6.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c17c026e940a0538270d8d Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQFzW-0001Lt-1w for emacs-orgmode@gnu.org; Thu, 21 Jul 2016 11:34:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQFzU-0002OB-JC for emacs-orgmode@gnu.org; Thu, 21 Jul 2016 11:34:25 -0400 Received: from mail-oi0-x231.google.com ([2607:f8b0:4003:c06::231]:34166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQFzU-0002O6-Ci for emacs-orgmode@gnu.org; Thu, 21 Jul 2016 11:34:24 -0400 Received: by mail-oi0-x231.google.com with SMTP id l65so122772091oib.1 for ; Thu, 21 Jul 2016 08:34:24 -0700 (PDT) In-Reply-To: <87h9bj3xi6.fsf@ucl.ac.uk> 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: Eric S Fraga , Xebar Saram , org mode --001a11c17c026e940a0538270d8d Content-Type: text/plain; charset=UTF-8 I prefer #+SETUPFILE because the beauty is that that option is specific to loading a common org setup file. I have my config.org beautifully organized as: ===== * Latex Setup ** Change default font Note that fontspec works with only xelatex (not pdflatex). #+LaTeX_HEADER: \usepackage{fontspec} #+LaTeX_HEADER: \setmainfont[Ligatures=TeX]{Linux Libertine O} #+LaTeX_HEADER: \setmonofont[Scale=0.8]{Inconsolata-g} ** Sans serif fonts for section titles #+LaTeX_HEADER: \usepackage{titlesec} *** Formatting =section= titles #+LaTeX_HEADER: \titleformat{\section} #+LaTeX_HEADER: [hang] % titleformat shape #+LaTeX_HEADER: {\usefont{T1}{qhv}{b}{n}\selectfont\Large} % titleformat format "qhv" - TeX Gyre Heros, "b" - bold #+LaTeX_HEADER: {\thesection} % titleformat label #+LaTeX_HEADER: {0.6em} % titleformat separation #+LaTeX_HEADER: {} % code preceeding title body *** Formatting =subsection= titles #+LaTeX_HEADER: \titleformat{\subsection} #+LaTeX_HEADER: [hang] % titleformat shape #+LaTeX_HEADER: {\bfseries\large} % titleformat format #+LaTeX_HEADER: {\thesubsection} % titleformat label #+LaTeX_HEADER: {0.4em} % titleformat separation #+LaTeX_HEADER: {} % code preceeding title body *** TODO Look into using the =sectsty= package instead of =titlesec= because of its compatibility issues with =hyperref= [[http://tex.stackexchange.com/a/74517/52678][Reference]] ===== The awesome thing is that org will load only the "setup" stuff from a SETUPFILE file.. so it will pick up the #+LaTeX_HEADER lines from above, but not "* Latex Setup" or "** Change default font" or other things. Basically, only special comments will be read from SETUPFILE. On Thu, Jul 21, 2016 at 11:24 AM Eric S Fraga wrote: > #+include: settings.org On Thu, Jul 21, 2016 at 7:10 AM Xebar Saram wrote: > Ok got it, you can "source" a template file by using the SETUPFILE option > , ie; > > #+SETUPFILE: /home/zeltak/org/files/Uni/Courses/templates/ > org.options.reveal.org > -- Kaushal Modi --001a11c17c026e940a0538270d8d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I prefer #+SETUPFILE because the beauty is that that optio= n is specific to loading a common org setup file.=C2=A0

= I have my config.org beautifully organize= d as:

=3D=3D=3D=3D=3D
* Latex Setup=
** Change default font
Note that fontspec works with o= nly xelatex (not pdflatex).
#+LaTeX_HEADER: \usepackage{fontspec}=
#+LaTeX_HEADER: \setmainfont[Ligatures=3DTeX]{Linux Libertine O}=
#+LaTeX_HEADER: \setmonofont[Scale=3D0.8]{Inconsolata-g}
** Sans serif fonts for section titles
#+LaTeX_HEADER: \usepac= kage{titlesec}
*** Formatting =3Dsection=3D titles
#+La= TeX_HEADER: \titleformat{\section}
#+LaTeX_HEADER: =C2=A0 [hang] = % titleformat shape
#+LaTeX_HEADER: =C2=A0 {\usefont{T1}{qhv}{b}{= n}\selectfont\Large} % titleformat format "qhv" - TeX Gyre Heros,= "b" - bold
#+LaTeX_HEADER: =C2=A0 {\thesection} % titl= eformat label
#+LaTeX_HEADER: =C2=A0 {0.6em} % titleformat separa= tion
#+LaTeX_HEADER: =C2=A0 {} % code preceeding title body
=
*** Formatting =3Dsubsection=3D titles
#+LaTeX_HEADER: \titl= eformat{\subsection}
#+LaTeX_HEADER: =C2=A0 [hang] =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 % titleformat shape
#+LaTeX_HEADER: =C2=A0 {= \bfseries\large} =C2=A0% titleformat format
#+LaTeX_HEADER: =C2= =A0 {\thesubsection} % titleformat label
#+LaTeX_HEADER: =C2=A0 {= 0.4em} =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0% titleformat separation
#+LaTeX_HEADER: =C2=A0 {} =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= % code preceeding title body
*** TODO Look into using the =3Dsec= tsty=3D package instead of =3Dtitlesec=3D because of its compatibility issu= es with =3Dhyperref=3D
<snip>
=3D=3D=3D=3D=3D

<= /div>The awesome thing is that org will load only the "setup" stu= ff from a SETUPFILE file.. so it will pick up the #+LaTeX_HEADER lines from= above, but not "* Latex Setup" o= r "** Change default font"= or other things.

Basically, only special comme= nts will be read from SETUPFILE. =C2=A0

On Thu, Jul 21, 2016 at 11:24 = AM Eric S Fraga <e.fraga@ucl.ac.uk<= /a>> wrote:
#+include: settings.org<= /a>

Ok got it, you c= an "source" a template file by using the SETUPFILE option , ie;
#+SETUPFILE: /home/zeltak/org/files/Uni/Courses/templates/org.options.reveal.org

Kausha= l Modi

--001a11c17c026e940a0538270d8d--