% Copyright 2006 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Free Documentation License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.


% pgf version is defined in \pgfversion in file
% generic/pgf/utilities/pgfrcs.code.tex

\def\xcolorversion{2.00}

\usepackage[version=latest]{pgf}

\usepackage{xkeyval,calc,listings,tikz,fp}

\usepackage{hyperref}
\hypersetup{%
	colorlinks=false, % use true to enable colors below:
	linkcolor=blue,%red,
	filecolor=blue,%magenta,
	urlcolor=blue,%cyan,
	citecolor=blue,
	pdfborder=0 0 0,
}

% We need lots of libraries...
\usetikzlibrary{
  arrows,
  arrows.spaced,
  arrows.meta,
  bending,
  babel,
  calc,
  fit,
  patterns,
  plotmarks,
  shapes.geometric,
  shapes.misc,
  shapes.symbols,
  shapes.arrows,
  shapes.callouts,
  shapes.multipart,
  shapes.gates.logic.US,
  shapes.gates.logic.IEC,
  circuits.logic.US,
  circuits.logic.IEC,
  circuits.logic.CDH,
  circuits.ee.IEC,
  datavisualization,
  datavisualization.polar,
  datavisualization.formats.functions,
  er,
  automata,
  backgrounds,
  chains,
  topaths,
  trees,
  petri,
  mindmap,
  matrix,
  calendar,
  folding,
  fadings,
  shadings,
  spy,
  through,
  turtle,
  positioning,
  scopes,
  decorations.fractals,
  decorations.shapes,
  decorations.text,
  decorations.pathmorphing,
  decorations.pathreplacing,
  decorations.footprints,
  decorations.markings,
  shadows,
  lindenmayersystems,
  intersections,
  fixedpointarithmetic,
  fpu,
  svg.path,
  external,
  graphs,
  graphs.standard,
  quotes,
  math,
  angles
}

\usepackage{ifluatex}
\newif\ifgdccodebasic
\newif\ifgdccodeogdf

\ifluatex

  \usetikzlibrary{graphdrawing}
  \usegdlibrary{trees,circular,layered,examples,force,phylogenetics}

  % Test whether C code is available:
  \directlua{
    if pcall(require,'pgf_gd_examples_c_SimpleDemoC') then
      tex.print('\string\\gdccodebasictrue')
    end
  }

  \ifgdccodebasic
    \usegdlibrary{pgf_gd_examples_c_SimpleDemoC,pgf_gd_examples_c_SimpleDemoCPlusPlus}

    % Test whether OGDF code is available:
    \directlua{
      if pcall(require,'pgf_gd_ogdf_c_SimpleDemoOGDF') then
        tex.print('\string\\gdccodeogdftrue')
      end
    }

    \ifgdccodeogdf
      \usegdlibrary{pgf_gd_ogdf_c_SimpleDemoOGDF,ogdf}
    \fi
    
  \fi
  
\fi

\def\LuaTeX{Lua\TeX}%



\iffalse
%\iftrue
  \tikzexternalize[
    mode=list only,export=true,% simply skips EVERY picture -> good for debugging the text.
  ]{pgfmanual}

  \tikzifexternalizing{%
    \pgfkeys{/pdflinks/codeexample links=false}%
  }{}%
\fi


\usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead]{geometry}
\usepackage{amsmath,amssymb}
\usepackage{xxcolor}
\usepackage{pifont}
\usepackage{makeidx}

\ifluatex
%  \usepackage[no-math]{fontspec}
%  \usepackage{luatextra}

  % TT: I have commented luatextra since it loads fontspec, which
  % currently breaks "$\mathrm{\Omega}$" (nothing is
  % shown). Also, fontspec loads so much stuff, I'm not really sure
  % any of it is needed...

  % \filedescription is defined in expl3, required by fontspec,
  % required by luatextra. Needs to be \relaxed since
  % pgfmanual-en-macros.tex defines an environment named filedescription
  \let\filedescription\relax
  \usepackage[utf8]{luainputenc}
\else 
  \usepackage[utf8]{inputenc}
\fi
\usepackage{amsmath}

\graphicspath{{../../images/}}              % TODOsp: under windows this would go up 2 directories, but the file is only one directory up
\input{../../macros/pgfmanual-en-macros}    % TODOsp: same here

\makeindex

\makeatletter
\renewcommand*\l@section[2]{%
  \ifnum \c@tocdepth >\z@
    \addpenalty\@secpenalty
    \addvspace{1.0em \@plus\p@}%
    \setlength\@tempdima{2.5em}%
    \begingroup
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode \bfseries
      \advance\leftskip\@tempdima
      \hskip -\leftskip
      #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
    \endgroup
  \fi}
\renewcommand*\l@subsection{\@dottedtocline{2}{2.5em}{3.3em}}
\renewcommand*\l@subsubsection{\@dottedtocline{3}{5.8em}{4.2em}}
\def\@pnumwidth{2.2em}
\makeatother

%\includeonly{pgfmanual-en-library-profiler}

% Global styles:
\tikzset{
  every plot/.style={prefix=plots/pgf-},
  shape example/.style={
    color=black!30,
    draw,
    fill=yellow!30,
    line width=.5cm,
    inner xsep=2.5cm,
    inner ysep=0.5cm}
}

\index{Options for graphics|see{Graphic options and styles}}
\index{Styles for graphics|see{Graphic options and styles}}
\index{Options for packages|see{Package options}}
\index{Handlers for keys|see{Key handlers}}
\index{File|see{Packages and files}}
\index{Layout|see{Page layout}}
\index{Node|see{Predefined node}}
\index{Data formats|see{Formats}}


%%% Local Variables:
%%% mode: latex
%%% TeX-master: "~/pgf/doc/generic/pgf/version-for-luatex/en/pgfmanual"
%%% coding: iso-latin-1-unix
%%% End:
