From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UCFoCAcgVWJuvQAAgWs5BA (envelope-from ) for ; Tue, 12 Apr 2022 08:45:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id LNqfBQcgVWJTXwEA9RJhRA (envelope-from ) for ; Tue, 12 Apr 2022 08:45:27 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 81378391B8 for ; Tue, 12 Apr 2022 08:45:26 +0200 (CEST) Received: from localhost ([::1]:36344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1neAHF-0000w9-0q for larch@yhetil.org; Tue, 12 Apr 2022 02:45:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1neAGG-0000uG-Fn for emacs-orgmode@gnu.org; Tue, 12 Apr 2022 02:44:24 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:46952) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1neAGE-0000S5-Rb for emacs-orgmode@gnu.org; Tue, 12 Apr 2022 02:44:24 -0400 Received: by mail-pg1-x532.google.com with SMTP id s21so11812188pgv.13 for ; Mon, 11 Apr 2022 23:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=N+5sIpJRd1oQSRoR8gpxwiOttK9ycreVsrLj4l7Uh5I=; b=Sde8W2CZrscmVnYH+JAO8JH8+wIoy1ue1sOcZG0dRa0G159KNM6N5BtpmU+sQTPfmw WmUSR7VP9CGwM1uOkjVPR377H3BuqbWwLJ1qfzrAFW0VgO89JCjk1+YdTuFCVlP8nbJ+ yRgcOohpQJoSuCLrXCqxpuXPtwmyECqMSXzGI/rawvr9YQ+Ow/R0dhdgUtmIQfMcF8wZ cwpbwliv9DVwpcaa3O5I8YMM/kEtaW24Cv/1EcYxhkJ8qk0z1G22a1RBXCUMYSBD7USU 9xcUXYUXpeXwL1xCnV84Z1WCmd04a/Yp6Wykp8HL6RSPANzp5KoNl5iakhCU4Bn9CfNg DPMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version:content-transfer-encoding; bh=N+5sIpJRd1oQSRoR8gpxwiOttK9ycreVsrLj4l7Uh5I=; b=l88QwYyr7ue+6pAoCFRpDF9y7D8smwKPOpA9sA/ml7KsiE+/aolIW1bSg5OgUkDNzc 3KG4jzAwxqT9EfSjfb1solgLVo0wySaf+HfHuXF5c2nb4wUKVXltPmc1Qb9oThNxQBP6 EX+M4mTMsprCqoVBbmZNVV7NFAOflOwjjVvZ8aoRGP6+QaapfKA7O9XYnxmW77/8PHLW FLeS9S4RlZXmkvivmrgfc36QGel55Nl83ONrn2WdgFJPOxlG/IPSFURwiPxQmHCNm5oU xvRlfJdmIT0xcZ0oeUdjPyJs3MxHCIs8pHFPUxRAlxDTEMOiFEZSzCQdBa0gcMgnPCdy +d6w== X-Gm-Message-State: AOAM533Ng9w+gKh/UVtFLCJqbiNrs1YFzfACsxbWmT0HexJGnrNzI1de jgLvK0UDoLrYC6xivP5tgVx/jhtIEZY= X-Google-Smtp-Source: ABdhPJxy/vUjeDkt8Sgo6iMw5SmRihn6gnC6LmlX/MXF+rixn2LxVTIkyk3UzVz/8PubSf4nktO4hA== X-Received: by 2002:a63:5756:0:b0:36c:67bc:7f3f with SMTP id h22-20020a635756000000b0036c67bc7f3fmr29730896pgm.389.1649745860690; Mon, 11 Apr 2022 23:44:20 -0700 (PDT) Received: from dingbat (220-235-26-154.dyn.iinet.net.au. [220.235.26.154]) by smtp.gmail.com with ESMTPSA id c15-20020a17090a674f00b001cba1008a3csm1558015pjm.51.2022.04.11.23.44.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Apr 2022 23:44:20 -0700 (PDT) References: User-agent: mu4e 1.7.12; emacs 28.1.50 From: Tim Cross To: William Denton Subject: Re: #+latex_header blocks, or, managing lots of LaTeX headers Date: Tue, 12 Apr 2022 16:16:41 +1000 In-reply-to: Message-ID: <87bkx6n6m8.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=theophilusx@gmail.com; helo=mail-pg1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1649745926; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=N+5sIpJRd1oQSRoR8gpxwiOttK9ycreVsrLj4l7Uh5I=; b=gPyAa6On/RaZSttTcaSE8ToWw7SE9HDvoUDC7+hucrKE2ZDhWDsr+CGIzEAwyJE7BWWn7T qo0JuXgvZLWRTDHlFsr8bonnW8PyAcu8XYvHYBXvndZbueCV38z/YDLU8ji9nlF3NesOY1 /z4soDL8NfF244sV+Qqlr+hzFRfxr/QqMosSnZ2Ydb9QfX9FyZ6f7MPT5hsAZ8xXHNWzVr QhSp7q486EsYL0EkeinYKwH7KQob9D81JmgnLsFUfoNUC0JX89R1vXbQ2qODU24J/TcvXb aHhTLHriWy8tKsmfwzOQgdr5oE8OiUFC222ah6/bOXQ3WKR/0ilK/KMFSPXIPQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1649745926; a=rsa-sha256; cv=none; b=spr4CK1cvZTObUClgHY5oxaljFsRiXy0V/+ra1NDViUGRcbA8EoU7lyHWQTnLQJSTJgsgZ LVcbBPjU0JK3Pv6fyF3qHCYboxbUQpxz5s9gqE1GsKmZM9syIKDuSQ3/7q8cgyH02ZLkoo 8a+PJnx56VyVWXWZGaaDWgStfwPgmI4INlLlfG8FL5u032NKCJIF1X69N5pEJ6oCxASySQ yQkZNcrlQ2I27xxyhje6EKQYUD0eaIV2qdOdmlMhQ15I62+QNeI6Kjcx1xDHRl1rDTsgUD I3ud2o2yDcHURC/qOqxu70y51Eg2fgnbQuQbYsmxsK7b+G3P2gVfHR8B+ZJ2Qg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Sde8W2CZ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.56 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Sde8W2CZ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 81378391B8 X-Spam-Score: -2.56 X-Migadu-Scanner: scn1.migadu.com X-TUID: yfKoc1+K9PMP William Denton writes: > I have another question related to managing a book I'm doing building for= export to LaTeX: > what do people do for managing all of the headers? > I only use the #+latex_headers or #+latext-headers-extra lines for 'one off' type documents. If I'm going to be writing lots of documents where those packages are needed, I define a new org-latex-classes entry. > It's possible to add a new class to the org-latex-classes variable, and i= n the documentation on > it I see there are options ([NO-DEFAULT-PACKAGES], [NO-PACKAGES], [NO-EXT= RA]) that allow one to > trim away all the default headers. That makes it easy to take away, but n= ot to add in lines I > want, short of managing them in my init file. The org-latex-classes 'placeholder' macros allow you to add or remove the headers defined in either the default-packages or packages alist or headers added via latex_headers/latex_headers_extra. However, the point to note is that this 'value' is just a string, so you can just put in exactly what you want - you don't have to use the placeholder macros (though I almost always do - at least the [default-packages] macro, but usually the [packages] one as well). The value isn't just restricted to \usepackage lines either - you can put anything there which makes sense in the latgex header. > > What sorts of practices do people have for managing lots of LaTeX headers= ? Juan Manuel Mac=C3=ADas, > you mentioned something like this---literate programming in Org to export= LaTeX source---may I > ask how you do it? > If I find myself using lots of #+latex_headers lines, this tells me either 1. I need to update/add to the packages alist variable. This is especially likely if I'm adding the same headers to every document. Just add it to the packages alist. I tend to leave the default-packages alist alone. 2. There is a specific 'style' of document I write often and all documents of this style have the same additional headers. For this, I create a new entry in org-latex-classes. I think adding headers via #+latex_headers and #+latext_headers_extra should be avoided as much as possible. It is a great escape hatch or for doing 'on-offs', but not the right approach for doing something like writing a book. Consider the situation where you have been adding headers to load language support or a particular code listing package or whatever. You writing a book and it will have many org files (perhaps one per chapter). You add these #+latex_header lines to add the packages. Later, you find the listing package isn't suitable or you need to modify the language encoding - now you have to edit every org file which makes up the book. Alternatively, you define a new org-latex-classes entry call 'my-book' and use that to add the language encoding and code listing packages (along with some other 'tweaks' you typically put in the header, maybe even add a few custom commands etc). Now when you find it necessary to change the language encoding, code listing package or whatever, you just have that one definition to change and only need to edit one file.