From f73de97de9a96fdbcea0f6d41427e3d6d137a99f Mon Sep 17 00:00:00 2001 From: Xavier Olive Date: Thu, 20 Aug 2015 23:58:07 +0200 Subject: [PATCH 1/2] Deal with conflicts with tufte-handout.cls There are several conflicts that are raised when you use tufte-handout layout with the default.latex template, namely hyperref and color, which are already loaded by the class. This commit enables to only load `hyperref` and `color` packages if they are not already loaded (by Tufte). --- default.latex | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/default.latex b/default.latex index 2deebfecc..92cfbc737 100644 --- a/default.latex +++ b/default.latex @@ -53,6 +53,8 @@ $endif$ $if(geometry)$ \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} $endif$ +\makeatletter +\@ifpackageloaded{hyperref}{}{% \ifxetex \usepackage[setpagesize=false, % page size defined by xetex unicode=false, % unicode breaks when used with xetex @@ -60,7 +62,13 @@ $endif$ \else \usepackage[unicode=true]{hyperref} \fi +} +\makeatother +\makeatletter +\@ifpackageloaded{color}{}{% \usepackage[usenames,dvipsnames]{color} +} +\makeatother \hypersetup{breaklinks=true, bookmarks=true, pdfauthor={$author-meta$}, From def68fce50ab56ee33359aed9dee9a6de6bc1834 Mon Sep 17 00:00:00 2001 From: Xavier Olive Date: Wed, 26 Aug 2015 21:01:03 +0200 Subject: [PATCH 2/2] Keep the same options when color is already passed Use `\PassOptionsToPackage` instead of `\usepackage` when package color is already loaded. Resolves: #116 See also: #107 --- default.latex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/default.latex b/default.latex index 92cfbc737..e9eaa08b7 100644 --- a/default.latex +++ b/default.latex @@ -63,10 +63,10 @@ $endif$ \usepackage[unicode=true]{hyperref} \fi } -\makeatother -\makeatletter -\@ifpackageloaded{color}{}{% -\usepackage[usenames,dvipsnames]{color} +\@ifpackageloaded{color}{ + \PassOptionsToPackage{usenames,dvipsnames}{color} +}{% + \usepackage[usenames,dvipsnames]{color} } \makeatother \hypersetup{breaklinks=true,