[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [export] Should sidewaystable option automatically add rotating
From: |
Carsten Dominik |
Subject: |
Re: [O] [export] Should sidewaystable option automatically add rotating package? |
Date: |
Wed, 18 Sep 2013 15:18:43 +0200 |
On 17.9.2013, at 15:24, Rasmus <address@hidden> wrote:
> Hi Carsten,
>
> Carsten Dominik <address@hidden> writes:
>
>> I'd be interested to see a patch to this effect.
>
> 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
>
> - 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).
>
> 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.
>
> (setq rasmus/org-protected-packages '(inputenc fontenc))
> (add-to-list 'org-latex-default-packages-alist '("" "iftex" nil))
>
> (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)))
>
> (add-to-list 'org-export-filter-final-output-functions
> 'rasmus/org-latex-filter-protect-inputenc)
>
>
> The output tex file looks something like this:
>
> \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
>
> BTW: I think the \else is redundant.
>
> –Rasmus
>
> --
> There are known knowns; there are things we know that we know.
signature.asc
Description: Message signed with OpenPGP using GPGMail
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, (continued)
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Carsten Dominik, 2013/09/16
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Rasmus, 2013/09/16
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Rainer M Krug, 2013/09/16
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Carsten Dominik, 2013/09/16
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Carsten Dominik, 2013/09/16
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Rasmus, 2013/09/16
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Andreas Leha, 2013/09/16
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Eric Abrahamsen, 2013/09/16
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Carsten Dominik, 2013/09/17
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Rasmus, 2013/09/17
- Re: [O] [export] Should sidewaystable option automatically add rotating package?,
Carsten Dominik <=
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Rasmus, 2013/09/18
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Carsten Dominik, 2013/09/18
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Rasmus, 2013/09/19
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Carsten Dominik, 2013/09/19
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Nicolas Girard, 2013/09/19
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Carsten Dominik, 2013/09/19
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Carsten Dominik, 2013/09/25
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Nicolas Girard, 2013/09/25
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Carsten Dominik, 2013/09/25
- Re: [O] [export] Should sidewaystable option automatically add rotating package?, Rasmus, 2013/09/25