From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [export] Should sidewaystable option automatically add rotating package? Date: Wed, 18 Sep 2013 15:18:43 +0200 Message-ID: References: <87ob7z4nzl.fsf@pinto.chemeng.ucl.ac.uk> <877gentvmv.fsf@gmx.us> <87wqmmos25.fsf@gmail.com> <20130913100125.257db23d@vknecht-intel.unibw-hamburg.de> <87ioy1vya1.fsf@gmx.us> <874n9kwott.fsf@gmx.us> <87zjrcmdai.fsf@ericabrahamsen.net> <170A71C4-F232-4E00-BB52-3EB667D570BC@gmail.com> <87ioxztwbw.fsf@pank.eu> Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Content-Type: multipart/signed; boundary="Apple-Mail=_379A1027-93AF-49FE-B116-006EF0CD200F"; protocol="application/pgp-signature"; micalg=pgp-sha1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMHjO-0002kZ-26 for emacs-orgmode@gnu.org; Wed, 18 Sep 2013 09:23:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMHjI-0003Y9-8E for emacs-orgmode@gnu.org; Wed, 18 Sep 2013 09:23:46 -0400 Received: from mail-ea0-x22b.google.com ([2a00:1450:4013:c01::22b]:48570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMHjI-0003Xr-1P for emacs-orgmode@gnu.org; Wed, 18 Sep 2013 09:23:40 -0400 Received: by mail-ea0-f171.google.com with SMTP id n15so3427752ead.2 for ; Wed, 18 Sep 2013 06:23:39 -0700 (PDT) In-Reply-To: <87ioxztwbw.fsf@pank.eu> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rasmus Cc: emacs-orgmode@gnu.org --Apple-Mail=_379A1027-93AF-49FE-B116-006EF0CD200F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 17.9.2013, at 15:24, Rasmus wrote: > Hi Carsten, >=20 > Carsten Dominik writes: >=20 >> I'd be interested to see a patch to this effect. >=20 > For now here's the filter I use and a add-to-list that hopefully > works. It could be turned into a general function such that >=20 > - Certain packages are only required with certain flavors of TeX > (curtsy of iftex). > - It only applies to the preamble (e.g. I don't want it in my > code-blocks). >=20 > For me it works great because I can quickly check drafts with pdftex > (which is substantially faster on my system) and switch to xelatex or > lualatex for more serious drafts. >=20 > (setq rasmus/org-protected-packages '(inputenc fontenc)) > (add-to-list 'org-latex-default-packages-alist '("" "iftex" nil)) >=20 > (defun rasmus/org-latex-filter-protect-inputenc (text backend info) > "Make inputenc and fontenc only load when using pdflatex" > (when (org-export-derived-backend-p backend 'latex 'beamer) > (replace-regexp-in-string > (format "\\(\\\\usepackage\\[.*\\]{\\(%s\\)}\\)" > (mapconcat 'symbol-name pank/org-protected-packages = "\\|")) > "\\\\ifPDFTeX\\1\\\\else\\\\fi" > text))) >=20 > (add-to-list 'org-export-filter-final-output-functions > 'rasmus/org-latex-filter-protect-inputenc) >=20 >=20 > The output tex file looks something like this: >=20 > \ifPDFTeX\usepackage[utf8]{inputenc}\else\fi > \ifPDFTeX\usepackage[T1]{fontenc}\else\fi Hi Rasmus, this looks excellent. I think we will implement this as the default = behavior, but only after 8.2. Does this capture all the possible cases, or are there more cases to = consider? - Carsten >=20 > BTW: I think the \else is redundant. >=20 > =96Rasmus >=20 > -- > There are known knowns; there are things we know that we know. --Apple-Mail=_379A1027-93AF-49FE-B116-006EF0CD200F Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJSOagzAAoJEO+gg/nAZuwM4zMIAMRugL0BBcp1vKyqUL/5so+1 onu7yekHsYHfq6z0x1xRnDm4Lp/t1e4TWPELFqwhrcU6780+R7BFv7mrC8ckWXeN VHtkTPk2CCIF3UGK2iifdRgwZAwk0amSWD8q7ewNwQL2UXULHthiYwuMbP8f+DAN 6plqomwXtbciQephr6t+UGxMmfUiclHvTy0TTSLkQN+dJmB3iu0Je1OI8U6ZI/CX AvSx3iGSvOIctasOL2wsfyhpIVaGwnnr9unkE5r6eu3P3+8KBs53gvp/LzammrGY 4REtOIKXBxbWxINnmTH9bOi9Kbep12e0tYkiqtDFsgQjBbou9e77IQObyDd9llU= =DWAI -----END PGP SIGNATURE----- --Apple-Mail=_379A1027-93AF-49FE-B116-006EF0CD200F--