From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Latex export: setting options for packages included by default Date: Thu, 23 Jan 2020 14:01:42 -0500 Message-ID: References: <87ftg6xntx.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:54068) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuhjg-0004RU-O2 for emacs-orgmode@gnu.org; Thu, 23 Jan 2020 14:01:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iuhjf-0003mL-BA for emacs-orgmode@gnu.org; Thu, 23 Jan 2020 14:01:48 -0500 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]:44872) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iuhjf-0003lh-54 for emacs-orgmode@gnu.org; Thu, 23 Jan 2020 14:01:47 -0500 Received: by mail-qk1-x736.google.com with SMTP id v195so4492273qkb.11 for ; Thu, 23 Jan 2020 11:01:46 -0800 (PST) Received: from Johns-MacBook-Air.local (johns-air.wifi.cmu.edu. [128.237.126.9]) by smtp.gmail.com with ESMTPSA id 63sm1368250qki.57.2020.01.23.11.01.43 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jan 2020 11:01:43 -0800 (PST) In-reply-to: <87ftg6xntx.fsf@iki.fi> 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-mx.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Is this package listed in org-latex-default-packages-alist? If so, you might try something like: #+BEGIN_SRC emacs-lisp (let ((org-latex-default-packages-alist org-latex-default-packages-alist)) (setf (nth (seq-position org-latex-default-packages-alist "color" (lambda (a b) (string= b (nth 1 a)))) org-latex-default-packages-alist) '("monochrome" "color" nil)) (org-latex-export-to-pdf)) #+END_SRC I think that would be a temporary modification just for the export. Alternatively, you might define a new latex class like this: (add-to-list 'org-latex-classes '("article-monochrome" "\\documentclass{article} \\PassOptionsToPackage{monochrome}{color} [DEFAULT-PACKAGES] [PACKAGES] [EXTRA]" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) and then specify #+LATEX_CLASS: article-monochrome in the org-file. Jarmo Hurri writes: > Greetings. > > When I export to Latex, org automatically creates the following line in > preamble: > > \usepackage{color} > > I would like to find a way to pass option [monochrome] to this > package. Adding another \usepackage creates a conflict. My preferred way > would be to add the line > > \PassOptionsToPackage{monochrome}{color} > > to the preamble before \usepackage. > > 1. Is there a way to do this (easily) in Org? I think it is possible to > redefine the preamble template, but that would be an overkill. > > 2. If there is no direct option for this, could we have one? Like > #+latex_header but which would be applied before any packages are > loaded? > > Jarmo -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu