Index: SMC4LRT/Outline.tex
===================================================================
--- SMC4LRT/Outline.tex	(revision 3665)
+++ SMC4LRT/Outline.tex	(revision 3666)
@@ -7,5 +7,4 @@
 \documentclass[11pt]{book} % use larger type; default would be 10pt
 
-\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)
 
 \usepackage{url}
@@ -38,16 +37,5 @@
 %   read geometry.pdf for detailed page layout information
 
-\usepackage{graphicx} % support the \includegraphics command and options
-
 % \usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
-
-%%% PACKAGES
-\usepackage{booktabs} % for much better looking tables
-\usepackage{array} % for better arrays (eg matrices) in maths
-\usepackage{paralist} % very flexible & customisable lists (eg. enumerate/itemize, etc.)
-\usepackage{verbatim} % adds environment for commenting out blocks of text & for better verbatim
-%\usepackage{subfig} % make it possible to include more than one captioned figure/table in a single float
-% These packages are all incorporated in the memoir class to one degree or another...
-
 %%% HEADERS & FOOTERS
 \usepackage{fancyhdr} % This should be set AFTER setting up the page geometry
@@ -67,6 +55,4 @@
 %\renewcommand{\cftsecfont}{\rmfamily\mdseries\upshape}	
 %\renewcommand{\cftsecpagefont}{\rmfamily\mdseries\upshape} % No bold!
-
-\usepackage{color}
 
 
@@ -92,30 +78,29 @@
 \listoftodos
 
+\begin{comment}
 
 \input{chapters/Introduction}
 
+\input{chapters/Literature}
+\end{comment}
 \begin{comment}
-\input{chapters/Literature}
-
 \input{chapters/Definitions}
-
 \input{chapters/Data}
 
 \input{chapters/Infrastructure}
 
-\input{chapters/Design}
 
-\input{chapters/Implementation}
+\input{chapters/Design_SMCschema}
 
-\input{chapters/CMD2RDF}
-
+\input{chapters/Design_SMCinstance}
+\end{comment}
 \input{chapters/Results}
 
 \input{chapters/Conclusion}
-\end{comment}
+
 
 
 \bibliographystyle{ieeetr}
-\bibliography{../../2bib/lingua,../../2bib/ontolingua,../../2bib/smc4lrt,../../2bib/semweb}
+\bibliography{../../2bib/lingua,../../2bib/ontolingua,../../2bib/smc4lrt,../../2bib/semweb,../../2bib/distributed_systems,../../2bib/own}
 
 \appendix
