\ProvidesPackage{FABshort}
  [2015/03/09 Axel Berger's custom shortcuts]

\newif\ifFABtight \FABtightfalse
\DeclareOption{tightheadings}{\FABtighttrue}
\newif\ifFABthumb \FABthumbfalse
\DeclareOption{thumb}{\FABthumbtrue}
\newif\ifFABprint \FABprintfalse
\DeclareOption{print}{\FABprinttrue}
\newif\ifFABdraft \FABdraftfalse
\DeclareOption{draft}{\FABdrafttrue}
\DeclareOption{final}{\FABdraftfalse\FABthumbfalse\FABprintfalse}
\ProcessOptions

\newif\ifFABtwocolumn
\if@twocolumn\FABtwocolumntrue\else\FABtwocolumnfalse\fi
\providecommand*{\align}{}
\newlength{\FABindent}
\setlength{\FABindent}{\parindent}
\newlength{\FABtopsep}
\setlength{\FABtopsep}{-\parskip}
\newlength{\FABpartopsep}
\setlength{\FABpartopsep}{.5ex plus.2ex minus.1ex}

\newcounter{saveenum}
\newcounter{tmpcnt}
\newlength{\breite}


%%% Persönliche Daten
%%% -------------------------------------------------------

\providecommand*{\mytitle}{}
\providecommand*{\pagetitle}{\mytitle}
\providecommand*{\autname}{}
\providecommand*{\auturl}{}
\providecommand*{\mycopy}{}
\providecommand*{\mylogo}{}
\providecommand*{\datum}{}
\providecommand*{\shortinf}{}
\renewcommand*{\autname}{Dipl.-Ing.\ F.~Axel Berger}
\renewcommand*{\auturl}{www.berger-odenthal.de}


%%% Paketunterstützung
%%% -------------------------------------------------------

\RequirePackage{etoolbox}

% Von Heiko Oberdiek
\newcommand{\PackageSetup}[3][]{\@ifpackageloaded{#2}{#3}{#1}}

\DeclareTextCommandDefault{\textnsuperior}{\textperthousand}

\newcommand{\tafelsec}{\section*}
\ifdefined\KOMA@key
\KOMA@key{listof}[leveldown]{\renewcommand{\tafelsec}{\subsection*}}
\fi

\ifdefined\ifthispageodd
  \if@twoside\relax
  \else\let\ifthispageodd\@firstoftwo
  \fi
\else
  \newcommand{\ifthispageodd}{\@firstoftwo}
\fi

\newcommand\parafterlist{\@noparlisttrue}
\newcommand\noparafterlist{\@noparlistfalse}
\providecommand{\Embinput}[1]{\input{#1}}
\AtBeginDocument{\providecommand{\geometry}[1]{}}

\providecommand*{\hl}[1]{#1}
\ifFABdraft%
	\@ifpackageloaded{color}{%
		\renewcommand*{\hl}[1]{\colorbox{yellow}{#1}}
		\renewcommand\@setref[3]{%
		  \ifx#1\relax
		   \protect\G@refundefinedtrue
		   \nfss@text{\colorbox{yellow}{\reset@font\bfseries ????}}%
		   \@latex@warning{Reference `#3' on page \thepage \space undefined}%
		  \else
		   \expandafter#2#1\null
		  \fi}%
		\patchcmd{\@citex}{\hbox}{\colorbox{yellow}}{}{}%
	}{\renewcommand*{\hl}[1]{\fbox{#1}}}%
\fi
% \ifFABdraft%
% 	\@ifpackageloaded{pdfcomment}% ab PDF 1.7
% 		{\providecommand*{\hl}[2]{%
% 		\pdfmarkupcomment[markup=Highlight,color=yellow]{{#1}}{{#2}}}}%
% 		{\@ifpackageloaded{color}%
% 			{\providecommand*{\hl}[2]{\colorbox{yellow}{#1}}}%
% 			{\providecommand*{\hl}[2]{\fbox{#1}}}}%
% \fi

\providecommand*{\LaTeXraggedright}{\raggedright}
\providecommand*{\LaTeXraggedleft}{\raggedleft}
\providecommand*{\LaTeXcentering}{\centering}
\providecommand*{\justifying}{}
\ifdefined\LaTeXcenter\else\let\LaTeXcenter\center\fi
\ifdefined\endLaTeXcenter\else\let\endLaTeXcenter\endcenter\fi
\ifdefined\LaTeXflushleft\else\let\LaTeXflushleft\flushleft\fi
\ifdefined\endLaTeXflushleft\else\let\endLaTeXflushleft\endflushleft\fi
\ifdefined\LaTeXflushright\else\let\LaTeXflushright\flushright\fi
\ifdefined\endLaTeXflushright\else\let\endLaTeXflushright\endflushright\fi

% Von Rolf Niepraschk
\newenvironment{Xminipage}[1]{%
   \trivlist\item\relax\minipage{#1}}{%
   \endminipage\endtrivlist}

\PackageSetup{cjhebrew}{%
	\newcommand*{\hebsize}{\normalsize}
	\newcommand*{\hsq}{\cjLR{{\normalfont\hebsize\textquotesingle}}}
	\newcommand*{\hdq}{\cjLR{{\normalfont\hebsize\textquotedbl}}}
	\newcommand*{\hrm}[1]{\cjLR{\normalfont\hebsize{#1}}}
	\newcommand*{\hvo}[1]{$\:${#1}$\!$}
	\newcommand*{\hpi}{\cjLR{\normalfont\hebsize{$|$}}}
	\newcommand*{\hsr}{\cjLR{\normalfont\hebsize{$]$}}}
	\newcommand*{\hsl}{\cjLR{\normalfont\hebsize{$[$}}}
	\newcommand*{\hfs}{\cjLR{\normalfont\hebsize{$/$}}}
	\newcommand*{\hbs}{\cjLR{\normalfont\hebsize{$\backslash$}}}
	\newcommand*{\hbr}{\cjLR{\normalfont\hebsize{$)$}}}
	\newcommand*{\hbl}{\cjLR{\normalfont\hebsize{$($}}}
	\newcommand*{\hur}{\cjLR{\normalfont\hebsize{$\!\rceil$}}}
	\newcommand*{\hul}{\cjLR{\normalfont\hebsize{$\lceil\!$}}}
	\newcommand*{\htr}{\cjLR{\normalfont\hebsize{$\rangle$}}}
	\newcommand*{\htl}{\cjLR{\normalfont\hebsize{$\langle$}}}
	\newcommand*{\hgr}{\cjLR{\normalfont\hebsize{$\rbrace$}}}
	\newcommand*{\hgl}{\cjLR{\normalfont\hebsize{$\lbrace$}}}
	}


%%% Seitenlayout
%%% -------------------------------------------------------

\providecommand{\Kopfzeile}{\markboth{\autname}{\mytitle}}

\ifdefined\paragraph%
  \providecommand*{\size@paragraph}{\normalsize}%
  \providecommand*{\sectfont}{\normalfont\bfseries}%
  \providecommand*{\raggedsection}{}%
  \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
  {-3.25ex \@plus-1ex \@minus-.5ex}{.0001pt}%
  {\setlength{\parfillskip}{\z@ plus 1fil}%
    \raggedsection\normalfont\sectfont\nobreak\size@paragraph}}%
  \providecommand{\bigpara}[1][]{%
    \paragraph{\\[-\baselineskip]}\textsc{#1}}%
\fi
\ifdefined\subparagraph%
  \providecommand*{\size@subparagraph}{\normalsize}%
  \providecommand*{\sectfont}{\normalfont\bfseries}%
  \providecommand*{\raggedsection}{}%
  \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\z@}%
  {1.5ex \@plus.5ex \@minus.2ex}{-.7em}%
  {\setlength{\parfillskip}{\z@ plus 1fil}%
    \raggedsection\normalfont\sectfont\nobreak\size@subparagraph}}%
  \providecommand{\smallpara}[1][\hspace*{-.26em}]{%
    \subparagraph{\normalfont\textsc{#1}\hspace*{-.4em}}}%
\fi
\ifFABtight
	\RequirePackage{FABtight}
\fi

\renewenvironment{quotation}{\list{}{%
  \listparindent \FABindent
  \itemindent    \listparindent
  \rightmargin   \leftmargin
  \parsep        \z@ \@plus\p@
  }\item\relax}{\endlist}
\newenvironment{compactquotation}{\list{}{%
  \listparindent \FABindent
  \itemindent    \listparindent
  \rightmargin   \leftmargin
  \parsep        \z@ \@plus\p@
  \topsep        \FABtopsep
  \partopsep     \FABpartopsep
  }\item\relax}{\endlist}
\newenvironment{compactquote}{\list{}{%
  \rightmargin   \leftmargin
  \topsep        \FABtopsep
  \partopsep     \FABpartopsep
  }\item\relax}{\endlist}

\renewcommand*{\topfraction}{.85}
\renewcommand*{\bottomfraction}{.75}
\renewcommand*{\textfraction}{.15}
\renewcommand*{\floatpagefraction}{.7}
\renewcommand*{\dbltopfraction}{.85}
\renewcommand*{\dblfloatpagefraction}{.7}
\setcounter{topnumber}{6}
\setcounter{bottomnumber}{4}
\setcounter{totalnumber}{9}
\setcounter{dbltopnumber}{4}
\setlength{\@fptop}{5pt}
\setlength{\@fpsep}{12pt plus1fil minus4pt}
\setlength{\@fpbot}{0pt plus3fil}
\setlength{\@dblfptop}{\@fptop} %{5pt}
\setlength{\@dblfpsep}{\@fpsep} %{12pt plus1fil minus4pt}
\setlength{\@dblfpbot}{\@fpbot} %{0pt plus3fil}
\setlength{\floatsep}{12pt plus2pt minus4pt}
\setlength{\dblfloatsep}{\floatsep} %{12pt plus2pt minus4pt}
\setlength{\textfloatsep}{14pt plus1filll minus6pt} %plus8pt
\setlength{\dbltextfloatsep}{\textfloatsep} %{14pt plus1filll minus6pt}
\setlength{\intextsep}{12pt plus6pt minus2pt}

% Setzt auf der letzten Seite eines Kapitels mit Abbildungen
% Flushbottom außer Kraft. Gehört ganz ans Ende.
\newcommand{\thispagelast}{\vspace*{0pt plus5filll}\clearpage}


%%% Privatmakros
%%% -------------------------------------------------------

% \@ifpackageloaded{amsmath}%
% 	{\DeclareMathOperator{\dif}{d}}%
% 	{\newcommand*{\dif}{}%
% 	\DeclareRobustCommand*{\dif}{\mathop{\operator@font d}}}%
\providecommand*\dif{\mathop{}\!\mathrm{d}}

\ifdefined\caps
  \typeout{FABshort: caps already defined}
\else\ifdefined\textls%
  \DeclareRobustCommand*{\caps}[1]{\scalebox{.92}{\textls*[70]{\MakeUppercase{{#1}}}}}%
\else%
  \newcommand*{\caps}[1]{\MakeUppercase{{#1}}}%
  \typeout{FABshort: textls undefined}
\fi\fi

\ifdefined\textls%
  \newcommand*{\acr}{}%
  \DeclareRobustCommand*{\acr}[1]{\scalebox{.92}{\textls*[70]{{#1}}}}%
\else%
  \newcommand*{\acr}[1]{{#1}}%
\fi

% LaTeX Hacks
\newcommand*{\signed}[1]{\unskip\hspace{1em plus 1fill}%
	\nolinebreak[3]\hspace*{\fill}\mbox{\emph{#1}}}

% \DeclareRobustCommand*{\mol}[3][]%
% 	{\textsf{\upshape \textsuperscript{{#1}}{#2}\textsubscript{{#3}}}}
\DeclareRobustCommand*{\mol}[3][]%
	{\textsf{\textsuperscript{{#1}}{#2}\textsubscript{{#3}}}}

\newcommand*{\xref}[3][]{\href{#2#3}{\nolinkurl{#1#3}}}

\newcommand{\tsfsl}[1]{\textsf{\textsl{{#1}}}}
\newcommand*{\ausl}{[\kern\fontdimen3\font\textellipsis] }
\newcommand*{\up}[1]{\textsuperscript{{#1}}}
\newcommand*{\dn}[1]{\textsubscript{{#1}}}
\newcommand*{\hoch}{\textasciicircum}
\providecommand*{\tsim}{\texttildelow}
\newcommand*{\tpm}{\textpm}
\providecommand*{\tsc}[1]{\textsc{{#1}}}
\newcommand*{\htmlspan}[1]{#1}
% \newcommand*{}{}

\endinput
