\makeatletter
\RequirePackage{calc}
\RequirePackage{ifthen}
\RequirePackage{etoolbox}
\RequirePackage{geometry}
\RequirePackage{ifpdf,ifxetex,ifluatex}
\newif\ifxetexorluatex \xetexorluatexfalse
\ifxetex\xetexorluatextrue\fi
\ifluatex\xetexorluatextrue\fi
\ifxetex
  \RequirePackage[EU1]{fontenc}
\else\ifluatex
  \RequirePackage{luaotfload}
  \RequirePackage[EU2]{fontenc}
  \RequirePackage{lmodern}
\else
  \RequirePackage[T1]{fontenc}
\fi\fi
% Load amssymb here if needed
% \RequirePackage{amssymb}
\ifxetex
  \lccode"2019="27 % otherwise the apostrophe breaks hyphenation
  % <hu4uga$ito$1@dough.gmane.org>
  \ifxetex\let\directlua\undefined\fi
  \RequirePackage{fontspec}
  \defaultfontfeatures{Ligatures=TeX,Numbers=OldStyle}
  \RequirePackage{xltxtra}
\else\ifluatex
  % <hu4uga$ito$1@dough.gmane.org>
  \ifxetex\let\directlua\undefined\fi
  \RequirePackage{fontspec}
  \defaultfontfeatures{Ligatures=TeX,Numbers=OldStyle}
\else
  \RequirePackage[utf8]{inputenc}
  % packages loaded by xltxtra
  \RequirePackage{etex}
  \RequirePackage{fixltx2e}
\fi\fi
\makeatother
\endinput