Index: SMC4LRT/build.props
===================================================================
--- SMC4LRT/build.props	(revision 3666)
+++ SMC4LRT/build.props	(revision 3666)
@@ -0,0 +1,5 @@
+scripts.dir=C:/Users/m/3/7utils
+in.dir=C:/Users/m/3/clarin/_repo/SMC/docs/
+out.dir=chapters/
+python.path=c:/apps/Python33/
+images.dir=${in.dir}
Index: SMC4LRT/build.xml
===================================================================
--- SMC4LRT/build.xml	(revision 3666)
+++ SMC4LRT/build.xml	(revision 3666)
@@ -0,0 +1,78 @@
+<?xml version="1.0"?>	
+
+
+<!-- ====================================================================== 
+     Date:     2011-10     
+     Project:  SMC
+     ====================================================================== -->
+
+
+	
+<project name="SMC-master"  default="smc-docs-rst2latex" basedir=".">
+	
+    <description>
+           helper targets for master
+    </description>
+	
+	<property file="build.props"/>
+
+	<target name="smc-docs-rst2latex" >
+		<antcall target="smc-doc-rst2latex" >
+			<param name="src.fn" value="userdocs" />						
+		</antcall>
+		<!--<antcall target="smc-doc-rst2latex" >
+			<param name="src.fn" location="examples" />			
+		</antcall>
+		<antcall target="smc-doc-rst2latex" >
+			<param name="src.fn" location="examples2" />			
+		</antcall>
+		-->
+		
+	</target>
+	<target name="smc-doc-rst2latex" >
+		<ant antfile="${scripts.dir}\build_docs.xml" target="rst2x">
+			<property name="output.format" value="latex" />
+			<property name="src.file" location="${in.dir}${src.fn}.rst" />
+			<property name="out.file" location="${out.dir}${src.fn}.tex"/>		
+		</ant>
+		
+		<exec executable="perl" input="${out.dir}${src.fn}.tex " output="${out.dir}${src.fn}_cleaned.tex">
+			<arg value="${scripts.dir}/autodocs/cleantexfromrst.pl" />
+			<arg value="${images.dir}"/>          
+		</exec>
+			<!--
+		
+		<ant antfile="${scripts.dir}\build_docs.xml" target="rst2x">
+			<property name="output.format" value="latex" />
+			<property name="src.file" location="${in.dir}examples2.rst" />
+			<property name="out.file" location="${out.dir}examples2.tex"/>		
+		</ant>		-->
+	</target>
+  
+  <target name="extract-refs" >
+  	<concat destfile="zx_metares/chapters_concat.txt">
+  		<fileset dir="${out.dir}" includes="*.tex"/>
+  		<fileset dir="images" includes="*.tex"/>
+  	</concat>
+  	<exec executable="perl" input="zx_metares/chapters_concat.txt" output="zx_metares/refs_list.txt">
+  		<arg value="${scripts.dir}/autodocs/extractrefsromrtex.pl" />  		          
+  		<arg value="list" />
+  	</exec>
+  	
+  	<exec executable="perl" input="zx_metares/chapters_concat.txt" output="zx_metares/refs.dot">
+  		<arg value="${scripts.dir}/autodocs/extractrefsromrtex.pl" />  		          
+  		<arg value="graph" />
+  	</exec>  	
+  </target>	
+
+	<exec executable="dot">			    				
+		<arg value="zx_metares/refs.dot" />
+		<arg value="-ozx_metares/refs.png"/>
+		<arg value="-Tpng"/>    
+	</exec>
+
+	<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
+	
+
+</project>
+
Index: SMC4LRT/chapters/userdocs_cleaned.tex
===================================================================
--- SMC4LRT/chapters/userdocs_cleaned.tex	(revision 3666)
+++ SMC4LRT/chapters/userdocs_cleaned.tex	(revision 3666)
@@ -0,0 +1,291 @@
+
+Explore the \DUroletitlereference{Component Metadata Framework}
+
+In \emph{CMD}, metadata schemas are defined by profiles, that are constructed out of reusable components  - collections
+of metadata fields. The components can contain other components, and they can be reused in multiple profiles.
+Furthermore, every CMD element (metadata field) refers via a PID to a data category to indicate unambiguously how the content of the field in a metadata description should
+be interpreted (Broeder et al., 2010).
+
+Thus, every profile can be expressed as a tree, with the profile component as the root node, the used components as intermediate nodes
+and elements or data categories as leaf nodes, parent-child relationship being defined by the inclusion (\texttt{componentA -includes-> componentB}) or referencing (\texttt{elementA -refersTo-> datcat1}).The reuse of components in multiple profiles and especially also the referencing of the same data categories in multiple CMD elements leads to a blending of the individual profile trees into a graph (acyclic directed, but not necessarily connected).
+
+SMC Browser visualizes this graph structure in an interactive fashion. You can have a look at the \href{examples.html}{examples} for inspiration.
+
+It is implemented on top of wonderful js-library \href{https://github.com/mbostock/d3}{d3}, the code checked in \href{https://svn.clarin.eu/SMC/trunk/SMC}{clarin-svn} (and needs refactoring). More technical documentation follows soon.
+
+
+\subsection{Data%
+  \label{data}%
+}
+
+The graph is constructed from all profiles defined in the \href{http://catalog.clarin.eu/ds/ComponentRegistry/\#}{Component Registry}.
+To resolve name and description of data categories referenced in the CMD elements
+definitions of all (public) data categories from \href{http://dublincore.org}{DublinCore} and \href{http://www.isocat.org}{ISOcat} (from the \href{http://www.isocat.org/rest/profile/5.rdf}{Metadata Profile} {[}RDF{]} - retrieving takes some time!) are fetched. However only data categories used in CMD will get part of the graph. Here is a \href{smc_stats.html}{quantitative summary} of the dataset.
+
+When inspecting the numbers, it is important to be aware of the occurrence expansion resulting from the reusability of the components.
+So in an example, a component C has 2 subcomponents and is reused within one profile by two other components A and B, the resulting profile
+will consist of (at least) 8 components (\texttt{{[}A, B, A/C, B/C, A/C/C1, A/C/C2, B/C/C1, B/C/C2{]}}), although only 5 distinct components are used.
+The same goes for elements in reused components. In most cases it is indicated in the label, if the number reflect distinct items, or all (expanded) occurrences.
+
+(Some of the) numbers in the statistics lead to a list of corresponding terms.
+E.g. in the summary for a profile, clicking on the components-number lists all the components of given profile alphabetically.
+Currently there are such lists for:
+%
+\begin{quote}
+%
+\begin{itemize}
+
+\item \texttt{profile -> components}
+
+\item \texttt{profile -> elements}
+
+\item \texttt{profile -> data categories}
+
+\item \texttt{data category -> profiles}
+
+\end{itemize}
+
+\end{quote}
+
+
+\subsection{User Interface%
+  \label{user-interface}%
+}
+
+The User interface is divided into 4 main parts:
+%
+\begin{description}
+\item[{Index}] \leavevmode 
+Lists all available Profiles, Components, Elements and used Data Categories
+The lists can be filtered (enter search pattern in the input box at the top of the index-pane)
+By clicking on individual items, they are added to the \DUroletitlereference{selected nodes} and get rendered in the graph pane
+
+\item[{Main (Graph)}] \leavevmode 
+Pane for rendering the graph.
+
+\item[{Navigation}] \leavevmode 
+This is the control panel governing the rendering of the graph. See below for available \hyperref[options]{Options}.
+
+\item[{Detail}] \leavevmode 
+In this pane, overall summary of the data is displayed by default,
+but mainly the detail information about the selected nodes is listed here.
+
+\end{description}
+
+
+\subsection{Interaction%
+  \label{interaction}%
+}
+
+Following data sets are distinguished wrt user interaction:
+%
+\begin{description}
+\item[{all data}] \leavevmode 
+the full graph with all profiles, components, elements and data categories and links between them.
+
+Currently this amounts to roughly 2.000 nodes and 3.000 links
+
+\item[{selected nodes}] \leavevmode 
+nodes explicitely selected by the user (see below how to \hyperref[select-nodes]{select nodes})
+
+\item[{data to show}] \leavevmode 
+the subset of data that shall be displayed.
+
+Starting from the selected nodes, connected nodes (and connecting edges)
+are determined  based on the options (\texttt{depth-before}, \texttt{depth-after}).
+
+\end{description}
+
+The nodes are colour-coded by type:
+
+\includegraphics[height=100px]{C:/Users/m/3/clarin/_repo/SMC/docs/graph_legend.svg}
+
+\phantomsection\label{select-nodes}
+There are multiple ways to select/unselect nodes:
+%
+\begin{description}
+\item[{select from index}] \leavevmode 
+by clicking individual items in the index list, the item will be \textbf{added} to the selected nodes
+
+clicking on an already selected item unselects it
+
+\item[{select in graph}] \leavevmode 
+by clicking on a visible node in the graph, the node will be \textbf{added} to the selected nodes
+
+clicking on an already selected node unselects it
+
+\item[{select area in graph}] \leavevmode 
+by dragging (hold mouse button down and pull) a rectangle in the graph pane, all nodes within that rectangle get selected
+all other nodes will be unselected
+
+\item[{unselect in detail pane}] \leavevmode 
+clicking on an item in the detail pane unselects it
+
+\item[{select in statistics}] \leavevmode 
+as mentioned in \hyperref[data]{Data} (some) numbers in the statistics reveal a list of corresponding terms.
+Clicking on these terms in the statistics page leads to the browser, with given term as selected node (and default settings)
+
+\item[{select in statistics in the detail pane}] \leavevmode 
+the numbers from statistics page are shown also in the detail pane for selected nodes.
+Here, clicking on a term from these lists adds it to the graph, as a selected node.
+
+\item[{mouseover}] \leavevmode 
+on mouse over a node, all connected nodes to given node (and connecting links) within the visible sub-graph are highlighted
+and all other nodes and links are faded
+
+\item[{drag a node}] \leavevmode 
+click and hold on a node, one can move the node around, however usually the layout is stronger
+and puts the node back to its original position. Not so with the freeze-layout, that freezes all the nodes and lets you move them around freely
+
+\end{description}
+
+
+\subsection{Options%
+  \label{options}%
+}
+
+The navigation pane provides following option to control the rendering of the graph:
+%
+\begin{description}
+\item[{depth-before}] \leavevmode 
+how many levels of connected ancestor nodes shall be displayed
+
+\item[{depth-after}] \leavevmode 
+how many levels of connected descendant nodes shall be displayed
+
+\item[{link-distance}] \leavevmode 
+approximate distance between individual nodes
+(not exact, because it is just one of multiple factor for the layouting of the graph)
+
+\item[{charge}] \leavevmode 
+the higher the charge, the more the nodes tend to drift apart
+
+\item[{friction}] \leavevmode 
+factor for ``cooling down'' the layout, lower numbers (50-70) stabilize the graph more quickly,
+but it may be too early, with higher numbers (95-100) the layout has more time/freedom to arrange,
+but may get jittery
+
+\item[{node-size}] \leavevmode 
+N = all nodes have given diameter N;
+
+usage = node is scaled based on how often the node appears in the complete dataset
+i.e. often reused elements (like description or language) will be bigger
+
+\item[{labels}] \leavevmode 
+show/hide all labels
+hiding the labels accelerates the rendering significantly, which may be an issue if more nodes are displayed.
+irrespective of this option, on mouseover labels for all and only the highlighted nodes are displayed
+
+\item[{curve}] \leavevmode 
+straight or arc (better visibility)
+
+\item[{layout}] \leavevmode 
+There are a few layouting algorithms provided. They are all not optimal in any way, but most of the time, they deliver quite good results.
+For different data displayed other algorithm may be more appropriate:
+%
+\begin{description}
+\item[{force}] \leavevmode 
+undirected layout, trying to spread the nodes in the pane optimally, equally in all directions
+This is the underlying \href{https://github.com/mbostock/d3/wiki/Force-Layout}{layouting algorithm}. All the other layouts build on top of it, by just adding further constraints.
+
+\item[{vertical-tree}] \leavevmode 
+top-down layout respect the direction of the edges, children are always below the parents
+
+\item[{horizontal-tree}] \leavevmode 
+left-right layout respect the direction of the edges, children are always right to the parents
+(at least they should be, currently, in certain configurations, the layout does not get the orientation for some links right)
+
+\item[{weak-tree}] \leavevmode 
+a layout that ``tends'' towards left to right arrangement, but not strictly so (experimental)
+
+\item[{dot}] \leavevmode 
+strict left to right reusing the x-positioning as determined by \href{http://www.graphviz.org/}{dot}
+Arranges the nodes in strict ranks (typical for dot layout)
+This is done in a separate preprocessing step for the whole graph, so the positioning may be suboptimal
+for a given subgraph. The y-coordinate is approximated on the fly by the base algorithm.
+
+\item[{freeze}] \leavevmode 
+this is actually a ``no-layout'' - the nodes just stay fixed in their last position,
+However, individual nodes still can be dragged around, so this can be used to adjust a few nodes for better legibility (or aesthetics),
+but only when you start moving around inividual nodes, you will learn to appreciate the great (and tedious) work of the layouting algorithms,
+so generally you want to try to play around with the other settings to achieve a satisfying result.
+
+\end{description}
+
+\end{description}
+
+
+\subsection{Linking, Export%
+  \label{linking-export}%
+}
+
+The navigation pane exposes a \textbf{link}, that captures the exact current state of the interface
+(just the options and the selection, not the positioning of the elements),
+so that it can be bookmarked, emailed etc.
+
+Furthermore, there is the \textbf{download}, that allows to export the current graph as SVG.
+This is accomplished without a round trip to the server, with a \href{https://groups.google.com/forum/?fromgroups=\#!topic/d3-js/aQSWnEDFxIc}{javascript trick}
+serializing the svg as base64-data into the url (so you don't want to save (or see) the exported url).
+But you can both, right click the link and {[}Save link as...{]}, or click on the link, which opens the SVG in a new tab
+where you can view, resize, print and save it.
+Employing this simple method also means, that there is no possibility to export the graph in PNG, PDF or any other format,
+because this would require \href{http://d3export.cancan.cshl.edu/}{server-side processing}. (However this is a planned future enhancement.)
+
+
+\subsection{Issues%
+  \label{issues}%
+}
+%
+\begin{description}
+\item[{Performance}] \leavevmode 
+Chrome is by far the fastest, followed by IE(9).
+A serious performance degradation was observed for graphs above 200 nodes on Firefox.
+Showing labels also significantly affects performance.
+
+\item[{Bounds}] \leavevmode 
+When the graph gets to big, it does not fit in the viewing pane.
+This will be tackled soon (either scrollbars or applying boundaries). Meanwhile,
+you can reduce the link-distance and charge parameters or change the layout.
+
+\end{description}
+
+
+\subsection{Plans and ToDos%
+  \label{plans-and-todos}%
+}
+
+Substantial issues:
+%
+\begin{itemize}
+
+\item Add information from \textbf{RelationRegistry} (relations between DatCats)
+
+\item Blend in instance data from \textbf{MDRepository} (allow search on MDRepository)
+
+\item graph operations (intersect, difference of subrgraphs)
+
+\end{itemize}
+
+Smaller enhancements of the user interface:
+%
+\begin{itemize}
+
+\item select nodes by querying the names (e.g. show me all nodes with ``Access'' in their name)
+
+\item option to show only selected types of nodes (e.g. only profiles and datcats)
+
+\item detail-info on hover
+
+\item full HTML-rendering of a node (Profile, Component)
+
+\item backlinking from detail (e.g. view all the profiles a data category is used in by clicking on the number ('used in profiles')
+
+\item store/export SVG/PDF/PNG-renderings of the graphs
+
+\item add edge-weight: scale based on usage, i.e. how often appears the relation in the complete dataset
+i.e. often reused combinations of components/elements will be nearer
+
+\item allow to blend in further (private) CMD-profiles dynamically
+
+\end{itemize}
+
Index: SMC4LRT/frontmatter.tex
===================================================================
--- SMC4LRT/frontmatter.tex	(revision 3666)
+++ SMC4LRT/frontmatter.tex	(revision 3666)
@@ -0,0 +1,67 @@
+
+\captionnamefont{\bfseries}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%   FRONTMATTER    %%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\frontmatter
+\pagenumbering{roman}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%   TITLEPAGES    %%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% the german title page is required as first page
+\include{titlepage}
+
+% an english translation may follow
+\include{titlepage_en} % optional
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%   ERKLAERUNG DER SELBSTAENDIGKEIT   %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\cleardoublepage
+\selectlanguage{ngerman}
+\input{chapters/erklaerung}
+\selectlanguage{english}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%   ACKNOWLEDGEMENTS    %%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% optional acknowledgements may be included in german or in english
+%\input{chapters/danksagung} 		% optional
+\input{chapters/acknowledgements}	% optional
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%   ABSTARCT    %%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input{chapters/abstract_en}
+\cleardoublepage
+\selectlanguage{ngerman}
+\input{chapters/abstract_de}
+\selectlanguage{english}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%   CONTENTS    %%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% uncomment to set document language to german (results in "Inhaltsverzeichnis", "Kapitel", "Abbildung", etc. instead of "Contents", "Chapter", and "Figure"), otherwise the document's language is english
+%\selectlanguage{ngerman}
+
+%\setcounter{tocdepth}{2}
+
+\cleardoublepage
+\pagestyle{numberCorner}
+\tableofcontents*
+\cleardoublepage
+\listoffigures
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%   MAINMATTER    %%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\mainmatter
+\pagenumbering{arabic}
+\pagestyle{numberCorner}
Index: SMC4LRT/geometry.sty
===================================================================
--- SMC4LRT/geometry.sty	(revision 3666)
+++ SMC4LRT/geometry.sty	(revision 3666)
@@ -0,0 +1,1112 @@
+%%
+%% This is file `geometry.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% geometry.dtx  (with options: `package')
+%% 
+%% Copyright (C) 1996-2010
+%% by Hideo Umeki <latexgeometry@gmail.com>
+%% 
+%% This work may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.3c of this license
+%% or (at your option) any later version. The latest version of this
+%% license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%% 
+%% This work is "maintained" (as per the LPPL maintenance status)
+%% by Hideo Umeki.
+%% 
+%% This work consists of the files geometry.dtx and
+%% the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
+%% 
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{geometry}
+  [2010/03/13 v5.3 Page Geometry]
+\RequirePackage{keyval}%
+\RequirePackage{ifpdf}%
+\RequirePackage{ifvtex}%
+\newif\ifGm@verbose
+\newif\ifGm@landscape
+\newif\ifGm@swap@papersize\Gm@swap@papersizefalse
+\newif\ifGm@includehead
+\newif\ifGm@includefoot
+\newif\ifGm@includemp
+\newif\ifGm@hbody
+\newif\ifGm@vbody
+\newif\ifGm@heightrounded
+\newif\ifGm@showframe
+\newif\ifGm@showcrop
+\newif\ifGm@pass\Gm@passfalse
+\newif\ifGm@resetpaper
+\newif\ifGm@layout
+\newif\ifGm@newgm
+\newcount\Gm@cnth
+\newcount\Gm@cntv
+\newcount\c@Gm@tempcnt
+\newdimen\Gm@bindingoffset
+\newdimen\Gm@wd@mp
+\newdimen\Gm@odd@mp
+\newdimen\Gm@even@mp
+\newdimen\Gm@layoutwidth
+\newdimen\Gm@layoutheight
+\newdimen\Gm@layouthoffset
+\newdimen\Gm@layoutvoffset
+\newtoks\Gm@dimlist
+\def\Gm@warning#1{\PackageWarningNoLine{geometry}{#1}}%
+\def\ifGm@preamble#1{%
+  \ifGm@newgm
+   \Gm@warning{`#1': not available in `\string\newgeometry'; skipped}%
+  \else
+    \expandafter\@firstofone
+  \fi}%
+\def\Gm@Dhratio{1:1}% = left:right default for oneside
+\def\Gm@Dhratiotwo{2:3}% = inner:outer default for twoside.
+\def\Gm@Dvratio{2:3}% = top:bottom default
+\def\Gm@Dhscale{0.7}%
+\def\Gm@Dvscale{0.7}%
+\def\Gm@dvips{dvips}%
+\def\Gm@dvipdfm{dvipdfm}%
+\def\Gm@pdftex{pdftex}%
+\def\Gm@xetex{xetex}%
+\def\Gm@vtex{vtex}%
+\def\Gm@true{true}%
+\def\Gm@false{false}%
+\edef\Gm@orgpw{\the\paperwidth}%
+\edef\Gm@orgph{\the\paperheight}%
+\def\Gm@savelength#1{%
+  \g@addto@macro\Gm@restore{\expandafter\noexpand\expandafter\csname
+  #1\endcsname\expandafter=\expandafter\the\csname #1\endcsname\relax}}
+\def\Gm@saveboolean#1{%
+  \csname if#1\endcsname
+    \g@addto@macro\Gm@restore{\expandafter\noexpand\csname #1true\endcsname}%
+  \else
+    \g@addto@macro\Gm@restore{\expandafter\noexpand\csname #1false\endcsname}%
+  \fi}%
+\def\Gm@restore{}%
+\def\Gm@save{%
+  \Gm@savelength{paperwidth}%
+  \Gm@savelength{paperheight}%
+  \Gm@savelength{textwidth}%
+  \Gm@savelength{textheight}%
+  \Gm@savelength{evensidemargin}%
+  \Gm@savelength{oddsidemargin}%
+  \Gm@savelength{topmargin}%
+  \Gm@savelength{headheight}%
+  \Gm@savelength{headsep}%
+  \Gm@savelength{topskip}%
+  \Gm@savelength{footskip}%
+  \Gm@savelength{baselineskip}%
+  \Gm@savelength{marginparwidth}%
+  \Gm@savelength{marginparsep}%
+  \Gm@savelength{columnsep}%
+  \Gm@savelength{hoffset}%
+  \Gm@savelength{voffset}
+  \Gm@savelength{Gm@layouthoffset}%
+  \Gm@savelength{Gm@layoutvoffset}%
+  \Gm@saveboolean{@twocolumn}%
+  \Gm@saveboolean{@twoside}%
+  \Gm@saveboolean{@mparswitch}%
+  \Gm@saveboolean{@reversemargin}}%
+\def\Gm@initnewgm{%
+  \Gm@dimlist={}
+  \Gm@hbodyfalse
+  \Gm@vbodyfalse
+  \Gm@heightroundedfalse
+  \Gm@includeheadfalse
+  \Gm@includefootfalse
+  \Gm@includempfalse
+  \let\Gm@width\@undefined
+  \let\Gm@height\@undefined
+  \let\Gm@textwidth\@undefined
+  \let\Gm@textheight\@undefined
+  \let\Gm@lines\@undefined
+  \let\Gm@hscale\@undefined
+  \let\Gm@vscale\@undefined
+  \let\Gm@hmarginratio\@undefined
+  \let\Gm@vmarginratio\@undefined
+  \let\Gm@lmargin\@undefined
+  \let\Gm@rmargin\@undefined
+  \let\Gm@tmargin\@undefined
+  \let\Gm@bmargin\@undefined
+  \Gm@layoutfalse
+  \Gm@layouthoffset\z@
+  \Gm@layoutvoffset\z@
+  \Gm@bindingoffset\z@}%
+\def\Gm@initall{%
+  \let\Gm@driver\@empty
+  \let\Gm@truedimen\@empty
+  \let\Gm@paper\@undefined
+  \Gm@resetpaperfalse
+  \Gm@landscapefalse
+  \Gm@verbosefalse
+  \Gm@showframefalse
+  \Gm@showcropfalse
+  \Gm@newgmfalse
+  \Gm@initnewgm}%
+\def\Gm@setdriver#1{%
+  \expandafter\let\expandafter\Gm@driver\csname Gm@#1\endcsname}%
+\def\Gm@unsetdriver#1{%
+  \expandafter\ifx\csname Gm@#1\endcsname\Gm@driver\let\Gm@driver\@empty\fi}%
+\def\Gm@setbool{\@dblarg\Gm@@setbool}%
+\def\Gm@setboolrev{\@dblarg\Gm@@setboolrev}%
+\def\Gm@@setbool[#1]#2#3{\Gm@doif{#1}{#3}{\csname Gm@#2\Gm@bool\endcsname}}%
+\def\Gm@@setboolrev[#1]#2#3{\Gm@doifelse{#1}{#3}%
+  {\csname Gm@#2\Gm@false\endcsname}{\csname Gm@#2\Gm@true\endcsname}}%
+\def\Gm@doif#1#2#3{%
+  \lowercase{\def\Gm@bool{#2}}%
+  \ifx\Gm@bool\@empty
+    \let\Gm@bool\Gm@true
+  \fi
+  \ifx\Gm@bool\Gm@true
+  \else
+    \ifx\Gm@bool\Gm@false
+    \else
+      \let\Gm@bool\relax
+    \fi
+  \fi
+  \ifx\Gm@bool\relax
+    \Gm@warning{`#1' should be set to `true' or `false'}%
+  \else
+    #3
+  \fi}%
+\def\Gm@doifelse#1#2#3#4{%
+  \Gm@doif{#1}{#2}{\ifx\Gm@bool\Gm@true #3\else #4\fi}}%
+\def\Gm@reverse#1{%
+  \csname ifGm@#1\endcsname
+  \csname Gm@#1false\endcsname\else\csname Gm@#1true\endcsname\fi}%
+\def\Gm@defbylen#1#2{%
+  \setlength\@tempdima{#2}%
+  \expandafter\edef\csname Gm@#1\endcsname{\the\@tempdima}}%
+\def\Gm@defbycnt#1#2{%
+  \setcounter{Gm@tempcnt}{#2}%
+  \expandafter\edef\csname Gm@#1\endcsname{\the\value{Gm@tempcnt}}}%
+\def\Gm@sep@ratio#1:#2{\@tempcnta=#1\@tempcntb=#2}%
+\def\Gm@setbyratio[#1]#2#3#4{% determine #4 by ratio
+  \expandafter\Gm@sep@ratio\Gm@mratio\relax
+  \if#1b
+    \edef\@@tempa{\the\@tempcnta}%
+    \@tempcnta=\@tempcntb
+    \@tempcntb=\@@tempa\relax
+  \fi
+  \expandafter\setlength\expandafter\@tempdimb\expandafter
+    {\csname Gm@#3\endcsname}%
+  \ifnum\@tempcntb>\z@
+    \multiply\@tempdimb\@tempcnta
+    \divide\@tempdimb\@tempcntb
+  \fi
+  \expandafter\edef\csname Gm@#4\endcsname{\the\@tempdimb}}%
+\def\Gm@detiv#1#2#3#4{% determine #4.
+  \expandafter\setlength\expandafter\@tempdima\expandafter
+    {\csname Gm@layout#1\endcsname}%
+  \expandafter\setlength\expandafter\@tempdimb\expandafter
+    {\csname Gm@#2\endcsname}%
+  \addtolength\@tempdima{-\@tempdimb}%
+  \expandafter\setlength\expandafter\@tempdimb\expandafter
+    {\csname Gm@#3\endcsname}%
+  \addtolength\@tempdima{-\@tempdimb}%
+  \ifdim\@tempdima<\z@
+    \Gm@warning{`#4' results in NEGATIVE (\the\@tempdima).%
+    ^^J\@spaces `#2' or `#3' should be shortened in length}%
+  \fi
+  \expandafter\edef\csname Gm@#4\endcsname{\the\@tempdima}}%
+\def\Gm@detiiandiii#1#2#3{% determine #2 and #3.
+  \expandafter\setlength\expandafter\@tempdima\expandafter
+    {\csname Gm@layout#1\endcsname}%
+  \expandafter\setlength\expandafter\@tempdimb\expandafter
+    {\csname Gm@#1\endcsname}%
+  \addtolength\@tempdima{-\@tempdimb}%
+  \ifdim\@tempdima<\z@
+    \Gm@warning{`#2' and `#3' result in NEGATIVE (\the\@tempdima).%
+                  ^^J\@spaces `#1' should be shortened in length}%
+  \fi
+  \ifx\Gm@mratio\@undefined
+    \expandafter\Gm@sep@ratio\Gm@Dmratio\relax
+  \else
+    \expandafter\Gm@sep@ratio\Gm@mratio\relax
+    \ifnum\@tempcntb>\z@\else
+      \Gm@warning{margin ratio a:b should be non-zero; default used}%
+      \expandafter\Gm@sep@ratio\Gm@Dmratio\relax
+    \fi
+  \fi
+  \@tempdimb=\@tempdima
+  \advance\@tempcntb\@tempcnta
+  \divide\@tempdima\@tempcntb
+  \multiply\@tempdima\@tempcnta
+  \advance\@tempdimb-\@tempdima
+  \expandafter\edef\csname Gm@#2\endcsname{\the\@tempdima}%
+  \expandafter\edef\csname Gm@#3\endcsname{\the\@tempdimb}}%
+\def\Gm@detall#1#2#3#4{%
+  \@tempcnta\z@
+  \if#1h
+    \let\Gm@mratio\Gm@hmarginratio
+    \edef\Gm@Dmratio{\if@twoside\Gm@Dhratiotwo\else\Gm@Dhratio\fi}%
+  \else
+    \let\Gm@mratio\Gm@vmarginratio
+    \edef\Gm@Dmratio{\Gm@Dvratio}%
+  \fi
+  \if#1h
+    \ifx\Gm@lmargin\@undefined\else\advance\@tempcnta4\relax\fi
+    \ifGm@hbody\advance\@tempcnta2\relax\fi
+    \ifx\Gm@rmargin\@undefined\else\advance\@tempcnta1\relax\fi
+    \Gm@cnth\@tempcnta
+  \else
+    \ifx\Gm@tmargin\@undefined\else\advance\@tempcnta4\relax\fi
+    \ifGm@vbody\advance\@tempcnta2\relax\fi
+    \ifx\Gm@bmargin\@undefined\else\advance\@tempcnta1\relax\fi
+    \Gm@cntv\@tempcnta
+  \fi
+  \ifcase\@tempcnta
+    \if#1h
+      \edef\Gm@width{\Gm@Dhscale\Gm@layoutwidth}%
+    \else
+      \edef\Gm@height{\Gm@Dvscale\Gm@layoutheight}%
+    \fi
+    \Gm@detiiandiii{#2}{#3}{#4}%
+  \or
+    \ifx\Gm@mratio\@undefined
+      \if#1h
+        \edef\Gm@width{\Gm@Dhscale\Gm@layoutwidth}%
+      \else
+        \edef\Gm@height{\Gm@Dvscale\Gm@layoutheight}%
+      \fi
+      \setlength\@tempdimc{\@nameuse{Gm@#4}}%
+      \Gm@detiiandiii{#2}{#3}{#4}%
+      \expandafter\let\csname Gm@#2\endcsname\@undefined
+      \expandafter\edef\csname Gm@#4\endcsname{\the\@tempdimc}%
+    \else
+      \Gm@setbyratio[f]{#1}{#4}{#3}%
+    \fi
+    \Gm@detiv{#2}{#3}{#4}{#2}%
+  \or\Gm@detiiandiii{#2}{#3}{#4}%
+  \or\Gm@detiv{#2}{#2}{#4}{#3}%
+  \or
+    \ifx\Gm@mratio\@undefined
+      \if#1h
+        \edef\Gm@width{\Gm@Dhscale\Gm@layoutwidth}%
+      \else
+        \edef\Gm@height{\Gm@Dvscale\Gm@layoutheight}%
+      \fi
+      \setlength\@tempdimc{\@nameuse{Gm@#3}}%
+      \Gm@detiiandiii{#2}{#4}{#3}%
+      \expandafter\let\csname Gm@#2\endcsname\@undefined
+      \expandafter\edef\csname Gm@#3\endcsname{\the\@tempdimc}%
+    \else
+      \Gm@setbyratio[b]{#1}{#3}{#4}%
+    \fi
+    \Gm@detiv{#2}{#3}{#4}{#2}%
+  \or\Gm@detiv{#2}{#3}{#4}{#2}%
+  \or\Gm@detiv{#2}{#2}{#3}{#4}%
+  \or\Gm@warning{Over-specification in `#1'-direction.%
+                  ^^J\@spaces `#2' (\@nameuse{Gm@#2}) is ignored}%
+    \Gm@detiv{#2}{#3}{#4}{#2}%
+  \else\fi}%
+\def\Gm@clean{%
+  \ifnum\Gm@cnth<4\let\Gm@lmargin\@undefined\fi
+  \ifodd\Gm@cnth\else\let\Gm@rmargin\@undefined\fi
+  \ifnum\Gm@cntv<4\let\Gm@tmargin\@undefined\fi
+  \ifodd\Gm@cntv\else\let\Gm@bmargin\@undefined\fi
+  \ifGm@hbody\else
+    \let\Gm@hscale\@undefined
+    \let\Gm@width\@undefined
+    \let\Gm@textwidth\@undefined
+  \fi
+  \ifGm@vbody\else
+    \let\Gm@vscale\@undefined
+    \let\Gm@height\@undefined
+    \let\Gm@textheight\@undefined
+  \fi
+  }%
+\def\Gm@parse@divide#1#2#3#4{%
+  \def\Gm@star{*}%
+  \@tempcnta\z@
+  \@for\Gm@tmp:=#1\do{%
+    \expandafter\KV@@sp@def\expandafter\Gm@frag\expandafter{\Gm@tmp}%
+    \edef\Gm@value{\Gm@frag}%
+    \ifcase\@tempcnta\relax\edef\Gm@key{#2}%
+      \or\edef\Gm@key{#3}%
+      \else\edef\Gm@key{#4}%
+    \fi
+    \@nameuse{Gm@set\Gm@key false}%
+    \ifx\empty\Gm@value\else
+    \ifx\Gm@star\Gm@value\else
+      \setkeys{Gm}{\Gm@key=\Gm@value}%
+    \fi\fi
+    \advance\@tempcnta\@ne}%
+  \let\Gm@star\relax}%
+\def\Gm@branch#1#2#3{%
+  \@tempcnta\z@
+  \@for\Gm@tmp:=#1\do{%
+    \KV@@sp@def\Gm@frag{\Gm@tmp}%
+    \edef\Gm@value{\Gm@frag}%
+    \ifcase\@tempcnta\relax% cnta == 0
+      \setkeys{Gm}{#2=\Gm@value}%
+    \or% cnta == 1
+      \setkeys{Gm}{#3=\Gm@value}%
+    \else\fi
+    \advance\@tempcnta\@ne}%
+  \ifnum\@tempcnta=\@ne
+    \setkeys{Gm}{#3=\Gm@value}%
+  \fi}%
+\def\Gm@magtooffset{%
+  \@tempdima=\mag\Gm@truedimen sp%
+  \@tempdimb=1\Gm@truedimen in%
+  \divide\@tempdimb\@tempdima
+  \multiply\@tempdimb\@m
+  \addtolength{\hoffset}{1\Gm@truedimen in}%
+  \addtolength{\voffset}{1\Gm@truedimen in}%
+  \addtolength{\hoffset}{-\the\@tempdimb}%
+  \addtolength{\voffset}{-\the\@tempdimb}}%
+\def\Gm@setlength#1#2{%
+  \let\Gm@len=\relax\let\Gm@td=\relax
+  \edef\addtolist{\noexpand\Gm@dimlist=%
+  {\the\Gm@dimlist \Gm@len{#1}{#2}}}\addtolist}%
+\def\Gm@expandlengths{%
+  \def\Gm@td{\Gm@truedimen}%
+  \def\Gm@len##1##2{\setlength{##1}{##2}}%
+  \the\Gm@dimlist}%
+\def\Gm@setsize#1(#2,#3)#4{%
+  \let\Gm@td\relax
+  \expandafter\Gm@setlength\csname #1width\endcsname{#2\Gm@td #4}%
+  \expandafter\Gm@setlength\csname #1height\endcsname{#3\Gm@td #4}%
+  \ifGm@landscape\Gm@swap@papersizetrue\else\Gm@swap@papersizefalse\fi}%
+\def\Gm@setpaper@ifpre#1{%
+  \ifGm@preamble{#1}{\def\Gm@paper{#1}\@nameuse{Gm@#1}{paper}}}%
+\@namedef{Gm@a0paper}#1{\Gm@setsize{#1}(841,1189){mm}}% ISO A0
+\@namedef{Gm@a1paper}#1{\Gm@setsize{#1}(594,841){mm}}% ISO A1
+\@namedef{Gm@a2paper}#1{\Gm@setsize{#1}(420,594){mm}}% ISO A2
+\@namedef{Gm@a3paper}#1{\Gm@setsize{#1}(297,420){mm}}% ISO A3
+\@namedef{Gm@a4paper}#1{\Gm@setsize{#1}(210,297){mm}}% ISO A4
+\@namedef{Gm@a5paper}#1{\Gm@setsize{#1}(148,210){mm}}% ISO A5
+\@namedef{Gm@a6paper}#1{\Gm@setsize{#1}(105,148){mm}}% ISO A6
+\@namedef{Gm@b0paper}#1{\Gm@setsize{#1}(1000,1414){mm}}% ISO B0
+\@namedef{Gm@b1paper}#1{\Gm@setsize{#1}(707,1000){mm}}% ISO B1
+\@namedef{Gm@b2paper}#1{\Gm@setsize{#1}(500,707){mm}}% ISO B2
+\@namedef{Gm@b3paper}#1{\Gm@setsize{#1}(353,500){mm}}% ISO B3
+\@namedef{Gm@b4paper}#1{\Gm@setsize{#1}(250,353){mm}}% ISO B4
+\@namedef{Gm@b5paper}#1{\Gm@setsize{#1}(176,250){mm}}% ISO B5
+\@namedef{Gm@b6paper}#1{\Gm@setsize{#1}(125,176){mm}}% ISO B6
+\@namedef{Gm@b0j}#1{\Gm@setsize{#1}(1030,1456){mm}}% JIS B0
+\@namedef{Gm@b1j}#1{\Gm@setsize{#1}(728,1030){mm}}% JIS B1
+\@namedef{Gm@b2j}#1{\Gm@setsize{#1}(515,728){mm}}% JIS B2
+\@namedef{Gm@b3j}#1{\Gm@setsize{#1}(364,515){mm}}% JIS B3
+\@namedef{Gm@b4j}#1{\Gm@setsize{#1}(257,364){mm}}% JIS B4
+\@namedef{Gm@b5j}#1{\Gm@setsize{#1}(182,257){mm}}% JIS B5
+\@namedef{Gm@b6j}#1{\Gm@setsize{#1}(128,182){mm}}% JIS B6
+\@namedef{Gm@ansiapaper}#1{\Gm@setsize{#1}(8.5,11){in}}%
+\@namedef{Gm@ansibpaper}#1{\Gm@setsize{#1}(11,17){in}}%
+\@namedef{Gm@ansicpaper}#1{\Gm@setsize{#1}(17,22){in}}%
+\@namedef{Gm@ansidpaper}#1{\Gm@setsize{#1}(22,34){in}}%
+\@namedef{Gm@ansiepaper}#1{\Gm@setsize{#1}(34,44){in}}%
+\@namedef{Gm@letterpaper}#1{\Gm@setsize{#1}(8.5,11){in}}%
+\@namedef{Gm@legalpaper}#1{\Gm@setsize{#1}(8.5,14){in}}%
+\@namedef{Gm@executivepaper}#1{\Gm@setsize{#1}(7.25,10.5){in}}%
+\@namedef{Gm@screen}#1{\Gm@setsize{#1}(225,180){mm}}%
+\define@key{Gm}{paper}{\setkeys{Gm}{#1}}%
+\let\KV@Gm@papername\KV@Gm@paper
+\define@key{Gm}{a0paper}[true]{\Gm@setpaper@ifpre{a0paper}}%
+\define@key{Gm}{a1paper}[true]{\Gm@setpaper@ifpre{a1paper}}%
+\define@key{Gm}{a2paper}[true]{\Gm@setpaper@ifpre{a2paper}}%
+\define@key{Gm}{a3paper}[true]{\Gm@setpaper@ifpre{a3paper}}%
+\define@key{Gm}{a4paper}[true]{\Gm@setpaper@ifpre{a4paper}}%
+\define@key{Gm}{a5paper}[true]{\Gm@setpaper@ifpre{a5paper}}%
+\define@key{Gm}{a6paper}[true]{\Gm@setpaper@ifpre{a6paper}}%
+\define@key{Gm}{b0paper}[true]{\Gm@setpaper@ifpre{b0paper}}%
+\define@key{Gm}{b1paper}[true]{\Gm@setpaper@ifpre{b1paper}}%
+\define@key{Gm}{b2paper}[true]{\Gm@setpaper@ifpre{b2paper}}%
+\define@key{Gm}{b3paper}[true]{\Gm@setpaper@ifpre{b3paper}}%
+\define@key{Gm}{b4paper}[true]{\Gm@setpaper@ifpre{b4paper}}%
+\define@key{Gm}{b5paper}[true]{\Gm@setpaper@ifpre{b5paper}}%
+\define@key{Gm}{b6paper}[true]{\Gm@setpaper@ifpre{b6paper}}%
+\define@key{Gm}{b0j}[true]{\Gm@setpaper@ifpre{b0j}}%
+\define@key{Gm}{b1j}[true]{\Gm@setpaper@ifpre{b1j}}%
+\define@key{Gm}{b2j}[true]{\Gm@setpaper@ifpre{b2j}}%
+\define@key{Gm}{b3j}[true]{\Gm@setpaper@ifpre{b3j}}%
+\define@key{Gm}{b4j}[true]{\Gm@setpaper@ifpre{b4j}}%
+\define@key{Gm}{b5j}[true]{\Gm@setpaper@ifpre{b5j}}%
+\define@key{Gm}{b6j}[true]{\Gm@setpaper@ifpre{b6j}}%
+\define@key{Gm}{ansiapaper}[true]{\Gm@setpaper@ifpre{ansiapaper}}%
+\define@key{Gm}{ansibpaper}[true]{\Gm@setpaper@ifpre{ansibpaper}}%
+\define@key{Gm}{ansicpaper}[true]{\Gm@setpaper@ifpre{ansicpaper}}%
+\define@key{Gm}{ansidpaper}[true]{\Gm@setpaper@ifpre{ansidpaper}}%
+\define@key{Gm}{ansiepaper}[true]{\Gm@setpaper@ifpre{ansiepaper}}%
+\define@key{Gm}{letterpaper}[true]{\Gm@setpaper@ifpre{letterpaper}}%
+\define@key{Gm}{legalpaper}[true]{\Gm@setpaper@ifpre{legalpaper}}%
+\define@key{Gm}{executivepaper}[true]{\Gm@setpaper@ifpre{executivepaper}}%
+\define@key{Gm}{screen}[true]{\Gm@setpaper@ifpre{screen}}%
+\define@key{Gm}{paperwidth}{\ifGm@preamble{paperwidth}{%
+  \Gm@setlength\paperwidth{#1}}}%
+\define@key{Gm}{paperheight}{\ifGm@preamble{paperheight}{%
+  \Gm@setlength\paperheight{#1}}}%
+\define@key{Gm}{papersize}{\ifGm@preamble{papersize}{%
+  \Gm@branch{#1}{paperwidth}{paperheight}}}%
+\define@key{Gm}{layout}{\Gm@layouttrue\@nameuse{Gm@#1}{Gm@layout}}%
+\let\KV@Gm@layoutname\KV@Gm@layout
+\define@key{Gm}{layoutwidth}{\Gm@layouttrue\Gm@setlength\Gm@layoutwidth{#1}}%
+\define@key{Gm}{layoutheight}{\Gm@layouttrue\Gm@setlength\Gm@layoutheight{#1}}%
+\define@key{Gm}{layoutsize}{\Gm@branch{#1}{layoutwidth}{layoutheight}}%
+\define@key{Gm}{landscape}[true]{\ifGm@preamble{landscape}{%
+  \Gm@doifelse{landscape}{#1}%
+  {\ifGm@landscape\else\Gm@landscapetrue\Gm@reverse{swap@papersize}\fi}%
+  {\ifGm@landscape\Gm@landscapefalse\Gm@reverse{swap@papersize}\fi}}}%
+\define@key{Gm}{portrait}[true]{\ifGm@preamble{portrait}{%
+  \Gm@doifelse{portrait}{#1}%
+  {\ifGm@landscape\Gm@landscapefalse\Gm@reverse{swap@papersize}\fi}%
+  {\ifGm@landscape\else\Gm@landscapetrue\Gm@reverse{swap@papersize}\fi}}}%
+\define@key{Gm}{hscale}{\Gm@hbodytrue\edef\Gm@hscale{#1}}%
+\define@key{Gm}{vscale}{\Gm@vbodytrue\edef\Gm@vscale{#1}}%
+\define@key{Gm}{scale}{\Gm@branch{#1}{hscale}{vscale}}%
+\define@key{Gm}{width}{\Gm@hbodytrue\Gm@defbylen{width}{#1}}%
+\define@key{Gm}{height}{\Gm@vbodytrue\Gm@defbylen{height}{#1}}%
+\define@key{Gm}{total}{\Gm@branch{#1}{width}{height}}%
+\let\KV@Gm@totalwidth\KV@Gm@width
+\let\KV@Gm@totalheight\KV@Gm@height
+\define@key{Gm}{textwidth}{\Gm@hbodytrue\Gm@defbylen{textwidth}{#1}}%
+\define@key{Gm}{textheight}{\Gm@vbodytrue\Gm@defbylen{textheight}{#1}}%
+\define@key{Gm}{text}{\Gm@branch{#1}{textwidth}{textheight}}%
+\let\KV@Gm@body\KV@Gm@text
+\define@key{Gm}{lines}{\Gm@vbodytrue\Gm@defbycnt{lines}{#1}}%
+\define@key{Gm}{includehead}[true]{\Gm@setbool{includehead}{#1}}%
+\define@key{Gm}{includefoot}[true]{\Gm@setbool{includefoot}{#1}}%
+\define@key{Gm}{includeheadfoot}[true]{\Gm@doifelse{includeheadfoot}{#1}%
+  {\Gm@includeheadtrue\Gm@includefoottrue}%
+  {\Gm@includeheadfalse\Gm@includefootfalse}}%
+\define@key{Gm}{includemp}[true]{\Gm@setbool{includemp}{#1}}%
+\define@key{Gm}{includeall}[true]{\Gm@doifelse{includeall}{#1}%
+  {\Gm@includeheadtrue\Gm@includefoottrue\Gm@includemptrue}%
+  {\Gm@includeheadfalse\Gm@includefootfalse\Gm@includempfalse}}%
+\define@key{Gm}{ignorehead}[true]{%
+  \Gm@setboolrev[ignorehead]{includehead}{#1}}%
+\define@key{Gm}{ignorefoot}[true]{%
+  \Gm@setboolrev[ignorefoot]{includefoot}{#1}}%
+\define@key{Gm}{ignoreheadfoot}[true]{\Gm@doifelse{ignoreheadfoot}{#1}%
+  {\Gm@includeheadfalse\Gm@includefootfalse}%
+  {\Gm@includeheadtrue\Gm@includefoottrue}}%
+\define@key{Gm}{ignoremp}[true]{%
+  \Gm@setboolrev[ignoremp]{includemp}{#1}}%
+\define@key{Gm}{ignoreall}[true]{\Gm@doifelse{ignoreall}{#1}%
+  {\Gm@includeheadfalse\Gm@includefootfalse\Gm@includempfalse}%
+  {\Gm@includeheadtrue\Gm@includefoottrue\Gm@includemptrue}}%
+\define@key{Gm}{heightrounded}[true]{\Gm@setbool{heightrounded}{#1}}%
+\define@key{Gm}{hdivide}{\Gm@parse@divide{#1}{lmargin}{width}{rmargin}}%
+\define@key{Gm}{vdivide}{\Gm@parse@divide{#1}{tmargin}{height}{bmargin}}%
+\define@key{Gm}{divide}{\Gm@parse@divide{#1}{lmargin}{width}{rmargin}%
+  \Gm@parse@divide{#1}{tmargin}{height}{bmargin}}%
+\define@key{Gm}{lmargin}{\Gm@defbylen{lmargin}{#1}}%
+\define@key{Gm}{rmargin}{\Gm@defbylen{rmargin}{#1}}%
+\let\KV@Gm@left\KV@Gm@lmargin
+\let\KV@Gm@inner\KV@Gm@lmargin
+\let\KV@Gm@innermargin\KV@Gm@lmargin
+\let\KV@Gm@right\KV@Gm@rmargin
+\let\KV@Gm@outer\KV@Gm@rmargin
+\let\KV@Gm@outermargin\KV@Gm@rmargin
+\define@key{Gm}{tmargin}{\Gm@defbylen{tmargin}{#1}}%
+\define@key{Gm}{bmargin}{\Gm@defbylen{bmargin}{#1}}%
+\let\KV@Gm@top\KV@Gm@tmargin
+\let\KV@Gm@bottom\KV@Gm@bmargin
+\define@key{Gm}{hmargin}{\Gm@branch{#1}{lmargin}{rmargin}}%
+\define@key{Gm}{vmargin}{\Gm@branch{#1}{tmargin}{bmargin}}%
+\define@key{Gm}{margin}{\Gm@branch{#1}{lmargin}{tmargin}%
+  \Gm@branch{#1}{rmargin}{bmargin}}%
+\define@key{Gm}{hmarginratio}{\edef\Gm@hmarginratio{#1}}%
+\define@key{Gm}{vmarginratio}{\edef\Gm@vmarginratio{#1}}%
+\define@key{Gm}{marginratio}{\Gm@branch{#1}{hmarginratio}{vmarginratio}}%
+\let\KV@Gm@hratio\KV@Gm@hmarginratio
+\let\KV@Gm@vratio\KV@Gm@vmarginratio
+\let\KV@Gm@ratio\KV@Gm@marginratio
+\define@key{Gm}{hcentering}[true]{\Gm@doifelse{hcentering}{#1}%
+  {\def\Gm@hmarginratio{1:1}}{}}%
+\define@key{Gm}{vcentering}[true]{\Gm@doifelse{vcentering}{#1}%
+  {\def\Gm@vmarginratio{1:1}}{}}%
+\define@key{Gm}{centering}[true]{\Gm@doifelse{centering}{#1}%
+  {\def\Gm@hmarginratio{1:1}\def\Gm@vmarginratio{1:1}}{}}%
+\define@key{Gm}{twoside}[true]{\Gm@doifelse{twoside}{#1}%
+  {\@twosidetrue\@mparswitchtrue}{\@twosidefalse\@mparswitchfalse}}%
+\define@key{Gm}{asymmetric}[true]{\Gm@doifelse{asymmetric}{#1}%
+  {\@twosidetrue\@mparswitchfalse}{}}%
+\define@key{Gm}{bindingoffset}{\Gm@setlength\Gm@bindingoffset{#1}}%
+\define@key{Gm}{headheight}{\Gm@setlength\headheight{#1}}%
+\define@key{Gm}{headsep}{\Gm@setlength\headsep{#1}}%
+\define@key{Gm}{footskip}{\Gm@setlength\footskip{#1}}%
+\let\KV@Gm@head\KV@Gm@headheight
+\let\KV@Gm@foot\KV@Gm@footskip
+\define@key{Gm}{nohead}[true]{\Gm@doifelse{nohead}{#1}%
+  {\Gm@setlength\headheight\z@\Gm@setlength\headsep\z@}{}}%
+\define@key{Gm}{nofoot}[true]{\Gm@doifelse{nofoot}{#1}%
+  {\Gm@setlength\footskip\z@}{}}%
+\define@key{Gm}{noheadfoot}[true]{\Gm@doifelse{noheadfoot}{#1}%
+  {\Gm@setlength\headheight\z@\Gm@setlength\headsep
+  \z@\Gm@setlength\footskip\z@}{}}%
+\define@key{Gm}{footnotesep}{\Gm@setlength{\skip\footins}{#1}}%
+\define@key{Gm}{marginparwidth}{\Gm@setlength\marginparwidth{#1}}%
+\let\KV@Gm@marginpar\KV@Gm@marginparwidth
+\define@key{Gm}{marginparsep}{\Gm@setlength\marginparsep{#1}}%
+\define@key{Gm}{nomarginpar}[true]{\Gm@doifelse{nomarginpar}{#1}%
+  {\Gm@setlength\marginparwidth\z@\Gm@setlength\marginparsep\z@}{}}%
+\define@key{Gm}{columnsep}{\Gm@setlength\columnsep{#1}}%
+\define@key{Gm}{hoffset}{\Gm@setlength\hoffset{#1}}%
+\define@key{Gm}{voffset}{\Gm@setlength\voffset{#1}}%
+\define@key{Gm}{offset}{\Gm@branch{#1}{hoffset}{voffset}}%
+\define@key{Gm}{layouthoffset}{\Gm@setlength\Gm@layouthoffset{#1}}%
+\define@key{Gm}{layoutvoffset}{\Gm@setlength\Gm@layoutvoffset{#1}}%
+\define@key{Gm}{layoutoffset}{\Gm@branch{#1}{layouthoffset}{layoutvoffset}}%
+\define@key{Gm}{twocolumn}[true]{%
+  \Gm@doif{twocolumn}{#1}{\csname @twocolumn\Gm@bool\endcsname}}%
+\define@key{Gm}{onecolumn}[true]{%
+  \Gm@doifelse{onecolumn}{#1}{\@twocolumnfalse}{\@twocolumntrue}}%
+\define@key{Gm}{reversemp}[true]{%
+  \Gm@doif{reversemp}{#1}{\csname @reversemargin\Gm@bool\endcsname}}%
+\define@key{Gm}{reversemarginpar}[true]{%
+  \Gm@doif{reversemarginpar}{#1}{\csname @reversemargin\Gm@bool\endcsname}}%
+\define@key{Gm}{driver}{\ifGm@preamble{driver}{%
+  \edef\@@tempa{#1}\edef\@@auto{auto}\edef\@@none{none}%
+  \ifx\@@tempa\@empty\let\Gm@driver\relax\else
+  \ifx\@@tempa\@@none\let\Gm@driver\relax\else
+  \ifx\@@tempa\@@auto\let\Gm@driver\@empty\else
+  \setkeys{Gm}{#1}\fi\fi\fi\let\@@auto\relax\let\@@none\relax}}%
+\define@key{Gm}{dvips}[true]{\ifGm@preamble{dvips}{%
+  \Gm@doifelse{dvips}{#1}{\Gm@setdriver{dvips}}{\Gm@unsetdriver{dvips}}}}%
+\define@key{Gm}{dvipdfm}[true]{\ifGm@preamble{dvipdfm}{%
+  \Gm@doifelse{dvipdfm}{#1}{\Gm@setdriver{dvipdfm}}{\Gm@unsetdriver{dvipdfm}}}}%
+\define@key{Gm}{pdftex}[true]{\ifGm@preamble{pdftex}{%
+  \Gm@doifelse{pdftex}{#1}{\Gm@setdriver{pdftex}}{\Gm@unsetdriver{pdftex}}}}%
+\define@key{Gm}{xetex}[true]{\ifGm@preamble{xetex}{%
+  \Gm@doifelse{xetex}{#1}{\Gm@setdriver{xetex}}{\Gm@unsetdriver{xetex}}}}%
+\define@key{Gm}{vtex}[true]{\ifGm@preamble{vtex}{%
+  \Gm@doifelse{vtex}{#1}{\Gm@setdriver{vtex}}{\Gm@unsetdriver{vtex}}}}%
+\define@key{Gm}{verbose}[true]{\ifGm@preamble{verbose}{\Gm@setbool{verbose}{#1}}}%
+\define@key{Gm}{reset}[true]{\ifGm@preamble{reset}{%
+  \Gm@doifelse{reset}{#1}{\Gm@restore@org\Gm@initall
+  \ProcessOptionsKV[c]{Gm}\Gm@setdefaultpaper}{}}}%
+\define@key{Gm}{resetpaper}[true]{\ifGm@preamble{resetpaper}{%
+  \Gm@setbool{resetpaper}{#1}}}%
+\define@key{Gm}{mag}{\ifGm@preamble{mag}{\mag=#1}}%
+\define@key{Gm}{truedimen}[true]{\ifGm@preamble{truedimen}{%
+  \Gm@doifelse{truedimen}{#1}{\let\Gm@truedimen\Gm@true}%
+  {\let\Gm@truedimen\@empty}}}%
+\define@key{Gm}{pass}[true]{\ifGm@preamble{pass}{\Gm@setbool{pass}{#1}}}%
+\define@key{Gm}{showframe}[true]{\Gm@setbool{showframe}{#1}}%
+\define@key{Gm}{showcrop}[true]{\Gm@setbool{showcrop}{#1}}%
+\def\Gm@setdefaultpaper{%
+  \ifx\Gm@paper\@undefined
+    \Gm@setsize{paper}(\strip@pt\paperwidth,\strip@pt\paperheight){pt}%
+    \Gm@setsize{Gm@layout}(\strip@pt\paperwidth,\strip@pt\paperheight){pt}%
+    \Gm@swap@papersizefalse
+  \fi}%
+\def\Gm@adjustpaper{%
+  \ifdim\paperwidth>\p@\else
+    \PackageError{geometry}{%
+    \string\paperwidth\space(\the\paperwidth) too short}{%
+    Set a paper type (e.g., `a4paper').}%
+  \fi
+  \ifdim\paperheight>\p@\else
+    \PackageError{geometry}{%
+    \string\paperheight\space(\the\paperheight) too short}{%
+    Set a paper type (e.g., `a4paper').}%
+  \fi
+  \ifGm@swap@papersize
+    \setlength\@tempdima{\paperwidth}%
+    \setlength\paperwidth{\paperheight}%
+    \setlength\paperheight{\@tempdima}%
+  \fi
+  \ifGm@layout\else
+    \let\Gm@layoutwidth\paperwidth
+    \let\Gm@layoutheight\paperheight
+  \fi}%
+\def\Gm@checkmp{%
+  \ifGm@includemp\else
+    \@tempcnta\z@\@tempcntb\@ne
+    \if@twocolumn
+      \@tempcnta\@ne
+    \else
+      \if@reversemargin
+        \@tempcnta\@ne\@tempcntb\z@
+      \fi
+    \fi
+    \@tempdima\marginparwidth
+    \advance\@tempdima\marginparsep
+    \ifnum\@tempcnta=\@ne
+      \@tempdimc\@tempdima
+      \setlength\@tempdimb{\Gm@lmargin}%
+      \advance\@tempdimc-\@tempdimb
+      \ifdim\@tempdimc>\z@
+        \Gm@warning{The marginal notes overrun the paper edge.^^J
+        \@spaces Add \the\@tempdimc\space and more to the left margin}%
+      \fi
+    \fi
+    \ifnum\@tempcntb=\@ne
+      \@tempdimc\@tempdima
+      \setlength\@tempdimb{\Gm@rmargin}%
+      \advance\@tempdimc-\@tempdimb
+      \ifdim\@tempdimc>\z@
+        \Gm@warning{The marginal notes overrun the paper.^^J
+        \@spaces Add \the\@tempdimc\space and more to the right margin}%
+      \fi
+    \fi
+  \fi}%
+\def\Gm@adjustmp{%
+  \ifGm@includemp
+    \@tempdimb\marginparwidth
+    \advance\@tempdimb\marginparsep
+    \Gm@wd@mp\@tempdimb
+    \Gm@odd@mp\z@
+    \Gm@even@mp\z@
+    \if@twocolumn
+      \Gm@wd@mp2\@tempdimb
+      \Gm@odd@mp\@tempdimb
+      \Gm@even@mp\@tempdimb
+    \else
+      \if@reversemargin
+        \Gm@odd@mp\@tempdimb
+        \if@mparswitch\else
+          \Gm@even@mp\@tempdimb
+        \fi
+      \else
+        \if@mparswitch
+          \Gm@even@mp\@tempdimb
+        \fi
+      \fi
+    \fi
+  \fi}%
+\def\Gm@adjustbody{
+  \ifGm@hbody
+    \ifx\Gm@width\@undefined
+      \ifx\Gm@hscale\@undefined
+        \edef\Gm@width{\Gm@Dhscale\Gm@layoutwidth}%
+      \else
+        \edef\Gm@width{\Gm@hscale\Gm@layoutwidth}%
+      \fi
+    \fi
+    \ifx\Gm@textwidth\@undefined\else
+      \setlength\@tempdima{\Gm@textwidth}%
+      \ifGm@includemp
+        \advance\@tempdima\Gm@wd@mp
+      \fi
+      \edef\Gm@width{\the\@tempdima}%
+    \fi
+  \fi
+  \ifGm@vbody
+    \ifx\Gm@height\@undefined
+      \ifx\Gm@vscale\@undefined
+        \edef\Gm@height{\Gm@Dvscale\Gm@layoutheight}%
+      \else
+        \edef\Gm@height{\Gm@vscale\Gm@layoutheight}%
+      \fi
+    \fi
+    \ifx\Gm@lines\@undefined\else
+      \ifdim\topskip<\ht\strutbox
+        \setlength\@tempdima{\topskip}%
+        \setlength\topskip{\ht\strutbox}%
+        \Gm@warning{\noexpand\topskip was changed from \the\@tempdima\space
+        to \the\topskip}%
+      \fi
+      \setlength\@tempdima{\baselineskip}%
+      \multiply\@tempdima\Gm@lines
+      \addtolength\@tempdima{\topskip}%
+      \addtolength\@tempdima{-\baselineskip}%
+      \edef\Gm@textheight{\the\@tempdima}%
+    \fi
+    \ifx\Gm@textheight\@undefined\else
+      \setlength\@tempdima{\Gm@textheight}%
+      \ifGm@includehead
+        \addtolength\@tempdima{\headheight}%
+        \addtolength\@tempdima{\headsep}%
+      \fi
+      \ifGm@includefoot
+        \addtolength\@tempdima{\footskip}%
+      \fi
+      \edef\Gm@height{\the\@tempdima}%
+    \fi
+  \fi}%
+\def\Gm@process{%
+  \ifGm@pass
+    \Gm@restore@org
+  \else
+    \Gm@@process
+  \fi}%
+\def\Gm@@process{%
+  \Gm@expandlengths
+  \Gm@adjustpaper
+  \addtolength\Gm@layoutwidth{-\Gm@bindingoffset}%
+  \Gm@adjustmp
+  \Gm@adjustbody
+  \Gm@detall{h}{width}{lmargin}{rmargin}%
+  \Gm@detall{v}{height}{tmargin}{bmargin}%
+  \setlength\textwidth{\Gm@width}%
+  \setlength\textheight{\Gm@height}%
+  \setlength\topmargin{\Gm@tmargin}%
+  \setlength\oddsidemargin{\Gm@lmargin}%
+  \addtolength\oddsidemargin{-1\Gm@truedimen in}%
+  \ifGm@includemp
+    \advance\textwidth-\Gm@wd@mp
+    \advance\oddsidemargin\Gm@odd@mp
+  \fi
+  \if@mparswitch
+    \setlength\evensidemargin{\Gm@rmargin}%
+    \addtolength\evensidemargin{-1\Gm@truedimen in}%
+    \ifGm@includemp
+      \advance\evensidemargin\Gm@even@mp
+    \fi
+  \else
+    \evensidemargin\oddsidemargin
+  \fi
+  \advance\oddsidemargin\Gm@bindingoffset
+  \addtolength\topmargin{-1\Gm@truedimen in}%
+  \ifGm@includehead
+    \addtolength\textheight{-\headheight}%
+    \addtolength\textheight{-\headsep}%
+  \else
+    \addtolength\topmargin{-\headheight}%
+    \addtolength\topmargin{-\headsep}%
+  \fi
+  \ifGm@includefoot
+    \addtolength\textheight{-\footskip}%
+  \fi
+  \ifGm@heightrounded
+    \setlength\@tempdima{\textheight}%
+    \addtolength\@tempdima{-\topskip}%
+    \@tempcnta\@tempdima
+    \@tempcntb\baselineskip
+    \divide\@tempcnta\@tempcntb
+    \setlength\@tempdimb{\baselineskip}%
+    \multiply\@tempdimb\@tempcnta
+    \advance\@tempdima-\@tempdimb
+    \multiply\@tempdima\tw@
+    \ifdim\@tempdima>\baselineskip
+      \addtolength\@tempdimb{\baselineskip}%
+    \fi
+    \addtolength\@tempdimb{\topskip}%
+    \textheight\@tempdimb
+  \fi
+  \advance\oddsidemargin\Gm@layouthoffset%
+  \advance\evensidemargin\Gm@layouthoffset%
+  \advance\topmargin\Gm@layoutvoffset%
+  \addtolength\Gm@layoutwidth{\Gm@bindingoffset}%
+  }% end of \Gm@@process
+\def\Gm@detectdriver{%
+  \ifx\Gm@driver\@empty
+    \typeout{*geometry* driver: auto-detecting}%
+    \ifpdf
+      \Gm@setdriver{pdftex}%
+    \else
+      \Gm@setdriver{dvips}%
+    \fi
+    \ifvtex
+      \Gm@setdriver{vtex}%
+    \fi
+    \@ifundefined{XeTeXversion}{}{\Gm@setdriver{xetex}}%
+  \else
+    \ifx\Gm@driver\Gm@xetex %%
+      \@ifundefined{XeTeXversion}{\Gm@warning{%
+            Wrong driver setting: `xetex'; trying `pdftex' driver}%
+            \Gm@setdriver{pdftex}}{}%
+    \fi
+    \ifx\Gm@driver\Gm@vtex
+      \ifvtex\else
+        \Gm@warning{Wrong driver setting: `vtex'; trying `dvips' driver}%
+        \Gm@setdriver{dvips}%
+      \fi
+    \fi
+  \fi
+  \ifx\Gm@driver\relax
+    \typeout{*geometry* detected driver: <none>}%
+  \else
+    \typeout{*geometry* detected driver: \Gm@driver}%
+  \fi}%
+\def\Gm@showparams#1{%
+  \ifGm@pass\else
+   \setlength\@tempdima{\Gm@width}\edef\Gm@width{\the\@tempdima}%
+   \setlength\@tempdima{\Gm@height}\edef\Gm@height{\the\@tempdima}%
+  \fi
+  \ifGm@verbose\expandafter\typeout\else\expandafter\wlog\fi
+  {\Gm@logcontent{#1}}}%
+\def\Gm@showdim#1{* \string#1=\the#1^^J}%
+\def\Gm@showbool#1{\@nameuse{ifGm@#1}#1\space\fi}%
+\def\Gm@logcontent#1{%
+  *geometry* verbose mode - [ #1 ] result:^^J%
+  \ifGm@pass * pass (ignores the geometry layout)^^J%
+  \else
+  * driver: \if\Gm@driver\relax <none>\else\Gm@driver\fi^^J%
+  * paper: \ifx\Gm@paper\@undefined\the\paperwidth,
+    \the\paperheight\space(class default)\else\Gm@paper\fi^^J%
+  * layout: \ifGm@layout \the\Gm@layoutwidth, \the\Gm@layoutheight
+  \else\ifx\Gm@paper\@undefined\the\paperwidth,
+     \the\paperheight\else\Gm@paper\fi\fi^^J%
+  \@ifundefined{Gm@lines}{}{* lines: \Gm@lines^^J}%
+  \@ifundefined{Gm@hmarginratio}{}{* hratio: \Gm@hmarginratio^^J}%
+  \@ifundefined{Gm@vmarginratio}{}{* vratio: \Gm@vmarginratio^^J}%
+  \ifdim\Gm@bindingoffset=\z@\else
+  * bindingoffset: \the\Gm@bindingoffset^^J\fi
+  * switch(es): %
+   \Gm@showbool{landscape}%
+   \Gm@showbool{includehead}%
+   \Gm@showbool{includefoot}%
+   \Gm@showbool{includemp}%
+   \if@twoside twoside\space\fi%
+   \if@mparswitch\else\if@twoside asymmetric\space\fi\fi%
+   \Gm@showbool{heightrounded}%
+   \ifx\Gm@truedimen\@empty\else truedimen\space\fi%
+  ^^J%
+  * h-part:(L,W,R)=(\Gm@lmargin, \Gm@width, \Gm@rmargin)^^J%
+  * v-part:(T,H,B)=(\Gm@tmargin, \Gm@height, \Gm@bmargin)^^J%
+  \fi
+  \Gm@showdim{\paperwidth}%
+  \Gm@showdim{\paperheight}%
+  \Gm@showdim{\textwidth}%
+  \Gm@showdim{\textheight}%
+  \Gm@showdim{\oddsidemargin}%
+  \Gm@showdim{\evensidemargin}%
+  \Gm@showdim{\topmargin}%
+  \Gm@showdim{\headheight}%
+  \Gm@showdim{\headsep}%
+  \Gm@showdim{\footskip}%
+  \Gm@showdim{\marginparwidth}%
+  \Gm@showdim{\marginparsep}%
+  \Gm@showdim{\columnsep}%
+  * \string\skip\string\footins=\the\skip\footins^^J%
+  \Gm@showdim{\hoffset}%
+  \Gm@showdim{\voffset}%
+  \Gm@showdim{\mag}%
+  * \string\@twocolumn\if@twocolumn true\else false\fi^^J%
+  * \string\@twoside\if@twoside true\else false\fi^^J%
+  * \string\@mparswitch\if@mparswitch true\else false\fi^^J%
+  * \string\@reversemargin\if@reversemargin true\else false\fi^^J%
+  * (1in=72.27pt, 1cm=28.453pt)^^J}%
+\def\Gm@cropmark(#1,#2,#3,#4){%
+  \begin{picture}(0,0)
+    \setlength\unitlength{1truemm}\thinlines
+    \put(0,0){\line(#1,#2){5}}
+    \put(0,0){\line(#3,#4){5}}
+  \end{picture}}%
+\newcommand*{\Gm@vrules@mpi}{%
+  \hb@xt@\@tempdima{\llap{\vrule height\textheight}\ignorespaces
+  \hskip \textwidth\vrule height\textheight\hskip \marginparsep
+  \llap{\vrule height\textheight}\hfil\vrule height\textheight}}%
+\newcommand*{\Gm@vrules@mpii}{%
+  \hb@xt@\@tempdima{\hskip-\marginparwidth\hskip-\marginparsep
+  \llap{\vrule height\textheight}\ignorespaces
+  \hskip \marginparwidth\rlap{\vrule height\textheight}\hskip \marginparsep
+  \llap{\vrule height\textheight}\hskip\textwidth\rlap{\vrule height\textheight}\hss}}%
+\providecommand*\vb@xt@{\vbox to}%
+\newcommand*{\Gm@pageframes}{%
+  \vb@xt@\z@{\baselineskip\z@skip\lineskip\z@skip\lineskiplimit\z@%
+   \ifGm@showcrop
+    \vb@xt@\z@{\vskip-1\Gm@truedimen in\vskip\Gm@layoutvoffset%
+     \hb@xt@\z@{\hskip-1\Gm@truedimen in\hskip\Gm@layouthoffset%
+      \vb@xt@\Gm@layoutheight{%
+       \let\protect\relax
+       \hb@xt@\Gm@layoutwidth{\Gm@cropmark(1,0,0,-1)\hfil\Gm@cropmark(-1,0,0,-1)}%
+       \vfil
+       \hb@xt@\Gm@layoutwidth{\Gm@cropmark(1,0,0,1)\hfil\Gm@cropmark(-1,0,0,1)}}%
+     \hss}%
+    \vss}%
+   \fi%
+   \ifGm@showframe
+    \if@twoside
+     \ifodd\count\z@
+       \let\@themargin\oddsidemargin
+     \else
+       \let\@themargin\evensidemargin
+     \fi
+    \fi
+    \moveright\@themargin%
+    \vb@xt@\z@{%
+     \vskip\topmargin\vb@xt@\z@{\vss\hrule width\textwidth}%
+     \vskip\headheight\vb@xt@\z@{\vss\hrule width\textwidth}%
+     \vskip\headsep\vb@xt@\z@{\vss\hrule width\textwidth}
+     \@tempdima\textwidth
+     \advance\@tempdima by \marginparsep
+     \advance\@tempdima by \marginparwidth
+     \if@mparswitch
+      \ifodd\count\z@
+       \Gm@vrules@mpi
+      \else
+       \Gm@vrules@mpii
+      \fi
+     \else
+      \Gm@vrules@mpi
+     \fi
+     \vb@xt@\z@{\vss\hrule width\textwidth}%
+     \vskip\footskip\vb@xt@\z@{\vss\hrule width\textwidth}%
+     \vss}%
+    \fi%
+  }}%
+\let\Gm@shipout\shipout
+\newcommand*{\gm@shipi}{%
+  \ifvoid\@cclv\expandafter\aftergroup\fi\gm@shipii}%
+\newcommand*\gm@shipii{%
+  \ifvoid\@cclv
+    \Gm@shipout\box\@cclv
+  \else
+    \ifGm@showframe
+      \Gm@shipout\vbox{\Gm@pageframes\ifvbox\@cclv\unvbox\else\box\fi\@cclv}%
+    \else\ifGm@showcrop
+      \Gm@shipout\vbox{\Gm@pageframes\ifvbox\@cclv\unvbox\else\box\fi\@cclv}%
+    \else
+      \Gm@shipout\box\@cclv
+    \fi\fi
+  \fi}
+\def\ProcessOptionsKV{\@ifnextchar[%]
+  {\@ProcessOptionsKV}{\@ProcessOptionsKV[]}}%
+\def\@ProcessOptionsKV[#1]#2{%
+  \let\@tempa\@empty
+  \@tempcnta\z@
+  \if#1p\@tempcnta\@ne\else\if#1c\@tempcnta\tw@\fi\fi
+  \ifodd\@tempcnta
+   \edef\@tempa{\@ptionlist{\@currname.\@currext}}%
+  \else
+    \@for\CurrentOption:=\@classoptionslist\do{%
+      \@ifundefined{KV@#2@\CurrentOption}%
+      {}{\edef\@tempa{\@tempa,\CurrentOption,}}}%
+    \ifnum\@tempcnta=\z@
+      \edef\@tempa{\@tempa,\@ptionlist{\@currname.\@currext}}%
+    \fi
+  \fi
+  \edef\@tempa{\noexpand\setkeys{#2}{\@tempa}}%
+  \@tempa
+  \AtEndOfPackage{\let\@unprocessedoptions\relax}}%
+\def\Gm@setkeys{\setkeys{Gm}}%
+\def\Gm@processconfig{%
+  \let\Gm@origExecuteOptions\ExecuteOptions
+  \let\ExecuteOptions\Gm@setkeys
+  \InputIfFileExists{geometry.cfg}{}{}
+  \let\ExecuteOptions\Gm@origExecuteOptions}%
+\Gm@save
+\edef\Gm@restore@org{\Gm@restore}%
+\Gm@initall
+\Gm@processconfig
+\ProcessOptionsKV[c]{Gm}%
+\Gm@setdefaultpaper
+\ProcessOptionsKV[p]{Gm}%
+\Gm@process
+\AtBeginDocument{%
+  \Gm@savelength{paperwidth}%
+  \Gm@savelength{paperheight}%
+  \edef\Gm@restore@org{\Gm@restore}%
+  \ifGm@resetpaper
+    \edef\Gm@pw{\Gm@orgpw}%
+    \edef\Gm@ph{\Gm@orgph}%
+  \else
+    \edef\Gm@pw{\the\paperwidth}%
+    \edef\Gm@ph{\the\paperheight}%
+  \fi
+  \ifGm@pass\else
+    \ifnum\mag=\@m\else
+      \Gm@magtooffset
+      \divide\paperwidth\@m
+      \multiply\paperwidth\the\mag
+      \divide\paperheight\@m
+      \multiply\paperheight\the\mag
+    \fi
+  \fi
+  \Gm@detectdriver
+  \ifx\Gm@driver\Gm@xetex
+    \@ifundefined{pdfpagewidth}{}{%
+      \setlength\pdfpagewidth{\Gm@pw}%
+      \setlength\pdfpageheight{\Gm@ph}}%
+    \ifnum\mag=\@m\else
+      \ifx\Gm@truedimen\Gm@true
+        \setlength\paperwidth{\Gm@pw}%
+        \setlength\paperheight{\Gm@ph}%
+      \fi
+    \fi
+  \fi
+  \ifx\Gm@driver\Gm@pdftex
+    \@ifundefined{pdfpagewidth}{}{%
+      \setlength\pdfpagewidth{\Gm@pw}%
+      \setlength\pdfpageheight{\Gm@ph}}%
+    \ifnum\mag=\@m\else
+      \@tempdima=\mag sp%
+      \@ifundefined{pdfhorigin}{}{%
+        \divide\pdfhorigin\@tempdima
+        \multiply\pdfhorigin\@m
+        \divide\pdfvorigin\@tempdima
+        \multiply\pdfvorigin\@m}%
+      \ifx\Gm@truedimen\Gm@true
+        \setlength\paperwidth{\Gm@pw}%
+        \setlength\paperheight{\Gm@ph}%
+      \fi
+    \fi
+  \fi
+  \ifx\Gm@driver\Gm@vtex
+    \@ifundefined{mediawidth}{}{%
+      \mediawidth=\paperwidth
+      \mediaheight=\paperheight}%
+    \ifvtexdvi
+      \AtBeginDvi{\special{papersize=\the\paperwidth,\the\paperheight}}%
+    \fi
+  \fi
+  \ifx\Gm@driver\Gm@dvips
+    \AtBeginDvi{\special{papersize=\the\paperwidth,\the\paperheight}}%
+    \ifx\Gm@driver\Gm@dvips\ifGm@landscape
+      \AtBeginDvi{\special{! /landplus90 true store}}%
+    \fi\fi
+  \else\ifx\Gm@driver\Gm@dvipdfm
+    \ifcase\ifx\AtBeginShipoutFirst\relax\@ne\else
+        \ifx\AtBeginShipoutFirst\@undefined\@ne\else\z@\fi\fi
+      \AtBeginShipoutFirst{\special{papersize=\the\paperwidth,\the\paperheight}}%
+    \or
+      \AtBeginDvi{\special{papersize=\the\paperwidth,\the\paperheight}}%
+    \fi
+  \fi\fi
+  \ifGm@showframe
+    \renewcommand*{\shipout}{\afterassignment\gm@shipi\setbox\@cclv=}
+  \else\ifGm@showcrop
+    \renewcommand*{\shipout}{\afterassignment\gm@shipi\setbox\@cclv=}
+  \fi\fi
+  \Gm@save
+  \edef\Gm@restore@pkg{\Gm@restore}%
+  \ifGm@verbose\ifGm@pass\else\Gm@checkmp\fi\fi
+  \Gm@showparams{preamble}%
+  \let\Gm@pw\relax
+  \let\Gm@ph\relax
+  }% end of \AtBeginDocument
+\newcommand{\geometry}[1]{%
+  \Gm@clean
+  \setkeys{Gm}{#1}%
+  \Gm@process}%
+\@onlypreamble\geometry
+\DeclareRobustCommand\Gm@changelayout{%
+  \setlength{\@colht}{\textheight}
+  \setlength{\@colroom}{\textheight}%
+  \setlength{\vsize}{\textheight}
+  \setlength{\columnwidth}{\textwidth}%
+  \if@twocolumn%
+    \advance\columnwidth-\columnsep
+    \divide\columnwidth\tw@%
+    \@firstcolumntrue%
+  \fi%
+  \setlength{\hsize}{\columnwidth}%
+  \setlength{\linewidth}{\hsize}}%
+\newcommand\newgeometry[1]{%
+  \clearpage
+  \Gm@restore@org
+  \Gm@initnewgm
+  \Gm@newgmtrue
+  \setkeys{Gm}{#1}%
+  \Gm@newgmfalse
+  \Gm@process
+  \ifnum\mag=\@m\else\Gm@magtooffset\fi
+  \Gm@changelayout
+  \Gm@showparams{newgeometry}}%
+\newcommand\restoregeometry{%
+  \clearpage
+  \Gm@restore@pkg
+  \Gm@changelayout}%
+\newcommand*\savegeometry[1]{%
+  \Gm@save
+  \expandafter\edef\csname Gm@restore@@#1\endcsname{\Gm@restore}}%
+\newcommand*\loadgeometry[1]{%
+  \clearpage
+  \@ifundefined{Gm@restore@@#1}{%
+    \PackageError{geometry}{%
+    \string\loadgeometry : name `#1' undefined}{%
+    The name `#1' should be predefined with \string\savegeometry}%
+  }{\@nameuse{Gm@restore@@#1}%
+  \Gm@changelayout}}%
+\endinput
+%%
+%% End of file `geometry.sty'.
Index: SMC4LRT/images/general-component-schema.xsd.tex
===================================================================
--- SMC4LRT/images/general-component-schema.xsd.tex	(revision 3666)
+++ SMC4LRT/images/general-component-schema.xsd.tex	(revision 3666)
@@ -0,0 +1,289 @@
+\lstset{language=XML}
+\begin{lstlisting}[label=lst:cmd-schema, caption={general-component-schema.xsd -- schema of the CMD meta model for defining CMD profiles and components}]
+
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+    $Revision: 2517 $ 
+    $Date: 2013-01-30 16:29:31 +0100 (Wed, 30 Jan 2013) $ 
+-->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <xs:import namespace="http://www.w3.org/XML/1998/namespace"
+        schemaLocation="http://www.w3.org/2005/08/xml.xsd"/>
+
+    <!-- root element -->
+    <xs:element name="CMD_ComponentSpec">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element name="Header">
+                    <xs:complexType>
+                        <xs:sequence>
+                            <xs:element name="ID" type="xs:anyURI" minOccurs="0"/>
+                            <xs:element name="Name" type="xs:string" minOccurs="0"/>
+                            <xs:element name="Description" type="xs:string" minOccurs="0"/>
+                        </xs:sequence>
+                    </xs:complexType>
+                </xs:element>
+                <xs:element name="CMD_Component" type="CMD_Component_type" maxOccurs="unbounded">
+                    <xs:annotation>
+                        <xs:documentation>At the root level there should always be a
+                        Component.</xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+            </xs:sequence>
+            <xs:attribute name="isProfile" type="xs:boolean" use="required"/>
+        </xs:complexType>
+    </xs:element>
+
+    <!-- recursive construction: A component can contain elements and/or other components  -->
+    <xs:group name="group">
+        <xs:sequence>
+            <!-- from small (attribute) to big (component) -->
+            <xs:element name="AttributeList" type="AttributeList_type" minOccurs="0" maxOccurs="1"/>
+            <xs:element name="CMD_Element" type="CMD_Element_type" minOccurs="0"
+                maxOccurs="unbounded"> </xs:element>
+            <xs:element name="CMD_Component" type="CMD_Component_type" minOccurs="0"
+                maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:group>
+
+    <!-- type definitions -->
+    <xs:complexType name="CMD_Element_type">
+        <xs:sequence>
+            <xs:element name="AttributeList" type="AttributeList_type" minOccurs="0" maxOccurs="1">
+                <xs:annotation>
+                    <xs:documentation>The AttributeList child of an element contains a set of XML
+                        attributes for that element.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element minOccurs="0" maxOccurs="1" name="ValueScheme" type="ValueScheme_type">
+                <xs:annotation>
+                    <xs:documentation>When an element is linked to a regular expression or a
+                        controlled vocabulary, the ValueScheme sub-element contains more information
+                        about this.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+        <xs:attributeGroup ref="clarin_element_attributes"/>
+    </xs:complexType>
+
+
+    <xs:complexType name="ValueScheme_type">
+        <xs:choice>
+            <xs:element name="pattern" type="xs:string" maxOccurs="1">
+                <xs:annotation>
+                    <xs:documentation>Specification of a regular expression the element should
+                        comply with.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="enumeration" type="enumeration_type">
+                <xs:annotation>
+                    <xs:documentation>A list of the allowed values of a controlled
+                    vocabulary.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:choice>
+    </xs:complexType>
+
+
+    <xs:complexType name="AttributeList_type">
+        <xs:sequence>
+            <xs:element name="Attribute" minOccurs="1" maxOccurs="unbounded">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="Name" type="xs:string">
+                            <xs:annotation>
+                                <xs:documentation>The name of the attribute.</xs:documentation>
+                            </xs:annotation>
+                        </xs:element>
+                        <xs:element name="ConceptLink" type="xs:anyURI" minOccurs="0">
+                            <xs:annotation>
+                                <xs:documentation>A link to the ISOcat data category registry (or any other concept registry).</xs:documentation>
+                            </xs:annotation>
+                        </xs:element>
+                        <xs:choice>
+                            <xs:element name="Type" type="allowed_attributetypes_type">
+                                <xs:annotation>
+                                    <xs:documentation>For the use of simple XML types as the type of
+                                        the attribute.</xs:documentation>
+                                </xs:annotation>
+                            </xs:element>
+                            <xs:element name="ValueScheme" type="ValueScheme_type">
+                                <xs:annotation>
+                                    <xs:documentation>For the use of a regular expression or a
+                                        controlled vocabulary as the type of the
+                                    attribute.</xs:documentation>
+                                </xs:annotation>
+                            </xs:element>
+                        </xs:choice>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="CMD_Component_type">
+        <xs:group ref="group" minOccurs="0"/>
+        <xs:attributeGroup ref="clarin_component_attributes"/>
+    </xs:complexType>
+
+
+    <!-- list of all attributes that can be bound to a cl_el -->
+    <xs:attributeGroup name="clarin_element_attributes">
+        <xs:attribute name="name" type="xs:Name" use="required">
+            <xs:annotation>
+                <xs:documentation>The name of the element.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="ConceptLink" type="xs:anyURI">
+            <xs:annotation>
+                <xs:documentation>A link to the ISOcat data category registry (or any other concept
+                    registry).</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="ValueScheme" type="allowed_attributetypes_type">
+            <xs:annotation>
+                <xs:documentation>Used to specify that an element has a simple XML type (string,
+                    integer, etc)</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="CardinalityMin" type="cardinality_type">
+            <xs:annotation>
+                <xs:documentation>Minimal number of occurrences.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="CardinalityMax" type="cardinality_type">
+            <xs:annotation>
+                <xs:documentation>Maximal number of occurrences.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="Documentation" type="xs:string">
+            <xs:annotation>
+                <xs:documentation>Some information an application (eg Arbil) can display to give
+                    guidance to the user when entering metadata.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="DisplayPriority" type="xs:integer">
+            <xs:annotation>
+                <xs:documentation>The element with the highest priority will be displayed as the
+                    label for a metadata file (eg in Arbil)</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="Multilingual" type="xs:boolean">
+            <xs:annotation>
+                <xs:documentation>Indicates that this element can have values in multiple languages
+                    (and thus is repeatable). This will result in the possibility of using the
+                    xml:lang attribute in the metadata instances that are
+                created.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+    </xs:attributeGroup>
+
+    <!-- list of all attributes that can be bound to a cl_comp -->
+    <xs:attributeGroup name="clarin_component_attributes">
+        <xs:attribute name="name" type="xs:Name"/>
+        <xs:attribute name="ComponentId" type="xs:anyURI">
+            <xs:annotation>
+                <xs:documentation>Indicates that a component (using its unique ComponentId issued by
+                    the ComponentRegistry) should be included.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="ConceptLink" type="xs:anyURI">
+            <xs:annotation>
+                <xs:documentation>A link to the ISOcat data category registry (or any other concept
+                    registry). Currently not used.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="filename" type="xs:anyURI">
+            <xs:annotation>
+                <xs:documentation>Outdated way of including an external component. Here for backward
+                    compatibility with the XML-cmdi-toolkit.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+
+        <!-- (components cannot have a ValueScheme attribute) -->
+
+        <xs:attribute name="CardinalityMin" type="cardinality_type"/>
+        <xs:attribute name="CardinalityMax" type="cardinality_type"/>
+        <xs:attribute ref="xml:base"/>
+    </xs:attributeGroup>
+
+
+    <xs:simpleType name="cardinality_type">
+        <xs:annotation>
+            <xs:documentation>cardinality for elements and components</xs:documentation>
+        </xs:annotation>
+        <xs:union>
+            <xs:simpleType>
+                <xs:list itemType="xs:nonNegativeInteger"/>
+            </xs:simpleType>
+            <xs:simpleType>
+                <xs:restriction base="xs:string">
+                    <xs:enumeration value="unbounded"/>
+                </xs:restriction>
+            </xs:simpleType>
+        </xs:union>
+    </xs:simpleType>
+
+    <xs:simpleType name="allowed_attributetypes_type">
+        <xs:annotation>
+            <xs:documentation>Subset of XSD types that are allowed as CMD type</xs:documentation>
+        </xs:annotation>
+
+        <xs:restriction base="xs:token">
+            <xs:enumeration value="boolean"/>
+            <xs:enumeration value="decimal"/>
+            <xs:enumeration value="float"/>
+            <xs:enumeration value="int"/>
+            <xs:enumeration value="string"/>
+            <xs:enumeration value="anyURI"/>
+            <xs:enumeration value="date"/>
+            <xs:enumeration value="gDay"/>
+            <xs:enumeration value="gMonth"/>
+            <xs:enumeration value="gYear"/>
+            <xs:enumeration value="time"/>
+            <xs:enumeration value="dateTime"/>
+        </xs:restriction>
+    </xs:simpleType>
+
+    <xs:complexType name="enumeration_type">
+        <xs:annotation>
+            <xs:documentation>controlled vocabularies</xs:documentation>
+        </xs:annotation>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element name="item" type="item_type">
+                <xs:annotation>
+                    <xs:documentation>An item from a controlled vocabulary.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="appinfo" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation>End-user guidance about the value of the controlled vocabulary
+                        as a whole. Currently not used.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:choice>
+    </xs:complexType>
+
+    <xs:complexType name="item_type">
+        <xs:simpleContent>
+            <xs:extension base="xs:string">
+                <xs:attribute type="xs:anyURI" name="ConceptLink">
+                    <xs:annotation>
+                        <xs:documentation>A link to the ISOcat data category registry (or any other
+                            concept registry) related to this controllec vocabulary
+                        item.</xs:documentation>
+                    </xs:annotation>
+                </xs:attribute>
+                <xs:attribute type="xs:string" name="AppInfo">
+                    <xs:annotation>
+                        <xs:documentation>End-user guidance about the value of this controlled
+                            vocabulary item.</xs:documentation>
+                    </xs:annotation>
+                </xs:attribute>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+</xs:schema>
+\end{lstlisting}
Index: SMC4LRT/thesis.tex
===================================================================
--- SMC4LRT/thesis.tex	(revision 3665)
+++ SMC4LRT/thesis.tex	(revision 3666)
@@ -6,13 +6,13 @@
 \usepackage{url}
 \usepackage{hyperref}					% links in pdf
-\usepackage{graphicx}            			% Figures
+%\usepackage{graphicx}            			% Figures -- added in utils
 \usepackage{verbatim}            			% Code-Environment
 \usepackage[lined,linesnumbered,algochapter]{algorithm2e} % Algorithm-Environment
 
 
-\usepackage{ngerman}
-\usepackage[ngerman]{babel}
-\usepackage{bibgerm,cite}       % Deutsche Bezeichnungen, Automatisches Zusammenfassen von Literaturstellen
-\usepackage[ngerman]{varioref}  % Querverweise
+%\usepackage{ngerman}
+%\usepackage[ngerman]{babel}
+%\usepackage{bibgerm,cite}       % Deutsche Bezeichnungen, Automatisches Zusammenfassen von Literaturstellen
+%\usepackage[ngerman]{varioref}  % Querverweise
 % to use the german charset include cp850 for MS-DOS, ansinew for Windows and latin1 for Linux.
 % \usepackage[latin1]{inputenc}
@@ -42,7 +42,11 @@
 % define custom macros for specific formats or names
 
+\setsecnumdepth{subsection}
+\maxsecnumdepth{subsection}
+%\setcounter{secnumdepth}{4}
+\setcounter{tocdepth}{2}
+
 \input{utils}
 
-\setcounter{tocdepth}{2}
 
 
@@ -50,6 +54,9 @@
 
  \input{frontmatter}
-%\tableofcontents*
+%\tableofcontents
+\restoregeometry
 
+
+%\begin{comment}
 \input{chapters/Introduction}
 
@@ -58,28 +65,21 @@
 \input{chapters/Definitions}
 
+
 \input{chapters/Data}
 
 \input{chapters/Infrastructure}
-
-\input{chapters/SMC}
-
-\input{chapters/System}
-
-\input{chapters/Evaluation}
+\input{chapters/Design_SMCschema}
 
 
-\chapter{Conclusions and Future Work}
 
-Further work is needed on more complex types of response (similarity ratio, relation types) and also on the interaction with Metadata Service to find the optimal way of providing the features of semantic mapping and query expansion as semantic search within the search user-interface.
+\input{chapters/Design_SMCinstance}
+
+\input{chapters/Results}
+%\end{comment}
+\input{chapters/Conclusion}
 
 
-\section{Questions, Remarks}
-
-\begin{itemize}
-\item How does this relate to federated search?
-\item ontologicky vs. semaziologicky (Semanticke priznaky: kategoriÃ¡lne/archysÃ©my, difernciacne, specifikacne)
-\end{itemize}
-
-
+%\end{comment}
+%\begin{comment}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -87,14 +87,12 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+\bibliographystyle{plain}
+%\bibliography{references}
+%\bibliographystyle{ieeetr}
+\bibliography{../../2bib/lingua,../../2bib/ontolingua,../../2bib/smc4lrt,../../2bib/semweb,../../2bib/distributed_systems,../../2bib/own}
+
 \appendix
 
 \input{chapters/appendix}
 
-\bibliographystyle{plain}
-%\bibliography{references}
-%\bibliographystyle{ieeetr}
-\bibliography{../../2bib/lingua,../../2bib/ontolingua,../../2bib/smc4lrt,../../2bib/semweb}
-
-
-
 \end{document}
Index: SMC4LRT/utils.tex
===================================================================
--- SMC4LRT/utils.tex	(revision 3665)
+++ SMC4LRT/utils.tex	(revision 3666)
@@ -1,8 +1,36 @@
 %%%%%%%%%%%%%%%
 % utils / commands
+
+
+\usepackage{graphicx} % support the \includegraphics command and options
+
+\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)
+%\usepackage[T1]{fontenc}
+
+\usepackage{color}
 
 \usepackage{pgf}					
 \usepackage{tikz}					% tikz graphics
 \usetikzlibrary{arrows,automata}
+
+\usepackage{epstopdf}
+
+\usepackage{float}
+\usepackage{framed}
+\usepackage{amsmath}
+%\usepackage{tabularx}
+\usepackage{tabu}
+	
+\usepackage[singlelinecheck=off]{caption}
+
+%%% PACKAGES
+\usepackage{booktabs} % for much better looking tables
+\usepackage{array} % for better arrays (eg matrices) in maths
+\usepackage{paralist} % very flexible & customisable lists (eg. enumerate/itemize, etc.)
+\usepackage{verbatim} % adds environment for commenting out blocks of text & for better verbatim
+%\usepackage{subfig} % make it possible to include more than one captioned figure/table in a single float
+% These packages are all incorporated in the memoir class to one degree or another...
+
+
 
  % disable
@@ -15,12 +43,53 @@
 \newcommand{\concept}[1]{\textsf{#1}}
 \newcommand{\code}[1]{\texttt{#1}}
-\newcommand{\xne}[1]{\textsf{#1}}
+\newcommand{\var}[1]{\textrm{\textit{#1}}}
+\newcommand{\xne}[1]{\textsf{#1}}  % named entity (?)
 \newcommand{\furl}[1]{\footnote{\url{#1}}}
 \newcommand{\ftodo}[1]{\footnote{\todoin{#1}}}
 
 \newenvironment{note}
-{\footnotesize \color{grey} \begin{it}}
-{ \end{it} \normalsize}
+{\footnotesize \color{grey} \begin{textit}}
+{ \end{textit} \normalsize}
 
+\floatstyle{plain}
+\newfloat{definitionx}{htp}{lod}[chapter]
+\floatname{definitionx}{Definition}
+
+
+\DeclareCaptionType{defcap}[Definition][List of definitions]
+\captionsetup[defcap]{labelformat=simple}
+
+\newenvironment{definition}[1]
+{\begin{defcap}[!ht]\caption{#1}\equation\notag}
+% \begin{definitionx} 
+{\endequation\end{defcap}}
+% \end{definitionx}
+
+
+% environments for examples
+% with different number of columns (1,2,3)
+
+% \vspace{0.5\baselineskip}
+\newenvironment{example1}
+{
+ \begin{ttfamily}\footnotesize \begin{shaded*} \noindent
+\begin{tabular}{l}   }
+{ \end{tabular} \end{shaded*} \end{ttfamily}  }
+
+
+%@{\hspace{-2mm}} 
+\newenvironment{example2}
+{ \footnotesize
+\begin{ttfamily} \begin{shaded*} \noindent
+ \begin{tabular}{p{0.4\textwidth}  p{0.6\textwidth} } }
+{\end{tabular} \end{shaded*} \end{ttfamily} }
+
+
+\newenvironment{example3}
+{ \footnotesize
+ \begin{ttfamily} \begin{shaded*} \noindent
+ \begin{tabular}{@{\hspace{-1mm}} p{0.25\textwidth}  p{0.25\textwidth}  p{0.45\textwidth}} 
+}
+{  \end{tabular} \end{shaded*} \end{ttfamily} }
 
 % xml syntax highlighting
@@ -37,4 +106,5 @@
 \definecolor{code}{rgb}{1,0.8,0.8}
 \definecolor{todoborder}{rgb}{0.8,0.4,0.4}
+\definecolor{shadecolor}{rgb}{0.9,0.9,1.0}
 
  
@@ -57,2 +127,13 @@
   morekeywords={xmlns,version,type}% list your attributes here
 }
+
+
+%%% Fallback definitions for Docutils-specific commands
+
+% legend environment
+\ifthenelse{\isundefined{\DUlegend}}{
+  \newenvironment{DUlegend}{\small}{}
+}{}
+
+% titlereference role
+\providecommand*{\DUroletitlereference}[1]{\textsl{#1}}
