On Thu, 01 Oct 2015 21:21:42 +0200 Rasmus <ras...@gmx.us> wrote: > Hi Manfred, > > Manfred Lotz <manfred.l...@arcor.de> writes: > > > When creating slides, i.e using beamer I get an option clash > > during compiling the tex file because beamer did already load > > hyperref. > > > > How can I solve it? > > > > Could I have a different package list if the class is beamer? > > No you can only discriminate based on the compiler version (and > actually only in ox-latex, not ox-beamer). >
Hm, I think it would be great if a package list could be mapped to a certain LaTeX class. > You can use a filter to remove hyperref. AFAIK, there's only issues > if you use funny options for hyperref, e.g. I use > > ("unicode, psdextra,hidelinks" "hyperref" nil). > I have this ("colorlinks=true, urlcolor=FireBrick, plainpages=false, pdfpagelabels, bookmarksnumbered" "hyperref" nil) which IMHO doesn't look to exotic. > Last I checked there was an open bug report for this, so it might have > been fixed in upstream beamer. > > I use this filter to remove hyperref in beamer exports: > > (defun rasmus/org-beamer-filter-remove-hyperref (text backend > info) "Remove hyperref from beamer tex files. > > My default values are incompatible with beamer." > ;; TODO: make better solution; check if still necessary > (when (org-export-derived-backend-p backend 'beamer) > (replace-regexp-in-string > "\\\\usepackage\\[\\(.*?\\)\\]{hyperref}\n" > "" > text))) > > (add-to-list 'org-export-filter-final-output-functions > 'rasmus/org-beamer-filter-remove-hyperref) > > Yep, this works fine. Thanks a lot for your help. -- Best, Manfred