%
% $Id: dcsmono.sty 2775 2012-03-15 09:42:12Z sobaniec $
%
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{listings}
\usepackage{url}
\usepackage[bottom]{footmisc}
\usepackage{caption}
\usepackage{subfig}
\usepackage{array}
%\usepackage{mdframed}
\usepackage{array}
\usepackage{iftex}


\newif\ifunicodeengine
\ifXeTeX
  \unicodeenginetrue
\else
  \ifLuaTeX
    \unicodeenginetrue
  \else
    \RequirePackage[utf8]{inputenc}
    \RequirePackage[T1]{fontenc}
  \fi
\fi
\ifunicodeengine
  \RequirePackage{mathspec}
  \defaultfontfeatures{Ligatures=TeX}
  %% commercial fonts
  %\setprimaryfont[Scale=1.02]{Chaparral Pro Light}
  %\setallsansfonts[Scale=0.93]{Myriad Pro Light}
  %\setallmonofonts[Scale=0.93]{Lekton}		% http://www.fontsquirrel.com/fonts/lekton
  %\lstset{basewidth=0.5em}			% necessary for listings for Lekton
  %\newfontfamily{\secfont}[Scale=1.0]{Myriad Pro Light SemiCondensed}

  % free alternatives:
  \setprimaryfont[Scale=1.04]{Linux Libertine O} % http://www.fontsquirrel.com/fonts/Linux-Libertine
  \setallsansfonts[Scale=0.85]{Open Sans} 		% http://www.fontsquirrel.com/fonts/open-sans
  \setallmonofonts[Scale=0.93]{Lekton}		% http://www.fontsquirrel.com/fonts/lekton
  \lstset{basewidth=0.5em}			% necessary for listings for Lekton
  \newcommand{\secfont}{\sffamily}
  %\setmathsfont(Greek)[Scale=MatchLowercase]{STIXGeneral}
\else
  \usepackage[scaled=0.88]{helvet}
  \usepackage[scaled=0.82]{beramono}
  \newcommand{\secfont}{\sffamily}
\fi


% geometry
\geometry{twoside=true,
          paperwidth=155mm,paperheight=235mm,
          width=117mm,height=191mm,
          tmargin=2.2cm,headsep=18pt,
          hmarginratio=1:1,
          bindingoffset=0cm}


% section numbering
\setcounter{secnumdepth}{2}

\renewcommand{\secsize}{\Large}
\renewcommand{\secstyle}{\bfseries\boldmath\secfont}
\renewcommand{\subsecsize}{\large}
\renewcommand{\subsecstyle}{\bfseries\boldmath\secfont}
\renewcommand{\subsubsecstyle}{\bfseries\boldmath\secfont}


% listings
\lstset{tabsize=2,extendedchars=true,
        basicstyle=\ttfamily\small,
        showspaces=false,showstringspaces=false,
        language=,numberstyle=\tiny\sffamily,
        inputencoding=latin2,
        belowcaptionskip=\medskipamount}
\lstdefinestyle{java}{language=Java,tabsize=4}
\lstdefinestyle{javan}{style=java,numbers=left,xleftmargin=3em}


%\setitemindent{mmii}
%\setitemitemindent{ni}

% TOC spaces
%\settowidth{\tocchpnum}{99..\enspace}
%\settowidth{\tocsecnum}{99..99.\enspace}
%\settowidth{\tocsubsecnum}{99.99.7...}
%\calctocindent


% colors
\definecolor{linkcolor}{rgb}{0.1,0.1,0.6}
\definecolor{framecolor}{rgb}{0.93,0.93,0.93}
\definecolor{rulecolor}{rgb}{0.7,0.7,0.7}


% captions
\DeclareCaptionLabelSeparator{nspace}{~~}
\captionsetup{font={small},labelfont=bf,labelsep=nspace,
              margin=0pt,singlelinecheck=false,
              skip=\bigskipamount}
\captionsetup[table]{position=top,aboveskip=\medskipamount,
                     belowskip=0cm,oneside}
\captionsetup[lstlisting]{position=top,aboveskip=\medskipamount,
                          belowskip=0cm,oneside}
\captionsetup[subfloat]{font=small,labelfont=md,singlelinecheck=true}


% page style bchap
\renewcommand{\ps@bchap}{
  \renewcommand{\@oddhead}{}
  \renewcommand{\@evenhead}{}
}


% mdframed
%\mdfsetup{skipabove=2ex,skipbelow=2ex,
%          linewidth=0.4pt,linecolor=black,
%          fontcolor=black,backgroundcolor=framecolor}
