diff --git a/docs/pftools.sty b/docs/pftools.sty
index c8de881221ba4732421e990f7ed569ea7b6c4a6d..56507b17dcb913596b5c615fc680272d18c91dba 100644
--- a/docs/pftools.sty
+++ b/docs/pftools.sty
@@ -1,11 +1,15 @@
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesPackage{pftools}
 
+\@ifundefined{basedir}{%
 \RequirePackage{locallabel}
+}{%
+\RequirePackage{\basedir locallabel}
+}%
+
 \RequirePackage{Tabbing}	% Avoid the standard tabbing environment. Its \< conflicts with the semantic package.
 \RequirePackage{xparse}
 \RequirePackage{xcolor}
-\RequirePackage{locallabel}
 
 %% Biimplication inference rules
 % \biimp above below
diff --git a/docs/setup.tex b/docs/setup.tex
index e16fbecf978f4044a1befd701ea3ebf903e1d9fa..fca700a2c119220304c71d1436774534dbb22316 100644
--- a/docs/setup.tex
+++ b/docs/setup.tex
@@ -1,6 +1,13 @@
+
+\makeatletter%
+\@ifundefined{basedir}{%
+\newcommand\basedir{}%
+}{}%
+\makeatother%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %% PACKAGES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 \usepackage{mathtools}
 %\usepackage{amsmath}
 \usepackage{amsfonts}
@@ -8,14 +15,14 @@
 \usepackage{amssymb}
 \usepackage{stmaryrd}
 
-\usepackage{mathpartir}
+\usepackage{\basedir mathpartir}
 
 \usepackage{array}
 \usepackage{tabu}
 
 \usepackage{dashbox}
 
-\usepackage{pftools}
+\usepackage{\basedir pftools}
 
 \usepackage{xcolor}  % for print version
 
@@ -459,8 +466,3 @@
 
 \newcommand{\AuthInv}{\textsf{AuthInv}}
 \newcommand{\Auth}{\textsf{Auth}}
-
-%%% Local Variables:
-%%% mode: latex
-%%% TeX-master: "iris"
-%%% End: