texlive[42966] Master: fgruler (16jan17)

commits+karl at tug.org commits+karl at tug.org
Tue Jan 17 00:09:42 CET 2017


Revision: 42966
          http://tug.org/svn/texlive?view=revision&revision=42966
Author:   karl
Date:     2017-01-17 00:09:41 +0100 (Tue, 17 Jan 2017)
Log Message:
-----------
fgruler (16jan17)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/libexec/ctan2tds
    trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/fgruler/
    trunk/Master/texmf-dist/doc/latex/fgruler/README
    trunk/Master/texmf-dist/doc/latex/fgruler/fgruler.pdf
    trunk/Master/texmf-dist/source/latex/fgruler/
    trunk/Master/texmf-dist/source/latex/fgruler/fgruler.dtx
    trunk/Master/texmf-dist/source/latex/fgruler/fgruler.ins
    trunk/Master/texmf-dist/tex/latex/fgruler/
    trunk/Master/texmf-dist/tex/latex/fgruler/fgruler.sty
    trunk/Master/tlpkg/tlpsrc/fgruler.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/fgruler/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fgruler/README	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/fgruler/README	2017-01-16 23:09:41 UTC (rev 42966)
@@ -0,0 +1,21 @@
+fgruler.sty package
+
+Copyright 2017- by Tibor Tomacs
+
+Package for drawing rulers on the foreground or in the text
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+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.3 or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainer of this work is Tibor Tomacs.
+
+Install:
+ - Run 'latex fgruler.ins' for the fgruler.sty file.
+ - Run twice 'pdflatex fgruler.dtx' to get the documentation (fgruler.pdf).
\ No newline at end of file

Added: trunk/Master/texmf-dist/doc/latex/fgruler/fgruler.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/fgruler/fgruler.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fgruler/fgruler.pdf	2017-01-16 01:02:37 UTC (rev 42965)
+++ trunk/Master/texmf-dist/doc/latex/fgruler/fgruler.pdf	2017-01-16 23:09:41 UTC (rev 42966)

Property changes on: trunk/Master/texmf-dist/doc/latex/fgruler/fgruler.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/fgruler/fgruler.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fgruler/fgruler.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/fgruler/fgruler.dtx	2017-01-16 23:09:41 UTC (rev 42966)
@@ -0,0 +1,1790 @@
+% \iffalse meta-comment
+%
+% Copyright 2017- by Tibor Tomacs
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% 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.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+% 
+% The Current Maintainer of this work is Tibor Tomacs.
+%
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{fgruler.dtx}
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+%<package>\ProvidesPackage{fgruler}[2017/01/16 v1.0 Package for drawing rulers on the foreground or in the text]
+%
+%<*driver>
+\documentclass{ltxdoc}
+\OnlyDescription
+\usepackage[a4paper,margin=25mm,marginparwidth=19mm,marginparsep=5mm,headsep=5mm,headheight=4mm,footskip=10mm]{geometry}
+\usepackage[pdfstartview=FitH,colorlinks,allcolors=black,bookmarksnumbered,hyperfootnotes=false]{hyperref}
+\usepackage[english]{babel}
+\usepackage{listings,fontawesome,fancyvrb}
+\usepackage[type=none,color=red!80!black]{fgruler}
+
+\flushbottom
+\VerbatimFootnotes
+
+\setlength{\labelsep}{0pt}
+
+\lstnewenvironment{examplelst}{\lstset{
+gobble=2,
+belowskip=\bigskipamount,
+basicstyle=\ttfamily,
+backgroundcolor=\color{black!10},
+columns=fullflexible,
+keepspaces}}{}
+
+\newcommand{\commandinline}{\lstinline[
+literate={<}{{$\langle$}}1{>}{{$\rangle$}}1,
+delim={[is][\color{green!50!black}\normalfont\itshape]{!}{!}},
+basicstyle=\color{blue!80!black}\ttfamily,
+columns=fullflexible,
+keepspaces]}
+
+\begin{document}
+    \DocInput{./fgruler.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{fgruler.sty}
+%
+% \title{The {\bfseries\sffamily fgruler} package\\{\large v1.0 (2017/01/16)}}
+% \author{Tibor T\'{o}m\'{a}cs\\{\normalsize\url{tomacs.tibor at uni-eszterhazy.hu}}}
+% \date{}
+% \maketitle
+% 
+% \fgruler{upperleft}{0cm}{0cm}
+% \noindent
+% {\rulerparams{}{\scriptsize\sffamily\color{teal}}{blue}{}{}
+% {\fgrulerdefnum{}\fgrulercaptioncm{}\ruler{rightdown}{\textwidth}}\\[2pt]
+% \ruler{rightup}{\textwidth}}
+% 
+% \section{Introduction}
+% The \texttt{fgruler} is an abbreviation for the \emph{foreground ruler}.
+% This package draws a horizontal and a vertical ruler on the foreground of every (or a given) page at absolute position.
+% In this way, you can check the page layout dimensions.
+% 
+% \medskip\noindent
+% Besides, you can draw various rulers in the text, too.
+% 
+% \medskip\noindent
+% The \texttt{fgruler} package requires the services of the following packages: \texttt{kvoptions}, \texttt{etoolbox}, \texttt{xcolor}, \texttt{graphicx}, \texttt{eso-pic}.
+% 
+% \section{Loading package}
+% Load the package with
+% \begin{flushleft}
+% \commandinline|\usepackage[!<options>!]{fgruler}|
+% \end{flushleft}
+% or
+% \begin{flushleft}
+% \commandinline|\usepackage{fgruler}|\\
+% \commandinline|\setfgruler{!<options>!}|
+% \end{flushleft}
+% The \verb|\setfgruler| command is usable in the \texttt{document} environment, too.
+% 
+% \section{Options}\label{sec:options}
+% By default, the \texttt{fgruler} package draws a square ruler on the foreground of every page. The following package options set the parameters of these rulers.
+% \begin{description}
+% \item\commandinline|unit=!<unit>!|\\
+% Ruler unit.
+% \begin{description}
+% \item\commandinline|!<unit>!| values:\\
+% \commandinline|cm| Metric ruler (centimeter). Default value.\\
+% \commandinline|in| English ruler (inch).
+% \end{description}
+% 
+% \item\commandinline|type=!<type name>!|\\
+% Origin and directions.
+% \begin{description}
+% \item\commandinline|!<type name>!| values:\\
+% \commandinline|upperleft | Origin: upper left corner. Directions: down and right. Default value.\\
+% \commandinline|upperright| Origin: upper right corner. Directions: down and left.\\
+% \commandinline|lowerleft | Origin: lower left corner. Directions: up and right.\\
+% \commandinline|lowerright| Origin: lower right corner. Directions: up and left.\\
+% \commandinline|none      | Not drawing ruler.
+% \end{description}
+% 
+% \item\commandinline|hshift=!<length>!|\\
+% Horizontal shift.
+% The shift direction is right, if the \commandinline|!<type name>!| is \verb|upperleft| or \verb|lowerleft|, otherwise it is left.
+% Default: \verb|hshift=0cm|
+% 
+% \item\commandinline|vshift=!<length>!|\\
+% Vertical shift.
+% The shift direction is down, if the \commandinline|!<type name>!| is \verb|upperleft| or \verb|upperright|, otherwise it is up.
+% Default: \verb|vshift=0cm|
+% 
+% \item\commandinline|color=!<color name>!|\\
+% Ruler color (see \texttt{xcolor} package).
+% Default: \verb|color=black|
+% 
+% \item\commandinline|numsep=!<length>!|\\
+% Separation between number and ruler.
+% Default: \verb|numsep=3pt|
+% 
+% \item\commandinline|markthick=!<length>!|\\
+% Mark thickness.
+% Default: \verb|markthick=0.4pt|
+% 
+% \item\commandinline|marklength=!<length>!|\\
+% Mark length at integer units:
+% {\fgrulernoborderline\fgrulercaptioncm{}\fgrulerthickcm{}{}{1pt}\fgrulercolorcm{}{}{red}\ruler{rightup}{3cm}}\quad
+% Default: \verb|marklength=2mm|\\
+% See the length of the other marks in Section \ref{sec:additional}.
+% 
+% \item\commandinline|numfont=!<font type>!|\\
+% Number font type.
+% You can use this option only in \verb|\setfgruler| command.\\
+% Default: \verb|numfont=\scriptsize\sffamily|
+% 
+% \item\commandinline|showframe| or \commandinline|showframe=true|\\
+% It draws visible frames for the text and margin area, and lines for the head and foot.
+% Their color and thickness are determined by the \texttt{color} and the \texttt{markthick} options.
+% 
+% \item\commandinline|showframe=false|\\
+% It deactivates the \texttt{showframe} option.
+% 
+% \item\commandinline|nonefgrulers|\\
+% It kills all of the rulers on the foreground, including also those, which are generated by \verb|\fgruler| (see Section \ref{sec:givenpage}).
+% But the rulers, which were drawn by \verb|\ruler| and \verb|\squareruler| (see Section \ref{sec:intext}), do not disappear.
+% Furthermore it deactivates the \texttt{showframe} option, too.
+% In this case the \texttt{fgruler} package does not load the \texttt{eso-pic} package.
+% This option works only in preamble.
+% 
+% It is recommended to use in two cases:
+% \begin{itemize}
+% \item To draw rulers only in text, there is no need for the checking function.
+% \item To halt the checking function temporarily.
+% \end{itemize}
+% 
+% The \texttt{type=none} is not identical with \texttt{nonefgrulers} option. The differences:
+% \begin{itemize}
+% \item \texttt{type=none} does not kill the \verb|\fgruler| command and the \texttt{showframe} option.
+% \item \texttt{type=none} is alterable in any point of the document.
+% \item \texttt{type=none} works in document environment, too.
+% \item The \texttt{fgruler} package loads the \texttt{eso-pic} package, if you use the \texttt{type=none} option without \texttt{nonefgrulers}.
+% \end{itemize}
+% \end{description}
+% 
+% \section{Drawing square rulers on the foreground of a given page}\label{sec:givenpage}
+% \begin{description}
+% \item\commandinline|\fgruler[!<unit!>]{!<type name>!}{!<hshift>!}{!<vshift>!}|\\
+% It draws a square ruler on the foreground of that page, where this command is expanded.
+% You can use more \verb|\fgruler| commands in the same page.
+% 
+% The package options (see Section \ref{sec:options}) also work on this command, except for \texttt{unit}, \texttt{type}, \texttt{hshift} and \texttt{vshift}, since these are the parameters of the \verb|\fgruler|.
+% 
+% If you use \texttt{nonefgrulers} option in preamble, then this command is effectless.
+% \begin{description}
+% \item\commandinline|!<unit!>| options:\\
+% \commandinline|cm| Metric ruler (centimeter). Default option.\\
+% \commandinline|in| English ruler (inch).
+% 
+% \item\commandinline|!<type name!>| parameters:\\
+% \commandinline|upperleft | Origin: upper left corner. Directions: down and right.\\
+% \commandinline|upperright| Origin: upper right corner. Directions: down and left.\\
+% \commandinline|lowerleft | Origin: lower left corner. Directions: up and right.\\
+% \commandinline|lowerright| Origin: lower right corner. Directions: up and left.
+% 
+% \item\commandinline|!<hshift>!|
+% Horizontal shift.
+% The shift direction is right, if the \commandinline|!<type name>!| is \verb|upperleft| or \verb|lowerleft|, otherwise it is left.
+% 
+% \item\commandinline|!<vshift>!|
+% Vertical shift.
+% The shift direction is down, if the \commandinline|!<type name>!| is \verb|upperleft| or \verb|upperright|, otherwise it is up.
+% 
+% \item Example:
+% \verb|\fgruler[in]{upperright}{1in}{2.5in}|
+% \end{description}
+% \end{description}
+% 
+% \section{Drawing rulers in the text}\label{sec:intext}
+% \begin{description}
+% \item\commandinline|\ruler[!<unit!>]{!<type name>!}{!<length>!}|\\
+% It draws a horizontal or a vertical ruler.
+% The bottom of the ruler is aligned to the baseline of the surrounding text.
+% The package options (see Section \ref{sec:options}) do not work on this command.
+% \begin{description}
+% \item\commandinline|!<unit!>| options:\\
+% \commandinline|cm| Metric ruler (centimeter). Default option.\\
+% \commandinline|in| English ruler (inch).
+% 
+% \item\commandinline|!<type name!>| parameters:\\
+% \commandinline|downright | Direction: down. The numbers are on the right side.\\
+% \commandinline|downleft  | Direction: down. The numbers are on the left side.\\
+% \commandinline|upright   | Direction: up. The numbers are on the right side.\\
+% \commandinline|upleft    | Direction: up. The numbers are on the left side.\\
+% \commandinline|rightdown | Direction: right. The numbers are on the down side.\\
+% \commandinline|rightup   | Direction: right. The numbers are on the up side.\\
+% \commandinline|leftdown  | Direction: left. The numbers are on the down side.\\
+% \commandinline|leftup    | Direction: left. The numbers are on the up side.
+% 
+% \item\commandinline|!<length>!|
+% Ruler length.
+% 
+% \item Example:
+% \verb|\ruler{rightdown}{5cm}|
+% \ruler{rightdown}{5cm}
+% \end{description}
+% 
+% \item\commandinline|\ruler*[!<unit!>]{!<type name>!}{!<length>!}|\\
+% It works like \verb|\ruler|, but the top of the ruler is aligned to the baseline of the surrounding text.
+% 
+% Example:
+% \verb|\ruler*{rightdown}{5cm}|
+% \ruler*{rightdown}{5cm}
+% 
+% \item\commandinline|\squareruler[!<unit!>]{!<type name>!}{!<width>!}{!<height>!}|\\
+% It draws a square ruler.
+% The bottom of the square ruler is aligned to the baseline of the surrounding text.
+% The package options (see Section \ref{sec:options}) do not work on this command.
+% \begin{description}
+% \item\commandinline|!<unit!>| options:\\
+% \commandinline|cm| Metric ruler (centimeter). Default option.\\
+% \commandinline|in| English ruler (inch).
+% 
+% \item\commandinline|!<type name!>| parameters:\\
+% \commandinline|upperleft | Directions: down and right.\\
+% \commandinline|upperright| Directions: down and left.\\
+% \commandinline|lowerleft | Directions: up and right.\\
+% \commandinline|lowerright| Directions: up and left.
+% 
+% \item\commandinline|!<width>!|
+% Square ruler width.
+% 
+% \item\commandinline|!<height>!|
+% Square ruler height.
+% 
+% \item Example:
+% \verb|\squareruler{upperleft}{5cm}{1cm}|
+% \squareruler{upperleft}{5cm}{1cm}
+% \end{description}
+% 
+% \item\commandinline|\squareruler*[!<unit!>]{!<type name>!}{!<width>!}{!<height>!}|\\
+% It works like \verb|\squareruler|, but the top of the square ruler is aligned to the baseline of the surrounding text.
+% 
+% Example:
+% \verb|\squareruler*{upperleft}{5cm}{1cm}|
+% \squareruler*{upperleft}{5cm}{1cm}
+% 
+% \item\commandinline|\rulerparams{!<markthick>!}{!<numfont>!}{!<color>!}{!<marklength>!}{!<numsep>!}|\\
+% It sets the parameters of the rulers, which are drawn by \verb|\ruler| or \verb|\squareruler|. 
+% If an argument is empty, then that parameter will not be changed.
+% \begin{description}
+% \item\commandinline|!<markthick>!| Mark thickness. Default: \verb|0.4pt|
+% \item\commandinline|!<numfont>!| Number font type. Default: \verb|\scriptsize\sffamily|
+% \item\commandinline|!<color>!| Ruler line color. Default: \verb|black|
+% \item\commandinline|!<marklength>!| Mark length at integer units. Default: \verb|2mm|
+% \item\commandinline|!<numsep>!| Separation between number and ruler. Default: \verb|3pt|
+% \item For example, \verb|\rulerparams{}{}{red}{}{}| changes the ruler color to red.
+% \end{description}
+% 
+% \item\commandinline|\rulernorotatenum|\\
+% By default, the numbers of the vertical rulers (which were generated by \verb|\ruler| or \verb|\squareruler|) are rotated by 90$^\circ$.
+% It kills this action.
+% This command is usable only in \texttt{document} environment.
+% 
+% Example: \verb|\ruler{upright}{1cm}| \ruler{upright}{1cm}\\
+% but
+% \verb|{\rulernorotatenum\ruler{upright}{1cm}}|
+% {\rulernorotatenum\ruler{upright}{1cm}}
+% 
+% \item\commandinline|\rulerrotatenum|\\
+% After \verb|\rulernorotatenum|, it reactivates the number rotating.
+% This command is usable only in \texttt{document} environment.
+% \end{description}
+% 
+% \section{Additional setting commands}\label{sec:additional}
+% The following commands can work on all of the rulers, which are drawn by \texttt{fgruler} package.
+% \begin{description}
+% \item\commandinline|\fgrulerstartnum{!<num>!}|\\
+% The \commandinline|!<num>!| is a nonnegative integer, which will be the starting number on the ruler.
+% Default: \verb|\fgrulerstartnum{0}|
+% 
+% Example: \verb|{\fgrulerstartnum{5}\ruler{rightup}{3cm}}| {\fgrulerstartnum{5}\ruler{rightup}{3cm}}
+% 
+% \item\commandinline|\fgrulernoborderline|\\
+% By default, there is a borderline on one side of the ruler.
+% It disappears by this command.
+% 
+% Example: \verb|\ruler{rightup}{3cm}| \ruler{rightup}{3cm}\\
+% but
+% \verb|{\fgrulernoborderline\ruler{rightup}{3cm}}|
+% {\fgrulernoborderline\ruler{rightup}{3cm}}
+% 
+% \item\commandinline|\fgrulerborderline|\\
+% After \verb|\fgrulernoborderline|, it reactivates the previous default effect.
+% 
+% \item\commandinline|\fgrulercaptioncm{!<caption>!}|\\
+% Unit caption in metric ruler.
+% Default: \verb|\fgrulercaptioncm{cm}|
+% 
+% Example: \verb|\ruler{rightup}{3cm}| \ruler{rightup}{3cm}\\ 
+% but
+% \verb|{\fgrulercaptioncm{}\ruler{rightup}{3cm}}|
+% {\fgrulercaptioncm{}\ruler{rightup}{3cm}}
+% 
+% \item\commandinline|\fgrulercaptionin{!<caption>!}|\\
+% Unit caption in English ruler.
+% Default: \verb|\fgrulercaptionin{inch}|
+% 
+% \item\commandinline|\fgrulerdefnum{!<definition>!}|\\
+% The ruler numbers are determined by the \commandinline|fgrulernum| counter.
+% Its current value is printed by the \commandinline|\thefgrulernum|.
+% Its default definition is \verb|\def\thefgrulernum{\arabic{fgrulernum}}|, which is equivalent to \verb|\fgrulerdefnum{\arabic{fgrulernum}}|.
+% 
+% Example:\\
+% \verb|{\fgrulerdefnum{}\fgrulercaptioncm{}\ruler{rightdown}{2cm}}|
+% {\fgrulerdefnum{}\fgrulercaptioncm{}\ruler{rightdown}{2cm}}
+% 
+% \item\commandinline|\fgrulerratiocm{!<ratio1>!}{!<ratio2>!}|\\
+% Mark length ratios in metric rulers.
+% If an argument is empty, then that parameter will not be changed.
+% \begin{description}
+% \item\commandinline|!<ratio1>!|
+% Mark length ratio at $k/10$\,cm, where $k$ is positive integer and not divisible by 5.\\
+% {\fgrulerthickcm{1pt}{}{}\fgrulercolorcm{red}{}{}\ruler{rightup}{3cm}}\\
+% For example, if this ratio is 0.5 and the mark length at integer unit is 2\,mm, then this mark length will be $0.5\cdot 2\,\mathrm{mm}=1\,\mathrm{mm}$.
+% 
+% \item\commandinline|!<ratio2>!|
+% Mark length ratio at $k/2$\,cm, where $k$ is positive odd integer.\\
+% {\fgrulerthickcm{}{1pt}{}\fgrulercolorcm{}{red}{}\ruler{rightup}{3cm}}
+% 
+% \item Default: \verb|\fgrulerratiocm{0.5}{0.75}|
+% \end{description}
+% 
+% \item\commandinline|\fgrulerratioin{!<ratio1>!}{!<ratio2>!}{!<ratio3>!}{!<ratio4>!}|\\
+% Mark length ratios in English rulers.
+% If an argument is empty, then that parameter will not be changed.
+% \begin{description}
+% \item\commandinline|!<ratio1>!|
+% Mark length ratio at $k/16$\,inch, where $k$ is positive odd integer.\\
+% {\fgrulerthickin{1pt}{}{}{}{}\fgrulercolorin{red}{}{}{}{}\ruler[in]{rightup}{2in}}
+% 
+% \item\commandinline|!<ratio2>!|
+% Mark length ratio at $k/8$\,inch, where $k$ is positive odd integer.\\
+% {\fgrulerthickin{}{1pt}{}{}{}\fgrulercolorin{}{red}{}{}{}\ruler[in]{rightup}{2in}}
+% 
+% \item\commandinline|!<ratio3>!|
+% Mark length ratio at $k/4$\,inch, where $k$ is positive odd integer.\\
+% {\fgrulerthickin{}{}{1pt}{}{}\fgrulercolorin{}{}{red}{}{}\ruler[in]{rightup}{2in}}
+% 
+% \item\commandinline|!<ratio4>!|
+% Mark length ratio at $k/2$\,inch, where $k$ is positive odd integer.\\
+% {\fgrulerthickin{}{}{}{1pt}{}\fgrulercolorin{}{}{}{red}{}\ruler[in]{rightup}{2in}}
+% 
+% \item Default: \verb|\fgrulerratioin{0.25}{0.375}{0.625}{0.75}|
+% \end{description}
+% 
+% \item\commandinline|\fgrulerthickcm{!<thick1>!}{!<thick2>!}{!<thick3>!}|\\
+% Mark thicknesses in metric rulers.
+% If an argument is empty, then that parameter will not be changed.
+% \begin{description}
+% \item\commandinline|!<thick1>!|
+% Mark thickness at $k/10$\,cm, where $k$ is positive integer and not divisible by 5.
+% 
+% \item\commandinline|!<thick2>!|
+% Mark thickness at $k/2$\,cm, where $k$ is positive odd integer.
+% 
+% \item\commandinline|!<thick3>!|
+% Mark thickness at integer units.
+% 
+% \item The default values are given by \commandinline|!<markthick>!| of \verb|\rulerparams|, respectively by \texttt{markthick} option.
+% 
+% \item Example:\\
+% \verb|{\fgrulerthickcm{}{}{2pt}|\\
+% \verb|\rulerparams{}{}{}{5mm}{}|\\
+% \verb|\fgrulernoborderline|\\
+% \verb|\ruler{rightdown}{3cm}}|\\[2mm]
+% {\fgrulerthickcm{}{}{2pt}
+% \rulerparams{}{}{}{5mm}{}
+% \fgrulernoborderline
+% \ruler{rightdown}{3cm}}
+% \end{description}
+% 
+% \item\commandinline|\fgrulerthickin{!<thick1>!}{!<thick2>!}{!<thick3>!}{!<thick4>!}{!<thick5>!}|\\
+% Mark thicknesses in English rulers.
+% If an argument is empty, then that parameter will not be changed.
+% \begin{description}
+% \item\commandinline|!<thick1>!|
+% Mark thickness at $k/16$\,inch, where $k$ is positive odd integer.
+% 
+% \item\commandinline|!<thick2>!|
+% Mark thickness at $k/8$\,inch, where $k$ is positive odd integer.
+% 
+% \item\commandinline|!<thick3>!|
+% Mark thickness at $k/4$\,inch, where $k$ is positive odd integer.
+% 
+% \item\commandinline|!<thick4>!|
+% Mark thickness at $k/2$\,inch, where $k$ is positive odd integer.
+% 
+% \item\commandinline|!<thick5>!|
+% Mark thickness at integer units.
+% 
+% \item The default values are given by \commandinline|!<markthick>!| of \verb|\rulerparams|, respectively by \texttt{markthick} option.
+% 
+% \item Example:\\
+% \verb|{\fgrulerthickin{}{}{}{}{2pt}|\\
+% \verb|\rulerparams{}{}{}{5mm}{}|\\
+% \verb|\fgrulernoborderline|\\
+% \verb|\ruler[in]{rightdown}{3in}}|\\[2mm]
+% {\fgrulerthickin{}{}{}{}{2pt}
+% \rulerparams{}{}{}{5mm}{}
+% \fgrulernoborderline
+% \ruler[in]{rightdown}{3in}}
+% \end{description}
+% 
+% \item\commandinline|\fgrulercolorcm{!<color1>!}{!<color2>!}{!<color3>!}|\\
+% Mark colors in metric rulers.
+% If an argument is empty, then that parameter will not be changed.
+% \begin{description}
+% \item\commandinline|!<color1>!|
+% Mark color at $k/10$\,cm, where $k$ is positive integer and not divisible by 5.
+% 
+% \item\commandinline|!<color2>!|
+% Mark color at $k/2$\,cm, where $k$ is positive odd integer.
+% 
+% \item\commandinline|!<color3>!|
+% Mark color at integer units.
+% 
+% \item The default values are given by \commandinline|!<color>!| of \verb|\rulerparams|, respectively by \texttt{color} option.
+% 
+% \item Example:\\
+% \verb|{\fgrulercolorcm{green}{blue}{red}|\\
+% \verb|\rulerparams{1pt}{}{}{5mm}{}|\\
+% \verb|\fgrulernoborderline|\\
+% \verb|\ruler{rightdown}{3cm}}|\\[2mm]
+% {\fgrulernoborderline
+% \fgrulercolorcm{green}{blue}{red}
+% \rulerparams{1pt}{}{}{5mm}{}
+% \ruler{rightdown}{3cm}}
+% \end{description}
+% 
+% \item\commandinline|\fgrulercolorin{!<color1>!}{!<color2>!}{!<color3>!}{!<color4>!}{!<color5>!}|\\
+% Mark color in English rulers.
+% If an argument is empty, then that parameter will not be changed.
+% \begin{description}
+% \item\commandinline|!<color1>!|
+% Mark color at $k/16$\,inch, where $k$ is positive odd integer.
+% 
+% \item\commandinline|!<color2>!|
+% Mark color at $k/8$\,inch, where $k$ is positive odd integer.
+% 
+% \item\commandinline|!<color3>!|
+% Mark color at $k/4$\,inch, where $k$ is positive odd integer.
+% 
+% \item\commandinline|!<color4>!|
+% Mark color at $k/2$\,inch, where $k$ is positive odd integer.
+% 
+% \item\commandinline|!<color5>!|
+% Mark color at integer units.
+% 
+% \item The default values are given by \commandinline|!<color>!| of \verb|\rulerparams|, respectively by \texttt{color} option.
+% 
+% \item Example:\\
+% \verb|{\fgrulercolorin{yellow}{orange}{green}{blue}{red}|\\
+% \verb|\rulerparams{1pt}{}{}{5mm}{}|\\
+% \verb|\fgrulernoborderline|\\
+% \verb|\ruler[in]{rightdown}{3in}}|\\[2mm]
+% {\fgrulernoborderline
+% \fgrulercolorin{yellow}{orange}{green}{blue}{red}
+% \rulerparams{1pt}{}{}{5mm}{}
+% \ruler[in]{rightdown}{3in}}
+% \end{description}
+% 
+% \item\commandinline|\fgrulerreset|\\
+% It sets all options and parameters to default values.
+% This command is usable only in \texttt{document} environment.
+% \end{description}
+% 
+% \medskip\noindent\textcolor{red}{\faWarning}
+% All setting commands\footnote{Namely \verb|\setfgruler|, \verb|\rulerparams|, \verb|\rulernorotatenum|, \verb|\rulerrotatenum|, furthermore all commands in this section.} obey the normal scoping rules, i.e.\ if you use them inside a group, then the changing of the parameters is not valid outside the group.
+% 
+% \newpage\fgrulerreset
+% \section{Examples}
+% \subsection{Deafult case}
+% The output of the following code is the ruler in this page. It is the default case.
+% \begin{examplelst}
+% \documentclass{article}
+% \usepackage{fgruler}
+% \begin{document}
+% % ...
+% \end{document}
+% \end{examplelst}
+% 
+% \newpage\fgrulerreset
+% \subsection{The showframe option}
+% \setfgruler{color=red,showframe}
+% \begin{examplelst}
+% \documentclass{article}
+% \usepackage[color=red,showframe]{fgruler}
+% \begin{document}
+% % ...
+% \end{document}
+% \end{examplelst}
+% 
+% \newpage\fgrulerreset
+% \subsection{Shifting}
+% \setfgruler{hshift=1cm,vshift=2cm}
+% \begin{examplelst}
+% \documentclass{article}
+% \usepackage[hshift=1cm,vshift=2cm]{fgruler}
+% \begin{document}
+% % ...
+% \end{document}
+% \end{examplelst}
+% 
+% \newpage\fgrulerreset
+% \subsection{Shifting in case type=upperright}
+% \setfgruler{type=upperright,hshift=1cm,vshift=2cm}
+% \begin{examplelst}
+% \documentclass{article}
+% \usepackage[type=upperright,hshift=1cm,vshift=2cm]{fgruler}
+% \begin{document}
+% % ...
+% \end{document}
+% \end{examplelst}
+% 
+% \newpage\fgrulerreset
+% \subsection{Shifting in case type=lowerleft}
+% \setfgruler{type=lowerleft,hshift=1cm,vshift=2cm}
+% \begin{examplelst}
+% \documentclass{article}
+% \usepackage[type=lowerleft,hshift=1cm,vshift=2cm]{fgruler}
+% \begin{document}
+% % ...
+% \end{document}
+% \end{examplelst}
+% 
+% \newpage\fgrulerreset
+% \subsection{Shifting in case type=lowerright}
+% \setfgruler{type=lowerright,hshift=1cm,vshift=2cm}
+% \begin{examplelst}
+% \documentclass{article}
+% \usepackage[type=lowerright,hshift=1cm,vshift=2cm]{fgruler}
+% \begin{document}
+% % ...
+% \end{document}
+% \end{examplelst}
+% 
+% \newpage\fgrulerreset
+% \subsection{Rulers on the foreground of a given page, and in text}
+% \setfgruler{color=blue}
+% \fgruler{upperleft}{1cm}{1.5cm}
+% \noindent
+% text
+% \rulerparams{}{\color{red}\tiny\ttfamily}{green}{}{}
+% {\fgrulernoborderline\ruler{rightdown}{3cm}}
+% text
+% \ruler*{rightdown}{3cm}
+% text
+% \rotatebox[origin=tl]{30}{\ruler*{rightdown}{3cm}}
+% 
+% \bigskip
+% \begin{examplelst}
+% \documentclass{article}
+% \usepackage[color=blue]{fgruler}
+% \begin{document}
+%     \fgruler{upperleft}{1cm}{1.5cm}
+%     \noindent
+%     text
+%     \rulerparams{}{\color{red}\tiny\ttfamily}{green}{}{}
+%     {\fgrulernoborderline\ruler{rightdown}{3cm}}
+%     text
+%     \ruler*{rightdown}{3cm}
+%     text
+%     \rotatebox[origin=tl]{30}{\ruler*{rightdown}{3cm}}
+% \end{document}
+% \end{examplelst}
+% \emph{Remark.} The \verb|\rotatebox| command is defined in the \texttt{graphicx} package!
+% 
+% \newpage\fgrulerreset
+% \subsection{Ruler types in text}
+% \setfgruler{type=none}
+% \noindent
+% \rulerparams{}{}{red}{}{1pt}
+% \ruler{rightdown}{3cm}
+% \hfill
+% \ruler{rightup}{3cm}
+% \hfill
+% \ruler{leftup}{3cm}
+% \hfill
+% \ruler{leftdown}{3cm}
+% 
+% \bigskip\noindent
+% \rulerparams{}{}{green}{}{}
+% {\rulernorotatenum\ruler{upright}{3cm}}
+% \hfill
+% \ruler{downright}{3cm}
+% \hfill
+% \ruler{upleft}{3cm}
+% \hfill
+% \ruler{downleft}{3cm}
+% 
+% \bigskip\noindent
+% \rulerparams{}{}{blue!50!black}{}{}
+% {\rulernorotatenum\fgrulercaptioncm{}\squareruler{upperleft}{2cm}{3cm}}
+% \hfill
+% \squareruler{lowerright}{2cm}{3cm}
+% \hfill
+% \squareruler{lowerleft}{2cm}{3cm}
+% \hfill
+% \squareruler{upperright}{2cm}{3cm}
+% \hfill
+% {\rulerparams{}{\footnotesize\bfseries\color{red}}{}{5mm}{-8pt}\squareruler[in]{lowerleft}{2in}{3cm}}
+% 
+% \bigskip
+% \begin{examplelst}
+% \documentclass{article}
+% \usepackage[nonefgrulers]{fgruler}
+% \begin{document}
+%     \noindent
+%     \rulerparams{}{}{red}{}{1pt}
+%     \ruler{rightdown}{3cm}
+%     \hfill
+%     \ruler{rightup}{3cm}
+%     \hfill
+%     \ruler{leftup}{3cm}
+%     \hfill
+%     \ruler{leftdown}{3cm}
+%     
+%     \bigskip\noindent
+%     \rulerparams{}{}{green}{}{}
+%     {\rulernorotatenum\ruler{upright}{3cm}}
+%     \hfill
+%     \ruler{downright}{3cm}
+%     \hfill
+%     \ruler{upleft}{3cm}
+%     \hfill
+%     \ruler{downleft}{3cm}
+%     
+%     \bigskip\noindent
+%     \rulerparams{}{}{blue!50!black}{}{}
+%     {\rulernorotatenum\fgrulercaptioncm{}\squareruler{upperleft}{2cm}{3cm}}
+%     \hfill
+%     \squareruler{lowerright}{2cm}{3cm}
+%     \hfill
+%     \squareruler{lowerleft}{2cm}{3cm}
+%     \hfill
+%     \squareruler{upperright}{2cm}{3cm}
+%     \hfill
+%     {\rulerparams{}{\footnotesize\bfseries\color{red}}{}{5mm}{-8pt}
+%     \squareruler[in]{lowerleft}{2in}{3cm}}
+% \end{document}
+% \end{examplelst}
+% 
+% \newpage\fgrulerreset
+% \subsection{Mark length and rotating}
+% \setfgruler{type=none}
+% \noindent
+% {\fgrulerdefnum{\rotatebox{45}{\arabic{fgrulernum}\,cm}}
+% \fgrulercaptioncm{}
+% \rulerparams{}{\tiny\color{red}}{blue}{8mm}{}
+% \fgrulercolorcm{}{}{black}
+% \rotatebox{-45}{\ruler{rightup}{10cm}}\\
+% \ruler{rightup}{5cm}}
+% 
+% \bigskip
+% \begin{examplelst}
+% \documentclass{article}
+% \usepackage[nonefgrulers]{fgruler}
+% \begin{document}
+%     \noindent
+%     {\fgrulerdefnum{\rotatebox{45}{\arabic{fgrulernum}\,cm}}
+%     \fgrulercaptioncm{}
+%     \rulerparams{}{\tiny\color{red}}{blue}{8mm}{}
+%     \fgrulercolorcm{}{}{black}
+%     \rotatebox{-45}{\ruler{rightup}{10cm}}\\
+%     \ruler{rightup}{5cm}}
+% \end{document}
+% \end{examplelst}
+% 
+% \newpage\fgrulerreset
+% \subsection{Coordinate system}
+% \setfgruler{type=none}
+% \noindent
+% \rulernorotatenum
+% \fgrulercaptioncm{}
+% \fgrulercolorcm{}{}{red}
+% \rulerparams{}{\scriptsize\color{red}}{}{}{}
+% {\fgrulerdefnum{$-\arabic{fgrulernum}$}\squareruler*{upperright}{3cm}{3cm}}\ignorespaces
+% \squareruler{lowerleft}{13cm}{6cm}
+% 
+% \bigskip
+% \begin{examplelst}
+% \documentclass{article}
+% \usepackage[nonefgrulers]{fgruler}
+% \begin{document}
+%     \noindent
+%     \rulernorotatenum
+%     \fgrulercaptioncm{}
+%     \fgrulercolorcm{}{}{red}
+%     \rulerparams{}{\scriptsize\color{red}}{}{}{}
+%     {\fgrulerdefnum{$-\arabic{fgrulernum}$}\squareruler*{upperright}{3cm}{3cm}}%
+%     \squareruler{lowerleft}{13cm}{6cm}
+% \end{document}
+% \end{examplelst}
+% 
+% \newpage\fgrulerreset
+% \subsection{Tape measure}
+% \setfgruler{type=none}
+% 
+% \newcommand{\tapemeasure}[1]{%
+%     \parbox{#1}{%
+%     {\fgrulerdefnum{}\fgrulercaptioncm{}\ruler{rightdown}{#1}}\\[2pt]
+%     \ruler{rightup}{#1}}}
+% \noindent\ignorespaces
+% \tapemeasure{\textwidth}\\[2pt]
+% \rotatebox[origin=br]{-90}{\tapemeasure{3cm}}
+% \tapemeasure{10cm}
+% 
+% \bigskip
+% \begin{examplelst}
+% \documentclass{article}
+% \usepackage[a4paper,margin=25mm]{geometry}
+% \usepackage[nonefgrulers]{fgruler}
+% \newcommand{\tapemeasure}[1]{%
+%     \parbox{#1}{%
+%     {\fgrulerdefnum{}\fgrulercaptioncm{}\ruler{rightdown}{#1}}\\[2pt]
+%     \ruler{rightup}{#1}}}
+% \begin{document}
+%     \noindent
+%     \tapemeasure{\textwidth}\\[2pt]
+%     \rotatebox[origin=br]{-90}{\tapemeasure{3cm}}
+%     \tapemeasure{10cm}
+% \end{document}
+% \end{examplelst}
+%
+% \StopEventually
+%
+%    \begin{macrocode}
+%%
+\@ifpackageloaded{kvoptions}{}{\RequirePackage{kvoptions}}
+\@ifpackageloaded{etoolbox}{}{\RequirePackage{etoolbox}}
+
+\SetupKeyvalOptions{family=fgruler,prefix=fgruler@}
+\DeclareStringOption[.4pt]{markthick}
+\DeclareStringOption[\scriptsize\sffamily]{numfont}
+\DeclareStringOption[black]{color}
+\DeclareStringOption[2mm]{marklength}
+\DeclareStringOption[3pt]{numsep}
+\DeclareStringOption[0pt]{hshift}
+\DeclareStringOption[0pt]{vshift}
+\DeclareStringOption[upperleft]{type}
+\DeclareStringOption[cm]{unit}
+\DeclareBoolOption{nonefgrulers}
+\DeclareBoolOption{showframe}
+\ProcessKeyvalOptions{fgruler}
+
+\newlength{\fgruler at marklth}
+\newlength{\fgruler at sep}
+\newlength{\fgruler at width}
+\newlength{\fgruler at fg@width}
+\newlength{\fgruler at fg@height}
+
+\def\fgruler at set#1#2#3#4#5{%
+\def\fgruler at markthickness{\linethickness{#1}}%
+\def\fgruler at font{#2}%
+\def\fgruler at rulercolor{\color{#3}}%
+\setlength{\fgruler at marklth}{#4}%
+\setlength{\fgruler at sep}{#5}%
+\def\fgruler at font@{\normalfont\normalsize\fgruler at font}%
+\addtolength{\fgruler at sep}{\fgruler at marklth}%
+\ifx\thefgrulernum\@empty\setlength{\fgruler at width}{\fgruler at marklth}\else%
+\settoheight{\fgruler at width}{\fgruler at font@\thefgrulernum}%
+\addtolength{\fgruler at width}{\fgruler at sep}\fi}
+
+\def\rulerparams#1#2#3#4#5{%
+\ifx#1\@empty\else\def\fgruler at markthick@{#1}\fi%
+\ifx#2\@empty\else\def\fgruler at numfont@{#2}\fi%
+\ifx#3\@empty\else\def\fgruler at color@{#3}\fi%
+\ifx#4\@empty\else\def\fgruler at marklength@{#4}\fi%
+\ifx#5\@empty\else\def\fgruler at numsep@{#5}\fi%
+\ignorespaces}
+
+\rulerparams{.4pt}{\scriptsize\sffamily}{black}{2mm}{3pt}
+
+\def\fgruler at fgsetting{%
+\fgruler at set{\fgruler at markthick}{\fgruler at numfont}{\fgruler at color}{\fgruler at marklength}{\fgruler at numsep}%
+\rulernorotatenum}
+
+\def\fgruler at intextsetting{%
+\fgruler at set{\fgruler at markthick@}{\fgruler at numfont@}{\fgruler at color@}{\fgruler at marklength@}{\fgruler at numsep@}}
+
+\def\fgruler at activate@type{%
+\def\fgruler at check{cm}\ifx\fgruler at unit\fgruler at check\else%
+\def\fgruler at check{in}\ifx\fgruler at unit\fgruler at check\else%
+\@latexerr{Undefined unit: \fgruler at unit\space(Defined units: cm, in)}{}\fi\fi%
+\def\fgruler at check{upperleft}\ifx\fgruler at type\fgruler at check\else%
+\def\fgruler at check{upperright}\ifx\fgruler at type\fgruler at check\else%
+\def\fgruler at check{lowerleft}\ifx\fgruler at type\fgruler at check\else%
+\def\fgruler at check{lowerright}\ifx\fgruler at type\fgruler at check\else%
+\def\fgruler at check{none}\ifx\fgruler at type\fgruler at check\else%
+\@latexerr{Undefined type: \fgruler at type\space(Defined types: upperleft, upperright, lowerleft, lowerright, none)}{}\fi\fi\fi\fi\fi%
+\def\fgruler at output{\csname fgruler@\fgruler at unit @\fgruler at type @fg\endcsname}}
+
+\def\fgrulerratiocm#1#2{%
+\ifx#1\@empty\else\def\fgruler at cm@ratio at i{#1}\fi%
+\ifx#2\@empty\else\def\fgruler at cm@ratio at ii{#2}\fi%
+\ignorespaces}
+
+\fgrulerratiocm{.5}{.75}
+
+\def\fgrulerratioin#1#2#3#4{%
+\ifx#1\@empty\else\def\fgruler at in@ratio at i{#1}\fi%
+\ifx#2\@empty\else\def\fgruler at in@ratio at ii{#2}\fi%
+\ifx#3\@empty\else\def\fgruler at in@ratio at iii{#3}\fi%
+\ifx#4\@empty\else\def\fgruler at in@ratio at iv{#4}\fi%
+\ignorespaces}
+
+\fgrulerratioin{.25}{.375}{.625}{.75}
+
+\def\fgrulerthickcm#1#2#3{%
+\ifx#1\@empty\else\def\fgruler at cm@thick at i{\linethickness{#1}}\fi%
+\ifx#2\@empty\else\def\fgruler at cm@thick at ii{\linethickness{#2}}\fi%
+\ifx#3\@empty\else\def\fgruler at cm@thick at iii{\linethickness{#3}}\fi%
+\ignorespaces}
+
+\def\fgruler at cm@thick at i{}
+\def\fgruler at cm@thick at ii{}
+\def\fgruler at cm@thick at iii{}
+
+\def\fgrulerthickin#1#2#3#4#5{%
+\ifx#1\@empty\else\def\fgruler at in@thick at i{\linethickness{#1}}\fi%
+\ifx#2\@empty\else\def\fgruler at in@thick at ii{\linethickness{#2}}\fi%
+\ifx#3\@empty\else\def\fgruler at in@thick at iii{\linethickness{#3}}\fi%
+\ifx#4\@empty\else\def\fgruler at in@thick at iv{\linethickness{#4}}\fi%
+\ifx#5\@empty\else\def\fgruler at in@thick at v{\linethickness{#5}}\fi%
+\ignorespaces}
+
+\def\fgruler at in@thick at i{}
+\def\fgruler at in@thick at ii{}
+\def\fgruler at in@thick at iii{}
+\def\fgruler at in@thick at iv{}
+\def\fgruler at in@thick at v{}
+
+\def\fgrulercolorcm#1#2#3{%
+\ifx#1\@empty\else\def\fgruler at cm@color at i{\color{#1}}\fi%
+\ifx#2\@empty\else\def\fgruler at cm@color at ii{\color{#2}}\fi%
+\ifx#3\@empty\else\def\fgruler at cm@color at iii{\color{#3}}\fi%
+\ignorespaces}
+
+\def\fgruler at cm@color at i{}
+\def\fgruler at cm@color at ii{}
+\def\fgruler at cm@color at iii{}
+
+\def\fgrulercolorin#1#2#3#4#5{%
+\ifx#1\@empty\else\def\fgruler at in@color at i{\color{#1}}\fi%
+\ifx#2\@empty\else\def\fgruler at in@color at ii{\color{#2}}\fi%
+\ifx#3\@empty\else\def\fgruler at in@color at iii{\color{#3}}\fi%
+\ifx#4\@empty\else\def\fgruler at in@color at iv{\color{#4}}\fi%
+\ifx#5\@empty\else\def\fgruler at in@color at v{\color{#5}}\fi%
+\ignorespaces}
+
+\def\fgruler at in@color at i{}
+\def\fgruler at in@color at ii{}
+\def\fgruler at in@color at iii{}
+\def\fgruler at in@color at iv{}
+\def\fgruler at in@color at v{}
+
+\def\setfgruler#1{\setkeys{fgruler}{#1}\fgruler at activate@type\ignorespaces}
+
+\newcommand\fgruler at div[2]{%
+\@tempdima=#1\relax\@tempdimb=\unitlength\relax
+\@tempdimb=#2\@tempdimb\divide\@tempdima by \@tempdimb
+\@tempcnta\@tempdima\advance\@tempcnta\@ne}
+
+\def\fgruler at check@param#1#2{%
+\def\fgruler at param{#1}%
+\def\fgruler at check{cm}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{in}\ifx\fgruler at param\fgruler at check\else%
+\@latexerr{Invalid parameter: \fgruler at param\space(Defined parameters: cm, in)}{}%
+\fi\fi%
+\def\fgruler at param{#2}%
+\def\fgruler at check{rightdown}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{rightup}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{leftdown}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{leftup}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{downright}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{downleft}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{upright}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{upleft}\ifx\fgruler at param\fgruler at check\else%
+\@latexerr{Invalid parameter: \fgruler at param\space(Defined parameters: rightdown, rightup, leftdown, leftup, downright, downleft, upright, upleft)}{}%
+\fi\fi\fi\fi\fi\fi\fi\fi}
+
+\def\fgruler at check@param@#1#2{%
+\def\fgruler at param{#1}%
+\def\fgruler at check{cm}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{in}\ifx\fgruler at param\fgruler at check\else%
+\@latexerr{Invalid parameter: \fgruler at param\space(Defined parameters: cm, in)}{}%
+\fi\fi%
+\def\fgruler at param{#2}%
+\def\fgruler at check{upperleft}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{upperright}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{lowerleft}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{lowerright}\ifx\fgruler at param\fgruler at check\else%
+\@latexerr{Invalid parameter: \fgruler at param\space(Defined parameters: upperleft, upperright, lowerleft, lowerright)}{}%
+\fi\fi\fi\fi}
+
+\newcommand{\fgruler at ruler}[3][cm]{\fgruler at check@param{#1}{#2}\fgruler at intextsetting\csname fgruler@#1@#2@\endcsname{#3}}
+\newcommand{\fgruler at ruler@}[3][cm]{\fgruler at check@param{#1}{#2}\fgruler at intextsetting\csname fgruler@#1@#2@@\endcsname{#3}}
+\def\ruler{\@ifstar{\fgruler at ruler@}{\fgruler at ruler}}
+
+\newcommand{\fgruler at squareruler}[4][cm]{\fgruler at check@param@{#1}{#2}\fgruler at intextsetting\csname fgruler@#1@#2@\endcsname{#3}{#4}}
+\newcommand{\fgruler at squareruler@}[4][cm]{\fgruler at check@param@{#1}{#2}\fgruler at intextsetting\csname fgruler@#1@#2@@\endcsname{#3}{#4}}
+\def\squareruler{\@ifstar{\fgruler at squareruler@}{\fgruler at squareruler}}
+
+\newcommand{\fgruler}[4][cm]{\fgruler at check@param@{#1}{#2}\g at addto@macro\fgruler at output@{\csname fgruler@#1@#2 at fg@\endcsname{#3}{#4}}}
+
+\def\fgrulercaptioncm#1{\def\fgruler at caption@cm{#1}\ignorespaces}
+\def\fgruler at caption@cm{cm}
+\def\fgrulercaptionin#1{\def\fgruler at caption@in{#1}\ignorespaces}
+\def\fgruler at caption@in{inch}
+
+\newif\iffgruler at borderline
+\def\fgrulernoborderline{\fgruler at borderlinefalse\ignorespaces}
+\def\fgrulerborderline{\fgruler at borderlinetrue\ignorespaces}
+\fgruler at borderlinetrue
+
+\newcounter{fgrulernum}
+\newcounter{fgruler at check}
+
+\def\fgruler at ifnot@divisible at five#1{%
+\setcounter{fgruler at check}{\value{fgrulernum}}%
+\divide\value{fgruler at check}by5\relax%
+\multiply\value{fgruler at check}by5\relax%
+\ifnum\value{fgruler at check}=\value{fgrulernum}\else#1\fi\stepcounter{fgrulernum}}
+
+\def\fgruler at ifodd#1{\ifodd\value{fgrulernum}#1\fi\stepcounter{fgrulernum}}
+
+\def\fgruler at lentounit#1{\strip at pt\dimexpr#1*\p@/\unitlength}
+
+\def\fgrulerstartnum#1{\def\fgruler at startnum{#1}\ignorespaces}
+\def\fgruler at startnum{0}
+
+\def\fgrulerdefnum#1{\def\thefgrulernum{#1}\ignorespaces}
+
+\def\fgruler at rotatebox#1#2{#2}%
+
+\def\rulernorotatenum{%
+\ifx\@onlypreamble\@notprerr%
+\def\fgruler at rotatebox##1##2{##2}%
+\else\@latexerr{Don't use \protect\rulernorotatenum\space in preamble!}{}\fi%
+\ignorespaces}
+
+\def\rulerrotatenum{%
+\ifx\@onlypreamble\@notprerr%
+\def\fgruler at rotatebox##1##2{\rotatebox{##1}{##2}}%
+\else\@latexerr{Don't use \protect\rulerrotatenum\space in preamble!}{}\fi%
+\ignorespaces}
+
+\def\fgrulerreset{%
+\ifx\@onlypreamble\@notprerr%
+\def\fgruler at cm@ratio at i{.5}%
+\def\fgruler at cm@ratio at ii{.75}%
+\def\fgruler at in@ratio at i{.25}%
+\def\fgruler at in@ratio at ii{.375}%
+\def\fgruler at in@ratio at iii{.625}%
+\def\fgruler at in@ratio at iv{.75}%
+\def\fgruler at cm@thick at i{}%
+\def\fgruler at cm@thick at ii{}%
+\def\fgruler at cm@thick at iii{}%
+\def\fgruler at in@thick at i{}%
+\def\fgruler at in@thick at ii{}%
+\def\fgruler at in@thick at iii{}%
+\def\fgruler at in@thick at iv{}%
+\def\fgruler at in@thick at v{}%
+\def\fgruler at cm@color at i{}%
+\def\fgruler at cm@color at ii{}%
+\def\fgruler at cm@color at iii{}%
+\def\fgruler at in@color at i{}%
+\def\fgruler at in@color at ii{}%
+\def\fgruler at in@color at iii{}%
+\def\fgruler at in@color at iv{}%
+\def\fgruler at in@color at v{}%
+\def\fgruler at rotatebox##1##2{\rotatebox{##1}{##2}}%
+\def\fgruler at markthick@{.4pt}%
+\def\fgruler at numfont@{\scriptsize\sffamily}%
+\def\fgruler at color@{black}%
+\def\fgruler at marklength@{2mm}%
+\def\fgruler at numsep@{3pt}%
+\def\fgruler at type{upperleft}%
+\def\fgruler at unit{cm}%
+\def\fgruler at markthick{.4pt}%
+\def\fgruler at numfont{\scriptsize\sffamily}%
+\def\fgruler at color{black}%
+\def\fgruler at marklength{2mm}%
+\def\fgruler at hshift{0pt}%
+\def\fgruler at vshift{0pt}%
+\def\fgruler at numsep{3pt}%
+\def\thefgrulernum{\arabic{fgrulernum}}%
+\def\fgruler at caption@cm{cm}%
+\def\fgruler at caption@in{inch}%
+\def\fgruler at startnum{0}%
+\fgruler at borderlinetrue%
+\fgruler at showframefalse%
+\else\@latexerr{Don't use \protect\fgrulerreset\space in preamble!}{}\fi%
+\ignorespaces}
+
+\AtEndPreamble{
+
+\@ifpackageloaded{xcolor}{}{\RequirePackage{xcolor}}
+\@ifpackageloaded{graphicx}{}{\RequirePackage{graphicx}}
+
+\def\fgruler at rotatebox#1#2{\rotatebox{#1}{#2}}
+
+\iffgruler at nonefgrulers
+
+\renewcommand{\fgruler}[4][cm]{}
+\providecommand{\AtPageLowerLeft}[1]{#1}
+
+\else
+
+\@ifpackageloaded{eso-pic}{}{\RequirePackage{eso-pic}}
+
+\def\fgruler at frame{%
+  \begingroup
+    \fgruler at fgsetting
+    \fgruler at rulercolor%
+    \fgruler at markthickness%
+    \AtPageLowerLeft{%
+      \framebox(\fgruler at lentounit{\paperwidth},\fgruler at lentounit{\paperheight}){}}%
+    \AtTextLowerLeft{%
+      \framebox(\fgruler at lentounit{\textwidth},\fgruler at lentounit{\textheight}){}}%
+    \AtTextUpperLeft{%
+      \put(0,\fgruler at lentounit{\headsep}){%
+        \framebox(\fgruler at lentounit{\textwidth},\fgruler at lentounit{\headheight}){}}}%
+    \AtTextLowerLeft{%
+      \put(0,\fgruler at lentounit{-\footskip}){%
+        \line(1,0){\fgruler at lentounit{\textwidth}}}}%
+    \AtTextLowerLeft{%
+      \@tempdima=\textwidth\advance\@tempdima\marginparsep%
+      \if at twoside
+        \ifodd\c at page\else
+          \if at mparswitch
+            \@tempdima=-\marginparsep\advance\@tempdima-\marginparwidth
+          \fi
+        \fi
+      \fi
+      \put(\fgruler at lentounit{\@tempdima},0)%
+        {\framebox(\fgruler at lentounit{\marginparwidth},\fgruler at lentounit{\textheight}){}}%
+    }%
+  \endgroup
+}
+
+\let\fgruler at shipout\AtBeginShipoutUpperLeftForeground
+\def\fgruler at output@{}
+\ESO at isMEMOIR{%
+\def\AtBeginShipoutUpperLeftForeground#1{%
+    \fgruler at shipout{#1%
+        \put(\fgruler at lentounit{\@tempdima},\fgruler at lentounit{\@tempdimb}){%
+            \iffgruler at showframe\fgruler at frame\fi%
+            \fgruler at output%
+            \fgruler at output@%
+            \global\let\fgruler at output@\@empty%
+            }%
+        }%
+    }%
+}{%
+\def\AtBeginShipoutUpperLeftForeground#1{%
+    \fgruler at shipout{#1%
+        \put(0,\fgruler at lentounit{\ESO at yoffsetI}){%
+            \iffgruler at showframe\fgruler at frame\fi%
+            \fgruler at output%
+            \fgruler at output@%
+            \global\let\fgruler at output@\@empty%
+            }%
+        }%
+    }%
+}
+
+\fgruler at activate@type
+
+\fi
+}
+
+%% RIGHTDOWN CM
+\def\fgruler at cm@rightdown#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(1,0){\@tempcnta}{\fgruler at ifnot@divisible at five{\fgruler at cm@thick at i\fgruler at cm@color at i\line(0,-1){\fgruler at lentounit{\fgruler at cm@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{5}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(5,0){\@tempcnta}{\fgruler at ifodd{\fgruler at cm@thick at ii\fgruler at cm@color at ii\line(0,-1){\fgruler at lentounit{\fgruler at cm@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{10}%
+\multiput(0,0)(10,0){\@tempcnta}{\fgruler at cm@thick at iii\fgruler at cm@color at iii\line(0,-1){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(1,0){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(10,-\fgruler at lentounit{\fgruler at sep})(10,0){\@tempdima}{\makebox(0,0)[t]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
+
+\def\fgruler at cm@rightdown@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{\fgruler at width})(0,-\fgruler at lentounit{\fgruler at width})%
+\fgruler at cm@rightdown{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(0,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5cm\put(5,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@rightdown@@#1{\leavevmode\hbox{}\lower\fgruler at width\hbox{\fgruler at cm@rightdown@{#1}}}
+
+%% RIGHTDOWN IN
+\def\fgruler at in@rightdown#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(1,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at i\fgruler at in@color at i\line(0,-1){\fgruler at lentounit{\fgruler at in@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{2}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(2,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at ii\fgruler at in@color at ii\line(0,-1){\fgruler at lentounit{\fgruler at in@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{4}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(4,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iii\fgruler at in@color at iii\line(0,-1){\fgruler at lentounit{\fgruler at in@ratio at iii\fgruler at marklth}}}}%
+\fgruler at div{#1}{8}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(8,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iv\fgruler at in@color at iv\line(0,-1){\fgruler at lentounit{\fgruler at in@ratio at iv\fgruler at marklth}}}}%
+\fgruler at div{#1}{16}%
+\multiput(0,0)(16,0){\@tempcnta}{\fgruler at in@thick at v\fgruler at in@color at v\line(0,-1){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(1,0){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(16,-\fgruler at lentounit{\fgruler at sep})(16,0){\@tempdima}{\makebox(0,0)[t]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
+
+\def\fgruler at in@rightdown@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{\fgruler at width})(0,-\fgruler at lentounit{\fgruler at width})%
+\fgruler at in@rightdown{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(0,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5in\put(8,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\fgruler at caption@in}}\fi%
+\end{picture}}
+
+\def\fgruler at in@rightdown@@#1{\leavevmode\hbox{}\lower\fgruler at width\hbox{\fgruler at in@rightdown@{#1}}}
+
+%% RIGHTUP CM
+\def\fgruler at cm@rightup#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(1,0){\@tempcnta}{\fgruler at ifnot@divisible at five{\fgruler at cm@thick at i\fgruler at cm@color at i\line(0,1){\fgruler at lentounit{\fgruler at cm@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{5}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(5,0){\@tempcnta}{\fgruler at ifodd{\fgruler at cm@thick at ii\fgruler at cm@color at ii\line(0,1){\fgruler at lentounit{\fgruler at cm@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{10}%
+\multiput(0,0)(10,0){\@tempcnta}{\fgruler at cm@thick at iii\fgruler at cm@color at iii\line(0,1){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(1,0){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(10,\fgruler at lentounit{\fgruler at sep})(10,0){\@tempdima}{\makebox(0,0)[b]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
+
+\def\fgruler at cm@rightup@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{\fgruler at width})%
+\fgruler at cm@rightup{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(0,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5cm\put(5,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@rightup@@#1{\leavevmode\hbox{}\lower\fgruler at width\hbox{\fgruler at cm@rightup@{#1}}}
+
+%% RIGHTUP IN
+\def\fgruler at in@rightup#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(1,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at i\fgruler at in@color at i\line(0,1){\fgruler at lentounit{\fgruler at in@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{2}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(2,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at ii\fgruler at in@color at ii\line(0,1){\fgruler at lentounit{\fgruler at in@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{4}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(4,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iii\fgruler at in@color at iii\line(0,1){\fgruler at lentounit{\fgruler at in@ratio at iii\fgruler at marklth}}}}%
+\fgruler at div{#1}{8}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(8,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iv\fgruler at in@color at iv\line(0,1){\fgruler at lentounit{\fgruler at in@ratio at iv\fgruler at marklth}}}}%
+\fgruler at div{#1}{16}%
+\multiput(0,0)(16,0){\@tempcnta}{\fgruler at in@thick at v\fgruler at in@color at v\line(0,1){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(1,0){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(16,\fgruler at lentounit{\fgruler at sep})(16,0){\@tempdima}{\makebox(0,0)[b]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
+
+\def\fgruler at in@rightup@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{\fgruler at width})%
+\fgruler at in@rightup{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(0,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5in\put(8,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@in}}\fi%
+\end{picture}}
+
+\def\fgruler at in@rightup@@#1{\leavevmode\hbox{}\lower\fgruler at width\hbox{\fgruler at in@rightup@{#1}}}
+
+%% LEFTDOWN CM
+\def\fgruler at cm@leftdown#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-1,0){\@tempcnta}{\fgruler at ifnot@divisible at five{\fgruler at cm@thick at i\fgruler at cm@color at i\line(0,-1){\fgruler at lentounit{\fgruler at cm@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{5}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-5,0){\@tempcnta}{\fgruler at ifodd{\fgruler at cm@thick at ii\fgruler at cm@color at ii\line(0,-1){\fgruler at lentounit{\fgruler at cm@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{10}%
+\multiput(0,0)(-10,0){\@tempcnta}{\fgruler at cm@thick at iii\fgruler at cm@color at iii\line(0,-1){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(-1,0){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(-10,-\fgruler at lentounit{\fgruler at sep})(-10,0){\@tempdima}{\makebox(0,0)[t]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
+
+\def\fgruler at cm@leftdown@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{\fgruler at width})(-\fgruler at lentounit{#1},-\fgruler at lentounit{\fgruler at width})%
+\fgruler at cm@leftdown{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(0,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5cm\put(-5,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@leftdown@@#1{\leavevmode\hbox{}\lower\fgruler at width\hbox{\fgruler at cm@leftdown@{#1}}}
+
+%% LEFTDOWN IN
+\def\fgruler at in@leftdown#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-1,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at i\fgruler at in@color at i\line(0,-1){\fgruler at lentounit{\fgruler at in@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{2}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-2,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at ii\fgruler at in@color at ii\line(0,-1){\fgruler at lentounit{\fgruler at in@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{4}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-4,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iii\fgruler at in@color at iii\line(0,-1){\fgruler at lentounit{\fgruler at in@ratio at iii\fgruler at marklth}}}}%
+\fgruler at div{#1}{8}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-8,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iv\fgruler at in@color at iv\line(0,-1){\fgruler at lentounit{\fgruler at in@ratio at iv\fgruler at marklth}}}}%
+\fgruler at div{#1}{16}%
+\multiput(0,0)(-16,0){\@tempcnta}{\fgruler at in@thick at v\fgruler at in@color at v\line(0,-1){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(-1,0){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(-16,-\fgruler at lentounit{\fgruler at sep})(-16,0){\@tempdima}{\makebox(0,0)[t]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
+
+\def\fgruler at in@leftdown@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{\fgruler at width})(-\fgruler at lentounit{#1},-\fgruler at lentounit{\fgruler at width})%
+\fgruler at in@leftdown{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(0,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5in\put(-8,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\fgruler at caption@in}}\fi%
+\end{picture}}
+
+\def\fgruler at in@leftdown@@#1{\leavevmode\hbox{}\lower\fgruler at width\hbox{\fgruler at in@leftdown@{#1}}}
+
+%% LEFTUP CM
+\def\fgruler at cm@leftup#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-1,0){\@tempcnta}{\fgruler at ifnot@divisible at five{\fgruler at cm@thick at i\fgruler at cm@color at i\line(0,1){\fgruler at lentounit{\fgruler at cm@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{5}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-5,0){\@tempcnta}{\fgruler at ifodd{\fgruler at cm@thick at ii\fgruler at cm@color at ii\line(0,1){\fgruler at lentounit{\fgruler at cm@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{10}%
+\multiput(0,0)(-10,0){\@tempcnta}{\fgruler at cm@thick at iii\fgruler at cm@color at iii\line(0,1){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(-1,0){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(-10,\fgruler at lentounit{\fgruler at sep})(-10,0){\@tempdima}{\makebox(0,0)[b]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
+
+\def\fgruler at cm@leftup@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{\fgruler at width})(-\fgruler at lentounit{#1},0)%
+\fgruler at cm@leftup{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(0,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5cm\put(-5,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@leftup@@#1{\leavevmode\hbox{}\lower\fgruler at width\hbox{\fgruler at cm@leftup@{#1}}}
+
+%% LEFTUP IN
+\def\fgruler at in@leftup#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-1,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at i\fgruler at in@color at i\line(0,1){\fgruler at lentounit{\fgruler at in@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{2}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-2,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at ii\fgruler at in@color at ii\line(0,1){\fgruler at lentounit{\fgruler at in@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{4}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-4,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iii\fgruler at in@color at iii\line(0,1){\fgruler at lentounit{\fgruler at in@ratio at iii\fgruler at marklth}}}}%
+\fgruler at div{#1}{8}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-8,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iv\fgruler at in@color at iv\line(0,1){\fgruler at lentounit{\fgruler at in@ratio at iv\fgruler at marklth}}}}%
+\fgruler at div{#1}{16}%
+\multiput(0,0)(-16,0){\@tempcnta}{\fgruler at in@thick at v\fgruler at in@color at v\line(0,1){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(-1,0){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(-16,\fgruler at lentounit{\fgruler at sep})(-16,0){\@tempdima}{\makebox(0,0)[b]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
+
+\def\fgruler at in@leftup@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{\fgruler at width})(-\fgruler at lentounit{#1},0)%
+\fgruler at in@leftup{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(0,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5in\put(-8,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@in}}\fi%
+\end{picture}}
+
+\def\fgruler at in@leftup@@#1{\leavevmode\hbox{}\lower\fgruler at width\hbox{\fgruler at in@leftup@{#1}}}
+
+%% DOWNRIGHT CM
+\def\fgruler at cm@downright#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-1){\@tempcnta}{\fgruler at ifnot@divisible at five{\fgruler at cm@thick at i\fgruler at cm@color at i\line(1,0){\fgruler at lentounit{\fgruler at cm@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{5}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-5){\@tempcnta}{\fgruler at ifodd{\fgruler at cm@thick at ii\fgruler at cm@color at ii\line(1,0){\fgruler at lentounit{\fgruler at cm@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{10}%
+\multiput(0,0)(0,-10){\@tempcnta}{\fgruler at cm@thick at iii\fgruler at cm@color at iii\line(1,0){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(0,-1){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(\fgruler at lentounit{\fgruler at sep},-10)(0,-10){\@tempdima}{\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
+
+\def\fgruler at cm@downright@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{\fgruler at width},\fgruler at lentounit{#1})(0,-\fgruler at lentounit{#1})%
+\fgruler at cm@downright{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(\fgruler at lentounit{\fgruler at sep},0){\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum}}}%
+\ifdim#1>.5cm\put(\fgruler at lentounit{\fgruler at sep},-5){\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\fgruler at caption@cm}}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@downright@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at cm@downright@{#1}}}
+
+%% DOWNRIGHT IN
+\def\fgruler at in@downright#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-1){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at i\fgruler at in@color at i\line(1,0){\fgruler at lentounit{\fgruler at in@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{2}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-2){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at ii\fgruler at in@color at ii\line(1,0){\fgruler at lentounit{\fgruler at in@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{4}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-4){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iii\fgruler at in@color at iii\line(1,0){\fgruler at lentounit{\fgruler at in@ratio at iii\fgruler at marklth}}}}%
+\fgruler at div{#1}{8}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-8){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iv\fgruler at in@color at iv\line(1,0){\fgruler at lentounit{\fgruler at in@ratio at iv\fgruler at marklth}}}}%
+\fgruler at div{#1}{16}%
+\multiput(0,0)(0,-16){\@tempcnta}{\fgruler at in@thick at v\fgruler at in@color at v\line(1,0){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(0,-1){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(\fgruler at lentounit{\fgruler at sep},-16)(0,-16){\@tempdima}{\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
+
+\def\fgruler at in@downright@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{\fgruler at width},\fgruler at lentounit{#1})(0,-\fgruler at lentounit{#1})%
+\fgruler at in@downright{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(\fgruler at lentounit{\fgruler at sep},0){\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum}}}%
+\ifdim#1>.5in\put(\fgruler at lentounit{\fgruler at sep},-8){\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\fgruler at caption@in}}}\fi%
+\end{picture}}
+
+\def\fgruler at in@downright@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at in@downright@{#1}}}
+
+%% DOWNLEFT CM
+\def\fgruler at cm@downleft#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-1){\@tempcnta}{\fgruler at ifnot@divisible at five{\fgruler at cm@thick at i\fgruler at cm@color at i\line(-1,0){\fgruler at lentounit{\fgruler at cm@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{5}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-5){\@tempcnta}{\fgruler at ifodd{\fgruler at cm@thick at ii\fgruler at cm@color at ii\line(-1,0){\fgruler at lentounit{\fgruler at cm@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{10}%
+\multiput(0,0)(0,-10){\@tempcnta}{\fgruler at cm@thick at iii\fgruler at cm@color at iii\line(-1,0){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(0,-1){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(-\fgruler at lentounit{\fgruler at sep},-10)(0,-10){\@tempdima}{\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
+
+\def\fgruler at cm@downleft@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{\fgruler at width},\fgruler at lentounit{#1})(-\fgruler at lentounit{\fgruler at width},-\fgruler at lentounit{#1})%
+\fgruler at cm@downleft{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(-\fgruler at lentounit{\fgruler at sep},0){\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum}}}%
+\ifdim#1>.5cm\put(-\fgruler at lentounit{\fgruler at sep},-5){\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\fgruler at caption@cm}}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@downleft@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at cm@downleft@{#1}}}
+
+%% DOWNLEFT IN
+\def\fgruler at in@downleft#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-1){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at i\fgruler at in@color at i\line(-1,0){\fgruler at lentounit{\fgruler at in@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{2}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-2){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at ii\fgruler at in@color at ii\line(-1,0){\fgruler at lentounit{\fgruler at in@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{4}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-4){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iii\fgruler at in@color at iii\line(-1,0){\fgruler at lentounit{\fgruler at in@ratio at iii\fgruler at marklth}}}}%
+\fgruler at div{#1}{8}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-8){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iv\fgruler at in@color at iv\line(-1,0){\fgruler at lentounit{\fgruler at in@ratio at iv\fgruler at marklth}}}}%
+\fgruler at div{#1}{16}%
+\multiput(0,0)(0,-16){\@tempcnta}{\fgruler at in@thick at v\fgruler at in@color at v\line(-1,0){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(0,-1){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(-\fgruler at lentounit{\fgruler at sep},-16)(0,-16){\@tempdima}{\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
+
+\def\fgruler at in@downleft@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{\fgruler at width},\fgruler at lentounit{#1})(-\fgruler at lentounit{\fgruler at width},-\fgruler at lentounit{#1})%
+\fgruler at in@downleft{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(-\fgruler at lentounit{\fgruler at sep},0){\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum}}}%
+\ifdim#1>.5in\put(-\fgruler at lentounit{\fgruler at sep},-8){\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\fgruler at caption@in}}}\fi%
+\end{picture}}
+
+\def\fgruler at in@downleft@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at in@downleft@{#1}}}
+
+%% UPRIGHT CM
+\def\fgruler at cm@upright#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,1){\@tempcnta}{\fgruler at ifnot@divisible at five{\fgruler at cm@thick at i\fgruler at cm@color at i\line(1,0){\fgruler at lentounit{\fgruler at cm@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{5}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,5){\@tempcnta}{\fgruler at ifodd{\fgruler at cm@thick at ii\fgruler at cm@color at ii\line(1,0){\fgruler at lentounit{\fgruler at cm@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{10}%
+\multiput(0,0)(0,10){\@tempcnta}{\fgruler at cm@thick at iii\fgruler at cm@color at iii\line(1,0){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(0,1){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(\fgruler at lentounit{\fgruler at sep},10)(0,10){\@tempdima}{\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
+
+\def\fgruler at cm@upright@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{\fgruler at width},\fgruler at lentounit{#1})%
+\fgruler at cm@upright{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(\fgruler at lentounit{\fgruler at sep},0){\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum}}}%
+\ifdim#1>.5cm\put(\fgruler at lentounit{\fgruler at sep},5){\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\fgruler at caption@cm}}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@upright@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at cm@upright@{#1}}}
+
+%% UPRIGHT IN
+\def\fgruler at in@upright#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,1){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at i\fgruler at in@color at i\line(1,0){\fgruler at lentounit{\fgruler at in@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{2}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,2){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at ii\fgruler at in@color at ii\line(1,0){\fgruler at lentounit{\fgruler at in@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{4}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,4){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iii\fgruler at in@color at iii\line(1,0){\fgruler at lentounit{\fgruler at in@ratio at iii\fgruler at marklth}}}}%
+\fgruler at div{#1}{8}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,8){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iv\fgruler at in@color at iv\line(1,0){\fgruler at lentounit{\fgruler at in@ratio at iv\fgruler at marklth}}}}%
+\fgruler at div{#1}{16}%
+\multiput(0,0)(0,16){\@tempcnta}{\fgruler at in@thick at v\fgruler at in@color at v\line(1,0){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(0,1){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(\fgruler at lentounit{\fgruler at sep},16)(0,16){\@tempdima}{\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
+
+\def\fgruler at in@upright@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{\fgruler at width},\fgruler at lentounit{#1})%
+\fgruler at in@upright{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(\fgruler at lentounit{\fgruler at sep},0){\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum}}}%
+\ifdim#1>.5in\put(\fgruler at lentounit{\fgruler at sep},8){\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\fgruler at caption@in}}}\fi%
+\end{picture}}
+
+\def\fgruler at in@upright@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at in@upright@{#1}}}
+
+%% UPLEFT CM
+\def\fgruler at cm@upleft#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,1){\@tempcnta}{\fgruler at ifnot@divisible at five{\fgruler at cm@thick at i\fgruler at cm@color at i\line(-1,0){\fgruler at lentounit{\fgruler at cm@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{5}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,5){\@tempcnta}{\fgruler at ifodd{\fgruler at cm@thick at ii\fgruler at cm@color at ii\line(-1,0){\fgruler at lentounit{\fgruler at cm@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{10}%
+\multiput(0,0)(0,10){\@tempcnta}{\fgruler at cm@thick at iii\fgruler at cm@color at iii\line(-1,0){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(0,1){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(-\fgruler at lentounit{\fgruler at sep},10)(0,10){\@tempdima}{\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
+
+\def\fgruler at cm@upleft@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{\fgruler at width},\fgruler at lentounit{#1})(-\fgruler at lentounit{\fgruler at width},0)%
+\fgruler at cm@upleft{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(-\fgruler at lentounit{\fgruler at sep},0){\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum}}}%
+\ifdim#1>.5cm\put(-\fgruler at lentounit{\fgruler at sep},5){\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\fgruler at caption@cm}}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@upleft@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at cm@upleft@{#1}}}
+
+%% UPLEFT IN
+\def\fgruler at in@upleft#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,1){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at i\fgruler at in@color at i\line(-1,0){\fgruler at lentounit{\fgruler at in@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{2}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,2){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at ii\fgruler at in@color at ii\line(-1,0){\fgruler at lentounit{\fgruler at in@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{4}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,4){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iii\fgruler at in@color at iii\line(-1,0){\fgruler at lentounit{\fgruler at in@ratio at iii\fgruler at marklth}}}}%
+\fgruler at div{#1}{8}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,8){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iv\fgruler at in@color at iv\line(-1,0){\fgruler at lentounit{\fgruler at in@ratio at iv\fgruler at marklth}}}}%
+\fgruler at div{#1}{16}%
+\multiput(0,0)(0,16){\@tempcnta}{\fgruler at in@thick at v\fgruler at in@color at v\line(-1,0){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(0,1){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(-\fgruler at lentounit{\fgruler at sep},16)(0,16){\@tempdima}{\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
+
+\def\fgruler at in@upleft@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{\fgruler at width},\fgruler at lentounit{#1})(-\fgruler at lentounit{\fgruler at width},0)%
+\fgruler at in@upleft{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(-\fgruler at lentounit{\fgruler at sep},0){\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum}}}%
+\ifdim#1>.5in\put(-\fgruler at lentounit{\fgruler at sep},8){\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\fgruler at caption@in}}}\fi%
+\end{picture}}
+
+\def\fgruler at in@upleft@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at in@upleft@{#1}}}
+
+%% UPPERLEFT CM
+\def\fgruler at cm@upperleft@#1#2{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{#2})(0,-\fgruler at lentounit{#2})%
+\fgruler at cm@rightdown{#1}%
+\fgruler at cm@downright{#2}%
+\ifdim#1>.5cm\put(5,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@upperleft@@#1#2{\leavevmode\hbox{}\lower#2\hbox{\fgruler at cm@upperleft@{#1}{#2}}}
+
+\def\fgruler at cm@upperleft at fg@#1#2{%
+\begingroup%
+\setlength{\fgruler at fg@width}{\paperwidth}%
+\addtolength{\fgruler at fg@width}{-#1}%
+\setlength{\fgruler at fg@height}{\paperheight}%
+\addtolength{\fgruler at fg@height}{-#2}%
+\fgruler at fgsetting%
+\AtPageLowerLeft{\put(\fgruler at lentounit{#1},0){%
+\fgruler at cm@upperleft@{\fgruler at fg@width}{\fgruler at fg@height}}}%
+\endgroup}
+
+\def\fgruler at cm@upperleft at fg{\fgruler at cm@upperleft at fg@{\fgruler at hshift}{\fgruler at vshift}}
+
+%% UPPERLEFT IN
+\def\fgruler at in@upperleft@#1#2{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{#2})(0,-\fgruler at lentounit{#2})%
+\fgruler at in@rightdown{#1}%
+\fgruler at in@downright{#2}%
+\ifdim#1>.5in\put(8,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\fgruler at caption@in}}\fi%
+\end{picture}}
+
+\def\fgruler at in@upperleft@@#1#2{\leavevmode\hbox{}\lower#2\hbox{\fgruler at in@upperleft@{#1}{#2}}}
+
+\def\fgruler at in@upperleft at fg@#1#2{%
+\begingroup%
+\setlength{\fgruler at fg@width}{\paperwidth}%
+\addtolength{\fgruler at fg@width}{-#1}%
+\setlength{\fgruler at fg@height}{\paperheight}%
+\addtolength{\fgruler at fg@height}{-#2}%
+\fgruler at fgsetting%
+\AtPageLowerLeft{\put(\fgruler at lentounit{#1},0){%
+\fgruler at in@upperleft@{\fgruler at fg@width}{\fgruler at fg@height}}}%
+\endgroup}
+
+\def\fgruler at in@upperleft at fg{\fgruler at in@upperleft at fg@{\fgruler at hshift}{\fgruler at vshift}}
+
+%% UPPERRIGHT CM
+\def\fgruler at cm@upperright@#1#2{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{#2})(-\fgruler at lentounit{#1},-\fgruler at lentounit{#2})%
+\fgruler at cm@leftdown{#1}%
+\fgruler at cm@downleft{#2}%
+\ifdim#1>.5cm\put(-5,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@upperright@@#1#2{\leavevmode\hbox{}\lower#2\hbox{\fgruler at cm@upperright@{#1}{#2}}}
+
+\def\fgruler at cm@upperright at fg@#1#2{%
+\begingroup%
+\setlength{\fgruler at fg@width}{\paperwidth}%
+\addtolength{\fgruler at fg@width}{-#1}%
+\setlength{\fgruler at fg@height}{\paperheight}%
+\addtolength{\fgruler at fg@height}{-#2}%
+\fgruler at fgsetting%
+\AtPageLowerLeft{\fgruler at cm@upperright@{\fgruler at fg@width}{\fgruler at fg@height}}%
+\endgroup}
+
+\def\fgruler at cm@upperright at fg{\fgruler at cm@upperright at fg@{\fgruler at hshift}{\fgruler at vshift}}
+
+%% UPPERRIGHT IN
+\def\fgruler at in@upperright@#1#2{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{#2})(-\fgruler at lentounit{#1},-\fgruler at lentounit{#2})%
+\fgruler at in@leftdown{#1}%
+\fgruler at in@downleft{#2}%
+\ifdim#1>.5in\put(-8,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\fgruler at caption@in}}\fi%
+\end{picture}}
+
+\def\fgruler at in@upperright@@#1#2{\leavevmode\hbox{}\lower#2\hbox{\fgruler at in@upperright@{#1}{#2}}}
+
+\def\fgruler at in@upperright at fg@#1#2{%
+\begingroup%
+\setlength{\fgruler at fg@width}{\paperwidth}%
+\addtolength{\fgruler at fg@width}{-#1}%
+\setlength{\fgruler at fg@height}{\paperheight}%
+\addtolength{\fgruler at fg@height}{-#2}%
+\fgruler at fgsetting%
+\AtPageLowerLeft{\fgruler at in@upperright@{\fgruler at fg@width}{\fgruler at fg@height}}%
+\endgroup}
+
+\def\fgruler at in@upperright at fg{\fgruler at in@upperright at fg@{\fgruler at hshift}{\fgruler at vshift}}
+
+%% LOWERLEFT CM
+\def\fgruler at cm@lowerleft@#1#2{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{#2})%
+\fgruler at cm@rightup{#1}%
+\fgruler at cm@upright{#2}%
+\ifdim#1>.5cm\put(5,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@lowerleft@@#1#2{\leavevmode\hbox{}\lower#2\hbox{\fgruler at cm@lowerleft@{#1}{#2}}}
+
+\def\fgruler at cm@lowerleft at fg@#1#2{%
+\begingroup%
+\setlength{\fgruler at fg@width}{\paperwidth}%
+\addtolength{\fgruler at fg@width}{-#1}%
+\setlength{\fgruler at fg@height}{\paperheight}%
+\addtolength{\fgruler at fg@height}{-#2}%
+\fgruler at fgsetting%
+\AtPageLowerLeft{\put(\fgruler at lentounit{#1},\fgruler at lentounit{#2}){%
+\fgruler at cm@lowerleft@{\fgruler at fg@width}{\fgruler at fg@height}}}%
+\endgroup}
+
+\def\fgruler at cm@lowerleft at fg{\fgruler at cm@lowerleft at fg@{\fgruler at hshift}{\fgruler at vshift}}
+
+%% LOWERLEFT IN
+\def\fgruler at in@lowerleft@#1#2{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{#2})%
+\fgruler at in@rightup{#1}%
+\fgruler at in@upright{#2}%
+\ifdim#1>.5in\put(8,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@in}}\fi%
+\end{picture}}
+
+\def\fgruler at in@lowerleft@@#1#2{\leavevmode\hbox{}\lower#2\hbox{\fgruler at in@lowerleft@{#1}{#2}}}
+
+\def\fgruler at in@lowerleft at fg@#1#2{%
+\begingroup%
+\setlength{\fgruler at fg@width}{\paperwidth}%
+\addtolength{\fgruler at fg@width}{-#1}%
+\setlength{\fgruler at fg@height}{\paperheight}%
+\addtolength{\fgruler at fg@height}{-#2}%
+\fgruler at fgsetting%
+\AtPageLowerLeft{\put(\fgruler at lentounit{#1},\fgruler at lentounit{#2}){%
+\fgruler at in@lowerleft@{\fgruler at fg@width}{\fgruler at fg@height}}}%
+\endgroup}
+
+\def\fgruler at in@lowerleft at fg{\fgruler at in@lowerleft at fg@{\fgruler at hshift}{\fgruler at vshift}}
+
+%% LOWERRIGHT CM
+\def\fgruler at cm@lowerright@#1#2{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{#2})(-\fgruler at lentounit{#1},0)%
+\fgruler at cm@leftup{#1}%
+\fgruler at cm@upleft{#2}%
+\ifdim#1>.5cm\put(-5,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@lowerright@@#1#2{\leavevmode\hbox{}\lower#2\hbox{\fgruler at cm@lowerright@{#1}{#2}}}
+
+\def\fgruler at cm@lowerright at fg@#1#2{%
+\begingroup%
+\setlength{\fgruler at fg@width}{\paperwidth}%
+\addtolength{\fgruler at fg@width}{-#1}%
+\setlength{\fgruler at fg@height}{\paperheight}%
+\addtolength{\fgruler at fg@height}{-#2}%
+\fgruler at fgsetting%
+\AtPageLowerLeft{\put(0,\fgruler at lentounit{#2}){%
+\fgruler at cm@lowerright@{\fgruler at fg@width}{\fgruler at fg@height}}}%
+\endgroup}
+
+\def\fgruler at cm@lowerright at fg{\fgruler at cm@lowerright at fg@{\fgruler at hshift}{\fgruler at vshift}}
+
+%% LOWERRIGHT IN
+\def\fgruler at in@lowerright@#1#2{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{#2})(-\fgruler at lentounit{#1},0)%
+\fgruler at in@leftup{#1}%
+\fgruler at in@upleft{#2}%
+\ifdim#1>.5in\put(-8,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@in}}\fi%
+\end{picture}}
+
+\def\fgruler at in@lowerright@@#1#2{\leavevmode\hbox{}\lower#2\hbox{\fgruler at in@lowerright@{#1}{#2}}}
+
+\def\fgruler at in@lowerright at fg@#1#2{%
+\begingroup%
+\setlength{\fgruler at fg@width}{\paperwidth}%
+\addtolength{\fgruler at fg@width}{-#1}%
+\setlength{\fgruler at fg@height}{\paperheight}%
+\addtolength{\fgruler at fg@height}{-#2}%
+\fgruler at fgsetting%
+\AtPageLowerLeft{\put(0,\fgruler at lentounit{#2}){%
+\fgruler at in@lowerright@{\fgruler at fg@width}{\fgruler at fg@height}}}%
+\endgroup}
+
+\def\fgruler at in@lowerright at fg{\fgruler at in@lowerright at fg@{\fgruler at hshift}{\fgruler at vshift}}
+%    \end{macrocode}
+% \Finale
+\endinput
\ No newline at end of file

Added: trunk/Master/texmf-dist/source/latex/fgruler/fgruler.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/fgruler/fgruler.ins	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/fgruler/fgruler.ins	2017-01-16 23:09:41 UTC (rev 42966)
@@ -0,0 +1,40 @@
+
+% Copyright 2017- by Tibor Tomacs
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% 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.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+% 
+% The Current Maintainer of this work is Tibor Tomacs.
+%
+\input docstrip.tex
+\keepsilent
+\usedir{tex/latex/fgruler}
+\preamble
+This is a generated file.
+
+Copyright 2017- by Tibor Tomacs
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+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.3 or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainer of this work is Tibor Tomacs.
+
+\endpreamble
+
+\generate{\file{fgruler.sty}{\from{./fgruler.dtx}{package}}}
+
+\endbatchfile

Added: trunk/Master/texmf-dist/tex/latex/fgruler/fgruler.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fgruler/fgruler.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/fgruler/fgruler.sty	2017-01-16 23:09:41 UTC (rev 42966)
@@ -0,0 +1,1042 @@
+%%
+%% This is file `fgruler.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ./fgruler.dtx  (with options: `package')
+%% This is a generated file.
+%% 
+%% Copyright 2017- by Tibor Tomacs
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% 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.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%% 
+%% This work has the LPPL maintenance status `maintained'.
+%% 
+%% The Current Maintainer of this work is Tibor Tomacs.
+%% 
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{fgruler}[2017/01/16 v1.0 Package for drawing rulers on the foreground or in the text]
+%%
+\@ifpackageloaded{kvoptions}{}{\RequirePackage{kvoptions}}
+\@ifpackageloaded{etoolbox}{}{\RequirePackage{etoolbox}}
+
+\SetupKeyvalOptions{family=fgruler,prefix=fgruler@}
+\DeclareStringOption[.4pt]{markthick}
+\DeclareStringOption[\scriptsize\sffamily]{numfont}
+\DeclareStringOption[black]{color}
+\DeclareStringOption[2mm]{marklength}
+\DeclareStringOption[3pt]{numsep}
+\DeclareStringOption[0pt]{hshift}
+\DeclareStringOption[0pt]{vshift}
+\DeclareStringOption[upperleft]{type}
+\DeclareStringOption[cm]{unit}
+\DeclareBoolOption{nonefgrulers}
+\DeclareBoolOption{showframe}
+\ProcessKeyvalOptions{fgruler}
+
+\newlength{\fgruler at marklth}
+\newlength{\fgruler at sep}
+\newlength{\fgruler at width}
+\newlength{\fgruler at fg@width}
+\newlength{\fgruler at fg@height}
+
+\def\fgruler at set#1#2#3#4#5{%
+\def\fgruler at markthickness{\linethickness{#1}}%
+\def\fgruler at font{#2}%
+\def\fgruler at rulercolor{\color{#3}}%
+\setlength{\fgruler at marklth}{#4}%
+\setlength{\fgruler at sep}{#5}%
+\def\fgruler at font@{\normalfont\normalsize\fgruler at font}%
+\addtolength{\fgruler at sep}{\fgruler at marklth}%
+\ifx\thefgrulernum\@empty\setlength{\fgruler at width}{\fgruler at marklth}\else%
+\settoheight{\fgruler at width}{\fgruler at font@\thefgrulernum}%
+\addtolength{\fgruler at width}{\fgruler at sep}\fi}
+
+\def\rulerparams#1#2#3#4#5{%
+\ifx#1\@empty\else\def\fgruler at markthick@{#1}\fi%
+\ifx#2\@empty\else\def\fgruler at numfont@{#2}\fi%
+\ifx#3\@empty\else\def\fgruler at color@{#3}\fi%
+\ifx#4\@empty\else\def\fgruler at marklength@{#4}\fi%
+\ifx#5\@empty\else\def\fgruler at numsep@{#5}\fi%
+\ignorespaces}
+
+\rulerparams{.4pt}{\scriptsize\sffamily}{black}{2mm}{3pt}
+
+\def\fgruler at fgsetting{%
+\fgruler at set{\fgruler at markthick}{\fgruler at numfont}{\fgruler at color}{\fgruler at marklength}{\fgruler at numsep}%
+\rulernorotatenum}
+
+\def\fgruler at intextsetting{%
+\fgruler at set{\fgruler at markthick@}{\fgruler at numfont@}{\fgruler at color@}{\fgruler at marklength@}{\fgruler at numsep@}}
+
+\def\fgruler at activate@type{%
+\def\fgruler at check{cm}\ifx\fgruler at unit\fgruler at check\else%
+\def\fgruler at check{in}\ifx\fgruler at unit\fgruler at check\else%
+\@latexerr{Undefined unit: \fgruler at unit\space(Defined units: cm, in)}{}\fi\fi%
+\def\fgruler at check{upperleft}\ifx\fgruler at type\fgruler at check\else%
+\def\fgruler at check{upperright}\ifx\fgruler at type\fgruler at check\else%
+\def\fgruler at check{lowerleft}\ifx\fgruler at type\fgruler at check\else%
+\def\fgruler at check{lowerright}\ifx\fgruler at type\fgruler at check\else%
+\def\fgruler at check{none}\ifx\fgruler at type\fgruler at check\else%
+\@latexerr{Undefined type: \fgruler at type\space(Defined types: upperleft, upperright, lowerleft, lowerright, none)}{}\fi\fi\fi\fi\fi%
+\def\fgruler at output{\csname fgruler@\fgruler at unit @\fgruler at type @fg\endcsname}}
+
+\def\fgrulerratiocm#1#2{%
+\ifx#1\@empty\else\def\fgruler at cm@ratio at i{#1}\fi%
+\ifx#2\@empty\else\def\fgruler at cm@ratio at ii{#2}\fi%
+\ignorespaces}
+
+\fgrulerratiocm{.5}{.75}
+
+\def\fgrulerratioin#1#2#3#4{%
+\ifx#1\@empty\else\def\fgruler at in@ratio at i{#1}\fi%
+\ifx#2\@empty\else\def\fgruler at in@ratio at ii{#2}\fi%
+\ifx#3\@empty\else\def\fgruler at in@ratio at iii{#3}\fi%
+\ifx#4\@empty\else\def\fgruler at in@ratio at iv{#4}\fi%
+\ignorespaces}
+
+\fgrulerratioin{.25}{.375}{.625}{.75}
+
+\def\fgrulerthickcm#1#2#3{%
+\ifx#1\@empty\else\def\fgruler at cm@thick at i{\linethickness{#1}}\fi%
+\ifx#2\@empty\else\def\fgruler at cm@thick at ii{\linethickness{#2}}\fi%
+\ifx#3\@empty\else\def\fgruler at cm@thick at iii{\linethickness{#3}}\fi%
+\ignorespaces}
+
+\def\fgruler at cm@thick at i{}
+\def\fgruler at cm@thick at ii{}
+\def\fgruler at cm@thick at iii{}
+
+\def\fgrulerthickin#1#2#3#4#5{%
+\ifx#1\@empty\else\def\fgruler at in@thick at i{\linethickness{#1}}\fi%
+\ifx#2\@empty\else\def\fgruler at in@thick at ii{\linethickness{#2}}\fi%
+\ifx#3\@empty\else\def\fgruler at in@thick at iii{\linethickness{#3}}\fi%
+\ifx#4\@empty\else\def\fgruler at in@thick at iv{\linethickness{#4}}\fi%
+\ifx#5\@empty\else\def\fgruler at in@thick at v{\linethickness{#5}}\fi%
+\ignorespaces}
+
+\def\fgruler at in@thick at i{}
+\def\fgruler at in@thick at ii{}
+\def\fgruler at in@thick at iii{}
+\def\fgruler at in@thick at iv{}
+\def\fgruler at in@thick at v{}
+
+\def\fgrulercolorcm#1#2#3{%
+\ifx#1\@empty\else\def\fgruler at cm@color at i{\color{#1}}\fi%
+\ifx#2\@empty\else\def\fgruler at cm@color at ii{\color{#2}}\fi%
+\ifx#3\@empty\else\def\fgruler at cm@color at iii{\color{#3}}\fi%
+\ignorespaces}
+
+\def\fgruler at cm@color at i{}
+\def\fgruler at cm@color at ii{}
+\def\fgruler at cm@color at iii{}
+
+\def\fgrulercolorin#1#2#3#4#5{%
+\ifx#1\@empty\else\def\fgruler at in@color at i{\color{#1}}\fi%
+\ifx#2\@empty\else\def\fgruler at in@color at ii{\color{#2}}\fi%
+\ifx#3\@empty\else\def\fgruler at in@color at iii{\color{#3}}\fi%
+\ifx#4\@empty\else\def\fgruler at in@color at iv{\color{#4}}\fi%
+\ifx#5\@empty\else\def\fgruler at in@color at v{\color{#5}}\fi%
+\ignorespaces}
+
+\def\fgruler at in@color at i{}
+\def\fgruler at in@color at ii{}
+\def\fgruler at in@color at iii{}
+\def\fgruler at in@color at iv{}
+\def\fgruler at in@color at v{}
+
+\def\setfgruler#1{\setkeys{fgruler}{#1}\fgruler at activate@type\ignorespaces}
+
+\newcommand\fgruler at div[2]{%
+\@tempdima=#1\relax\@tempdimb=\unitlength\relax
+\@tempdimb=#2\@tempdimb\divide\@tempdima by \@tempdimb
+\@tempcnta\@tempdima\advance\@tempcnta\@ne}
+
+\def\fgruler at check@param#1#2{%
+\def\fgruler at param{#1}%
+\def\fgruler at check{cm}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{in}\ifx\fgruler at param\fgruler at check\else%
+\@latexerr{Invalid parameter: \fgruler at param\space(Defined parameters: cm, in)}{}%
+\fi\fi%
+\def\fgruler at param{#2}%
+\def\fgruler at check{rightdown}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{rightup}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{leftdown}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{leftup}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{downright}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{downleft}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{upright}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{upleft}\ifx\fgruler at param\fgruler at check\else%
+\@latexerr{Invalid parameter: \fgruler at param\space(Defined parameters: rightdown, rightup, leftdown, leftup, downright, downleft, upright, upleft)}{}%
+\fi\fi\fi\fi\fi\fi\fi\fi}
+
+\def\fgruler at check@param@#1#2{%
+\def\fgruler at param{#1}%
+\def\fgruler at check{cm}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{in}\ifx\fgruler at param\fgruler at check\else%
+\@latexerr{Invalid parameter: \fgruler at param\space(Defined parameters: cm, in)}{}%
+\fi\fi%
+\def\fgruler at param{#2}%
+\def\fgruler at check{upperleft}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{upperright}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{lowerleft}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{lowerright}\ifx\fgruler at param\fgruler at check\else%
+\@latexerr{Invalid parameter: \fgruler at param\space(Defined parameters: upperleft, upperright, lowerleft, lowerright)}{}%
+\fi\fi\fi\fi}
+
+\newcommand{\fgruler at ruler}[3][cm]{\fgruler at check@param{#1}{#2}\fgruler at intextsetting\csname fgruler@#1@#2@\endcsname{#3}}
+\newcommand{\fgruler at ruler@}[3][cm]{\fgruler at check@param{#1}{#2}\fgruler at intextsetting\csname fgruler@#1@#2@@\endcsname{#3}}
+\def\ruler{\@ifstar{\fgruler at ruler@}{\fgruler at ruler}}
+
+\newcommand{\fgruler at squareruler}[4][cm]{\fgruler at check@param@{#1}{#2}\fgruler at intextsetting\csname fgruler@#1@#2@\endcsname{#3}{#4}}
+\newcommand{\fgruler at squareruler@}[4][cm]{\fgruler at check@param@{#1}{#2}\fgruler at intextsetting\csname fgruler@#1@#2@@\endcsname{#3}{#4}}
+\def\squareruler{\@ifstar{\fgruler at squareruler@}{\fgruler at squareruler}}
+
+\newcommand{\fgruler}[4][cm]{\fgruler at check@param@{#1}{#2}\g at addto@macro\fgruler at output@{\csname fgruler@#1@#2 at fg@\endcsname{#3}{#4}}}
+
+\def\fgrulercaptioncm#1{\def\fgruler at caption@cm{#1}\ignorespaces}
+\def\fgruler at caption@cm{cm}
+\def\fgrulercaptionin#1{\def\fgruler at caption@in{#1}\ignorespaces}
+\def\fgruler at caption@in{inch}
+
+\newif\iffgruler at borderline
+\def\fgrulernoborderline{\fgruler at borderlinefalse\ignorespaces}
+\def\fgrulerborderline{\fgruler at borderlinetrue\ignorespaces}
+\fgruler at borderlinetrue
+
+\newcounter{fgrulernum}
+\newcounter{fgruler at check}
+
+\def\fgruler at ifnot@divisible at five#1{%
+\setcounter{fgruler at check}{\value{fgrulernum}}%
+\divide\value{fgruler at check}by5\relax%
+\multiply\value{fgruler at check}by5\relax%
+\ifnum\value{fgruler at check}=\value{fgrulernum}\else#1\fi\stepcounter{fgrulernum}}
+
+\def\fgruler at ifodd#1{\ifodd\value{fgrulernum}#1\fi\stepcounter{fgrulernum}}
+
+\def\fgruler at lentounit#1{\strip at pt\dimexpr#1*\p@/\unitlength}
+
+\def\fgrulerstartnum#1{\def\fgruler at startnum{#1}\ignorespaces}
+\def\fgruler at startnum{0}
+
+\def\fgrulerdefnum#1{\def\thefgrulernum{#1}\ignorespaces}
+
+\def\fgruler at rotatebox#1#2{#2}%
+
+\def\rulernorotatenum{%
+\ifx\@onlypreamble\@notprerr%
+\def\fgruler at rotatebox##1##2{##2}%
+\else\@latexerr{Don't use \protect\rulernorotatenum\space in preamble!}{}\fi%
+\ignorespaces}
+
+\def\rulerrotatenum{%
+\ifx\@onlypreamble\@notprerr%
+\def\fgruler at rotatebox##1##2{\rotatebox{##1}{##2}}%
+\else\@latexerr{Don't use \protect\rulerrotatenum\space in preamble!}{}\fi%
+\ignorespaces}
+
+\def\fgrulerreset{%
+\ifx\@onlypreamble\@notprerr%
+\def\fgruler at cm@ratio at i{.5}%
+\def\fgruler at cm@ratio at ii{.75}%
+\def\fgruler at in@ratio at i{.25}%
+\def\fgruler at in@ratio at ii{.375}%
+\def\fgruler at in@ratio at iii{.625}%
+\def\fgruler at in@ratio at iv{.75}%
+\def\fgruler at cm@thick at i{}%
+\def\fgruler at cm@thick at ii{}%
+\def\fgruler at cm@thick at iii{}%
+\def\fgruler at in@thick at i{}%
+\def\fgruler at in@thick at ii{}%
+\def\fgruler at in@thick at iii{}%
+\def\fgruler at in@thick at iv{}%
+\def\fgruler at in@thick at v{}%
+\def\fgruler at cm@color at i{}%
+\def\fgruler at cm@color at ii{}%
+\def\fgruler at cm@color at iii{}%
+\def\fgruler at in@color at i{}%
+\def\fgruler at in@color at ii{}%
+\def\fgruler at in@color at iii{}%
+\def\fgruler at in@color at iv{}%
+\def\fgruler at in@color at v{}%
+\def\fgruler at rotatebox##1##2{\rotatebox{##1}{##2}}%
+\def\fgruler at markthick@{.4pt}%
+\def\fgruler at numfont@{\scriptsize\sffamily}%
+\def\fgruler at color@{black}%
+\def\fgruler at marklength@{2mm}%
+\def\fgruler at numsep@{3pt}%
+\def\fgruler at type{upperleft}%
+\def\fgruler at unit{cm}%
+\def\fgruler at markthick{.4pt}%
+\def\fgruler at numfont{\scriptsize\sffamily}%
+\def\fgruler at color{black}%
+\def\fgruler at marklength{2mm}%
+\def\fgruler at hshift{0pt}%
+\def\fgruler at vshift{0pt}%
+\def\fgruler at numsep{3pt}%
+\def\thefgrulernum{\arabic{fgrulernum}}%
+\def\fgruler at caption@cm{cm}%
+\def\fgruler at caption@in{inch}%
+\def\fgruler at startnum{0}%
+\fgruler at borderlinetrue%
+\fgruler at showframefalse%
+\else\@latexerr{Don't use \protect\fgrulerreset\space in preamble!}{}\fi%
+\ignorespaces}
+
+\AtEndPreamble{
+
+\@ifpackageloaded{xcolor}{}{\RequirePackage{xcolor}}
+\@ifpackageloaded{graphicx}{}{\RequirePackage{graphicx}}
+
+\def\fgruler at rotatebox#1#2{\rotatebox{#1}{#2}}
+
+\iffgruler at nonefgrulers
+
+\renewcommand{\fgruler}[4][cm]{}
+\providecommand{\AtPageLowerLeft}[1]{#1}
+
+\else
+
+\@ifpackageloaded{eso-pic}{}{\RequirePackage{eso-pic}}
+
+\def\fgruler at frame{%
+  \begingroup
+    \fgruler at fgsetting
+    \fgruler at rulercolor%
+    \fgruler at markthickness%
+    \AtPageLowerLeft{%
+      \framebox(\fgruler at lentounit{\paperwidth},\fgruler at lentounit{\paperheight}){}}%
+    \AtTextLowerLeft{%
+      \framebox(\fgruler at lentounit{\textwidth},\fgruler at lentounit{\textheight}){}}%
+    \AtTextUpperLeft{%
+      \put(0,\fgruler at lentounit{\headsep}){%
+        \framebox(\fgruler at lentounit{\textwidth},\fgruler at lentounit{\headheight}){}}}%
+    \AtTextLowerLeft{%
+      \put(0,\fgruler at lentounit{-\footskip}){%
+        \line(1,0){\fgruler at lentounit{\textwidth}}}}%
+    \AtTextLowerLeft{%
+      \@tempdima=\textwidth\advance\@tempdima\marginparsep%
+      \if at twoside
+        \ifodd\c at page\else
+          \if at mparswitch
+            \@tempdima=-\marginparsep\advance\@tempdima-\marginparwidth
+          \fi
+        \fi
+      \fi
+      \put(\fgruler at lentounit{\@tempdima},0)%
+        {\framebox(\fgruler at lentounit{\marginparwidth},\fgruler at lentounit{\textheight}){}}%
+    }%
+  \endgroup
+}
+
+\let\fgruler at shipout\AtBeginShipoutUpperLeftForeground
+\def\fgruler at output@{}
+\ESO at isMEMOIR{%
+\def\AtBeginShipoutUpperLeftForeground#1{%
+    \fgruler at shipout{#1%
+        \put(\fgruler at lentounit{\@tempdima},\fgruler at lentounit{\@tempdimb}){%
+            \iffgruler at showframe\fgruler at frame\fi%
+            \fgruler at output%
+            \fgruler at output@%
+            \global\let\fgruler at output@\@empty%
+            }%
+        }%
+    }%
+}{%
+\def\AtBeginShipoutUpperLeftForeground#1{%
+    \fgruler at shipout{#1%
+        \put(0,\fgruler at lentounit{\ESO at yoffsetI}){%
+            \iffgruler at showframe\fgruler at frame\fi%
+            \fgruler at output%
+            \fgruler at output@%
+            \global\let\fgruler at output@\@empty%
+            }%
+        }%
+    }%
+}
+
+\fgruler at activate@type
+
+\fi
+}
+
+%% RIGHTDOWN CM
+\def\fgruler at cm@rightdown#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(1,0){\@tempcnta}{\fgruler at ifnot@divisible at five{\fgruler at cm@thick at i\fgruler at cm@color at i\line(0,-1){\fgruler at lentounit{\fgruler at cm@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{5}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(5,0){\@tempcnta}{\fgruler at ifodd{\fgruler at cm@thick at ii\fgruler at cm@color at ii\line(0,-1){\fgruler at lentounit{\fgruler at cm@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{10}%
+\multiput(0,0)(10,0){\@tempcnta}{\fgruler at cm@thick at iii\fgruler at cm@color at iii\line(0,-1){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(1,0){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(10,-\fgruler at lentounit{\fgruler at sep})(10,0){\@tempdima}{\makebox(0,0)[t]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
+
+\def\fgruler at cm@rightdown@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{\fgruler at width})(0,-\fgruler at lentounit{\fgruler at width})%
+\fgruler at cm@rightdown{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(0,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5cm\put(5,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@rightdown@@#1{\leavevmode\hbox{}\lower\fgruler at width\hbox{\fgruler at cm@rightdown@{#1}}}
+
+%% RIGHTDOWN IN
+\def\fgruler at in@rightdown#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(1,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at i\fgruler at in@color at i\line(0,-1){\fgruler at lentounit{\fgruler at in@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{2}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(2,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at ii\fgruler at in@color at ii\line(0,-1){\fgruler at lentounit{\fgruler at in@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{4}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(4,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iii\fgruler at in@color at iii\line(0,-1){\fgruler at lentounit{\fgruler at in@ratio at iii\fgruler at marklth}}}}%
+\fgruler at div{#1}{8}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(8,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iv\fgruler at in@color at iv\line(0,-1){\fgruler at lentounit{\fgruler at in@ratio at iv\fgruler at marklth}}}}%
+\fgruler at div{#1}{16}%
+\multiput(0,0)(16,0){\@tempcnta}{\fgruler at in@thick at v\fgruler at in@color at v\line(0,-1){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(1,0){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(16,-\fgruler at lentounit{\fgruler at sep})(16,0){\@tempdima}{\makebox(0,0)[t]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
+
+\def\fgruler at in@rightdown@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{\fgruler at width})(0,-\fgruler at lentounit{\fgruler at width})%
+\fgruler at in@rightdown{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(0,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5in\put(8,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\fgruler at caption@in}}\fi%
+\end{picture}}
+
+\def\fgruler at in@rightdown@@#1{\leavevmode\hbox{}\lower\fgruler at width\hbox{\fgruler at in@rightdown@{#1}}}
+
+%% RIGHTUP CM
+\def\fgruler at cm@rightup#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(1,0){\@tempcnta}{\fgruler at ifnot@divisible at five{\fgruler at cm@thick at i\fgruler at cm@color at i\line(0,1){\fgruler at lentounit{\fgruler at cm@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{5}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(5,0){\@tempcnta}{\fgruler at ifodd{\fgruler at cm@thick at ii\fgruler at cm@color at ii\line(0,1){\fgruler at lentounit{\fgruler at cm@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{10}%
+\multiput(0,0)(10,0){\@tempcnta}{\fgruler at cm@thick at iii\fgruler at cm@color at iii\line(0,1){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(1,0){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(10,\fgruler at lentounit{\fgruler at sep})(10,0){\@tempdima}{\makebox(0,0)[b]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
+
+\def\fgruler at cm@rightup@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{\fgruler at width})%
+\fgruler at cm@rightup{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(0,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5cm\put(5,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@rightup@@#1{\leavevmode\hbox{}\lower\fgruler at width\hbox{\fgruler at cm@rightup@{#1}}}
+
+%% RIGHTUP IN
+\def\fgruler at in@rightup#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(1,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at i\fgruler at in@color at i\line(0,1){\fgruler at lentounit{\fgruler at in@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{2}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(2,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at ii\fgruler at in@color at ii\line(0,1){\fgruler at lentounit{\fgruler at in@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{4}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(4,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iii\fgruler at in@color at iii\line(0,1){\fgruler at lentounit{\fgruler at in@ratio at iii\fgruler at marklth}}}}%
+\fgruler at div{#1}{8}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(8,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iv\fgruler at in@color at iv\line(0,1){\fgruler at lentounit{\fgruler at in@ratio at iv\fgruler at marklth}}}}%
+\fgruler at div{#1}{16}%
+\multiput(0,0)(16,0){\@tempcnta}{\fgruler at in@thick at v\fgruler at in@color at v\line(0,1){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(1,0){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(16,\fgruler at lentounit{\fgruler at sep})(16,0){\@tempdima}{\makebox(0,0)[b]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
+
+\def\fgruler at in@rightup@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{\fgruler at width})%
+\fgruler at in@rightup{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(0,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5in\put(8,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@in}}\fi%
+\end{picture}}
+
+\def\fgruler at in@rightup@@#1{\leavevmode\hbox{}\lower\fgruler at width\hbox{\fgruler at in@rightup@{#1}}}
+
+%% LEFTDOWN CM
+\def\fgruler at cm@leftdown#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-1,0){\@tempcnta}{\fgruler at ifnot@divisible at five{\fgruler at cm@thick at i\fgruler at cm@color at i\line(0,-1){\fgruler at lentounit{\fgruler at cm@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{5}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-5,0){\@tempcnta}{\fgruler at ifodd{\fgruler at cm@thick at ii\fgruler at cm@color at ii\line(0,-1){\fgruler at lentounit{\fgruler at cm@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{10}%
+\multiput(0,0)(-10,0){\@tempcnta}{\fgruler at cm@thick at iii\fgruler at cm@color at iii\line(0,-1){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(-1,0){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(-10,-\fgruler at lentounit{\fgruler at sep})(-10,0){\@tempdima}{\makebox(0,0)[t]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
+
+\def\fgruler at cm@leftdown@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{\fgruler at width})(-\fgruler at lentounit{#1},-\fgruler at lentounit{\fgruler at width})%
+\fgruler at cm@leftdown{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(0,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5cm\put(-5,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@leftdown@@#1{\leavevmode\hbox{}\lower\fgruler at width\hbox{\fgruler at cm@leftdown@{#1}}}
+
+%% LEFTDOWN IN
+\def\fgruler at in@leftdown#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-1,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at i\fgruler at in@color at i\line(0,-1){\fgruler at lentounit{\fgruler at in@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{2}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-2,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at ii\fgruler at in@color at ii\line(0,-1){\fgruler at lentounit{\fgruler at in@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{4}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-4,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iii\fgruler at in@color at iii\line(0,-1){\fgruler at lentounit{\fgruler at in@ratio at iii\fgruler at marklth}}}}%
+\fgruler at div{#1}{8}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-8,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iv\fgruler at in@color at iv\line(0,-1){\fgruler at lentounit{\fgruler at in@ratio at iv\fgruler at marklth}}}}%
+\fgruler at div{#1}{16}%
+\multiput(0,0)(-16,0){\@tempcnta}{\fgruler at in@thick at v\fgruler at in@color at v\line(0,-1){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(-1,0){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(-16,-\fgruler at lentounit{\fgruler at sep})(-16,0){\@tempdima}{\makebox(0,0)[t]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
+
+\def\fgruler at in@leftdown@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{\fgruler at width})(-\fgruler at lentounit{#1},-\fgruler at lentounit{\fgruler at width})%
+\fgruler at in@leftdown{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(0,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5in\put(-8,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\fgruler at caption@in}}\fi%
+\end{picture}}
+
+\def\fgruler at in@leftdown@@#1{\leavevmode\hbox{}\lower\fgruler at width\hbox{\fgruler at in@leftdown@{#1}}}
+
+%% LEFTUP CM
+\def\fgruler at cm@leftup#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-1,0){\@tempcnta}{\fgruler at ifnot@divisible at five{\fgruler at cm@thick at i\fgruler at cm@color at i\line(0,1){\fgruler at lentounit{\fgruler at cm@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{5}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-5,0){\@tempcnta}{\fgruler at ifodd{\fgruler at cm@thick at ii\fgruler at cm@color at ii\line(0,1){\fgruler at lentounit{\fgruler at cm@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{10}%
+\multiput(0,0)(-10,0){\@tempcnta}{\fgruler at cm@thick at iii\fgruler at cm@color at iii\line(0,1){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(-1,0){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(-10,\fgruler at lentounit{\fgruler at sep})(-10,0){\@tempdima}{\makebox(0,0)[b]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
+
+\def\fgruler at cm@leftup@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{\fgruler at width})(-\fgruler at lentounit{#1},0)%
+\fgruler at cm@leftup{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(0,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5cm\put(-5,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@leftup@@#1{\leavevmode\hbox{}\lower\fgruler at width\hbox{\fgruler at cm@leftup@{#1}}}
+
+%% LEFTUP IN
+\def\fgruler at in@leftup#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-1,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at i\fgruler at in@color at i\line(0,1){\fgruler at lentounit{\fgruler at in@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{2}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-2,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at ii\fgruler at in@color at ii\line(0,1){\fgruler at lentounit{\fgruler at in@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{4}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-4,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iii\fgruler at in@color at iii\line(0,1){\fgruler at lentounit{\fgruler at in@ratio at iii\fgruler at marklth}}}}%
+\fgruler at div{#1}{8}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(-8,0){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iv\fgruler at in@color at iv\line(0,1){\fgruler at lentounit{\fgruler at in@ratio at iv\fgruler at marklth}}}}%
+\fgruler at div{#1}{16}%
+\multiput(0,0)(-16,0){\@tempcnta}{\fgruler at in@thick at v\fgruler at in@color at v\line(0,1){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(-1,0){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(-16,\fgruler at lentounit{\fgruler at sep})(-16,0){\@tempdima}{\makebox(0,0)[b]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
+
+\def\fgruler at in@leftup@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{\fgruler at width})(-\fgruler at lentounit{#1},0)%
+\fgruler at in@leftup{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(0,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5in\put(-8,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@in}}\fi%
+\end{picture}}
+
+\def\fgruler at in@leftup@@#1{\leavevmode\hbox{}\lower\fgruler at width\hbox{\fgruler at in@leftup@{#1}}}
+
+%% DOWNRIGHT CM
+\def\fgruler at cm@downright#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-1){\@tempcnta}{\fgruler at ifnot@divisible at five{\fgruler at cm@thick at i\fgruler at cm@color at i\line(1,0){\fgruler at lentounit{\fgruler at cm@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{5}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-5){\@tempcnta}{\fgruler at ifodd{\fgruler at cm@thick at ii\fgruler at cm@color at ii\line(1,0){\fgruler at lentounit{\fgruler at cm@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{10}%
+\multiput(0,0)(0,-10){\@tempcnta}{\fgruler at cm@thick at iii\fgruler at cm@color at iii\line(1,0){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(0,-1){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(\fgruler at lentounit{\fgruler at sep},-10)(0,-10){\@tempdima}{\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
+
+\def\fgruler at cm@downright@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{\fgruler at width},\fgruler at lentounit{#1})(0,-\fgruler at lentounit{#1})%
+\fgruler at cm@downright{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(\fgruler at lentounit{\fgruler at sep},0){\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum}}}%
+\ifdim#1>.5cm\put(\fgruler at lentounit{\fgruler at sep},-5){\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\fgruler at caption@cm}}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@downright@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at cm@downright@{#1}}}
+
+%% DOWNRIGHT IN
+\def\fgruler at in@downright#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-1){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at i\fgruler at in@color at i\line(1,0){\fgruler at lentounit{\fgruler at in@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{2}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-2){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at ii\fgruler at in@color at ii\line(1,0){\fgruler at lentounit{\fgruler at in@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{4}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-4){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iii\fgruler at in@color at iii\line(1,0){\fgruler at lentounit{\fgruler at in@ratio at iii\fgruler at marklth}}}}%
+\fgruler at div{#1}{8}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-8){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iv\fgruler at in@color at iv\line(1,0){\fgruler at lentounit{\fgruler at in@ratio at iv\fgruler at marklth}}}}%
+\fgruler at div{#1}{16}%
+\multiput(0,0)(0,-16){\@tempcnta}{\fgruler at in@thick at v\fgruler at in@color at v\line(1,0){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(0,-1){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(\fgruler at lentounit{\fgruler at sep},-16)(0,-16){\@tempdima}{\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
+
+\def\fgruler at in@downright@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{\fgruler at width},\fgruler at lentounit{#1})(0,-\fgruler at lentounit{#1})%
+\fgruler at in@downright{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(\fgruler at lentounit{\fgruler at sep},0){\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum}}}%
+\ifdim#1>.5in\put(\fgruler at lentounit{\fgruler at sep},-8){\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\fgruler at caption@in}}}\fi%
+\end{picture}}
+
+\def\fgruler at in@downright@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at in@downright@{#1}}}
+
+%% DOWNLEFT CM
+\def\fgruler at cm@downleft#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-1){\@tempcnta}{\fgruler at ifnot@divisible at five{\fgruler at cm@thick at i\fgruler at cm@color at i\line(-1,0){\fgruler at lentounit{\fgruler at cm@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{5}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-5){\@tempcnta}{\fgruler at ifodd{\fgruler at cm@thick at ii\fgruler at cm@color at ii\line(-1,0){\fgruler at lentounit{\fgruler at cm@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{10}%
+\multiput(0,0)(0,-10){\@tempcnta}{\fgruler at cm@thick at iii\fgruler at cm@color at iii\line(-1,0){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(0,-1){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(-\fgruler at lentounit{\fgruler at sep},-10)(0,-10){\@tempdima}{\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
+
+\def\fgruler at cm@downleft@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{\fgruler at width},\fgruler at lentounit{#1})(-\fgruler at lentounit{\fgruler at width},-\fgruler at lentounit{#1})%
+\fgruler at cm@downleft{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(-\fgruler at lentounit{\fgruler at sep},0){\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum}}}%
+\ifdim#1>.5cm\put(-\fgruler at lentounit{\fgruler at sep},-5){\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\fgruler at caption@cm}}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@downleft@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at cm@downleft@{#1}}}
+
+%% DOWNLEFT IN
+\def\fgruler at in@downleft#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-1){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at i\fgruler at in@color at i\line(-1,0){\fgruler at lentounit{\fgruler at in@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{2}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-2){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at ii\fgruler at in@color at ii\line(-1,0){\fgruler at lentounit{\fgruler at in@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{4}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-4){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iii\fgruler at in@color at iii\line(-1,0){\fgruler at lentounit{\fgruler at in@ratio at iii\fgruler at marklth}}}}%
+\fgruler at div{#1}{8}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,-8){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iv\fgruler at in@color at iv\line(-1,0){\fgruler at lentounit{\fgruler at in@ratio at iv\fgruler at marklth}}}}%
+\fgruler at div{#1}{16}%
+\multiput(0,0)(0,-16){\@tempcnta}{\fgruler at in@thick at v\fgruler at in@color at v\line(-1,0){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(0,-1){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(-\fgruler at lentounit{\fgruler at sep},-16)(0,-16){\@tempdima}{\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
+
+\def\fgruler at in@downleft@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{\fgruler at width},\fgruler at lentounit{#1})(-\fgruler at lentounit{\fgruler at width},-\fgruler at lentounit{#1})%
+\fgruler at in@downleft{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(-\fgruler at lentounit{\fgruler at sep},0){\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum}}}%
+\ifdim#1>.5in\put(-\fgruler at lentounit{\fgruler at sep},-8){\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\fgruler at caption@in}}}\fi%
+\end{picture}}
+
+\def\fgruler at in@downleft@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at in@downleft@{#1}}}
+
+%% UPRIGHT CM
+\def\fgruler at cm@upright#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,1){\@tempcnta}{\fgruler at ifnot@divisible at five{\fgruler at cm@thick at i\fgruler at cm@color at i\line(1,0){\fgruler at lentounit{\fgruler at cm@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{5}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,5){\@tempcnta}{\fgruler at ifodd{\fgruler at cm@thick at ii\fgruler at cm@color at ii\line(1,0){\fgruler at lentounit{\fgruler at cm@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{10}%
+\multiput(0,0)(0,10){\@tempcnta}{\fgruler at cm@thick at iii\fgruler at cm@color at iii\line(1,0){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(0,1){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(\fgruler at lentounit{\fgruler at sep},10)(0,10){\@tempdima}{\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
+
+\def\fgruler at cm@upright@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{\fgruler at width},\fgruler at lentounit{#1})%
+\fgruler at cm@upright{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(\fgruler at lentounit{\fgruler at sep},0){\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum}}}%
+\ifdim#1>.5cm\put(\fgruler at lentounit{\fgruler at sep},5){\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\fgruler at caption@cm}}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@upright@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at cm@upright@{#1}}}
+
+%% UPRIGHT IN
+\def\fgruler at in@upright#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,1){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at i\fgruler at in@color at i\line(1,0){\fgruler at lentounit{\fgruler at in@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{2}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,2){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at ii\fgruler at in@color at ii\line(1,0){\fgruler at lentounit{\fgruler at in@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{4}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,4){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iii\fgruler at in@color at iii\line(1,0){\fgruler at lentounit{\fgruler at in@ratio at iii\fgruler at marklth}}}}%
+\fgruler at div{#1}{8}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,8){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iv\fgruler at in@color at iv\line(1,0){\fgruler at lentounit{\fgruler at in@ratio at iv\fgruler at marklth}}}}%
+\fgruler at div{#1}{16}%
+\multiput(0,0)(0,16){\@tempcnta}{\fgruler at in@thick at v\fgruler at in@color at v\line(1,0){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(0,1){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(\fgruler at lentounit{\fgruler at sep},16)(0,16){\@tempdima}{\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
+
+\def\fgruler at in@upright@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{\fgruler at width},\fgruler at lentounit{#1})%
+\fgruler at in@upright{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(\fgruler at lentounit{\fgruler at sep},0){\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum}}}%
+\ifdim#1>.5in\put(\fgruler at lentounit{\fgruler at sep},8){\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\fgruler at caption@in}}}\fi%
+\end{picture}}
+
+\def\fgruler at in@upright@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at in@upright@{#1}}}
+
+%% UPLEFT CM
+\def\fgruler at cm@upleft#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,1){\@tempcnta}{\fgruler at ifnot@divisible at five{\fgruler at cm@thick at i\fgruler at cm@color at i\line(-1,0){\fgruler at lentounit{\fgruler at cm@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{5}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,5){\@tempcnta}{\fgruler at ifodd{\fgruler at cm@thick at ii\fgruler at cm@color at ii\line(-1,0){\fgruler at lentounit{\fgruler at cm@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{10}%
+\multiput(0,0)(0,10){\@tempcnta}{\fgruler at cm@thick at iii\fgruler at cm@color at iii\line(-1,0){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(0,1){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(-\fgruler at lentounit{\fgruler at sep},10)(0,10){\@tempdima}{\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
+
+\def\fgruler at cm@upleft@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{\fgruler at width},\fgruler at lentounit{#1})(-\fgruler at lentounit{\fgruler at width},0)%
+\fgruler at cm@upleft{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(-\fgruler at lentounit{\fgruler at sep},0){\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum}}}%
+\ifdim#1>.5cm\put(-\fgruler at lentounit{\fgruler at sep},5){\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\fgruler at caption@cm}}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@upleft@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at cm@upleft@{#1}}}
+
+%% UPLEFT IN
+\def\fgruler at in@upleft#1{%
+\fgruler at rulercolor%
+\fgruler at markthickness%
+\fgruler at div{#1}{1}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,1){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at i\fgruler at in@color at i\line(-1,0){\fgruler at lentounit{\fgruler at in@ratio at i\fgruler at marklth}}}}%
+\fgruler at div{#1}{2}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,2){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at ii\fgruler at in@color at ii\line(-1,0){\fgruler at lentounit{\fgruler at in@ratio at ii\fgruler at marklth}}}}%
+\fgruler at div{#1}{4}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,4){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iii\fgruler at in@color at iii\line(-1,0){\fgruler at lentounit{\fgruler at in@ratio at iii\fgruler at marklth}}}}%
+\fgruler at div{#1}{8}%
+\setcounter{fgrulernum}{0}%
+\multiput(0,0)(0,8){\@tempcnta}{\fgruler at ifodd{\fgruler at in@thick at iv\fgruler at in@color at iv\line(-1,0){\fgruler at lentounit{\fgruler at in@ratio at iv\fgruler at marklth}}}}%
+\fgruler at div{#1}{16}%
+\multiput(0,0)(0,16){\@tempcnta}{\fgruler at in@thick at v\fgruler at in@color at v\line(-1,0){\fgruler at lentounit{\fgruler at marklth}}}%
+\iffgruler at borderline\put(0,0){\line(0,1){\fgruler at lentounit{#1}}}\fi%
+\setcounter{fgrulernum}{\fgruler at startnum}\stepcounter{fgrulernum}%
+\multiput(-\fgruler at lentounit{\fgruler at sep},16)(0,16){\@tempdima}{\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
+
+\def\fgruler at in@upleft@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{\fgruler at width},\fgruler at lentounit{#1})(-\fgruler at lentounit{\fgruler at width},0)%
+\fgruler at in@upleft{#1}%
+\setcounter{fgrulernum}{\fgruler at startnum}%
+\put(-\fgruler at lentounit{\fgruler at sep},0){\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum}}}%
+\ifdim#1>.5in\put(-\fgruler at lentounit{\fgruler at sep},8){\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\fgruler at caption@in}}}\fi%
+\end{picture}}
+
+\def\fgruler at in@upleft@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at in@upleft@{#1}}}
+
+%% UPPERLEFT CM
+\def\fgruler at cm@upperleft@#1#2{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{#2})(0,-\fgruler at lentounit{#2})%
+\fgruler at cm@rightdown{#1}%
+\fgruler at cm@downright{#2}%
+\ifdim#1>.5cm\put(5,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@upperleft@@#1#2{\leavevmode\hbox{}\lower#2\hbox{\fgruler at cm@upperleft@{#1}{#2}}}
+
+\def\fgruler at cm@upperleft at fg@#1#2{%
+\begingroup%
+\setlength{\fgruler at fg@width}{\paperwidth}%
+\addtolength{\fgruler at fg@width}{-#1}%
+\setlength{\fgruler at fg@height}{\paperheight}%
+\addtolength{\fgruler at fg@height}{-#2}%
+\fgruler at fgsetting%
+\AtPageLowerLeft{\put(\fgruler at lentounit{#1},0){%
+\fgruler at cm@upperleft@{\fgruler at fg@width}{\fgruler at fg@height}}}%
+\endgroup}
+
+\def\fgruler at cm@upperleft at fg{\fgruler at cm@upperleft at fg@{\fgruler at hshift}{\fgruler at vshift}}
+
+%% UPPERLEFT IN
+\def\fgruler at in@upperleft@#1#2{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{#2})(0,-\fgruler at lentounit{#2})%
+\fgruler at in@rightdown{#1}%
+\fgruler at in@downright{#2}%
+\ifdim#1>.5in\put(8,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\fgruler at caption@in}}\fi%
+\end{picture}}
+
+\def\fgruler at in@upperleft@@#1#2{\leavevmode\hbox{}\lower#2\hbox{\fgruler at in@upperleft@{#1}{#2}}}
+
+\def\fgruler at in@upperleft at fg@#1#2{%
+\begingroup%
+\setlength{\fgruler at fg@width}{\paperwidth}%
+\addtolength{\fgruler at fg@width}{-#1}%
+\setlength{\fgruler at fg@height}{\paperheight}%
+\addtolength{\fgruler at fg@height}{-#2}%
+\fgruler at fgsetting%
+\AtPageLowerLeft{\put(\fgruler at lentounit{#1},0){%
+\fgruler at in@upperleft@{\fgruler at fg@width}{\fgruler at fg@height}}}%
+\endgroup}
+
+\def\fgruler at in@upperleft at fg{\fgruler at in@upperleft at fg@{\fgruler at hshift}{\fgruler at vshift}}
+
+%% UPPERRIGHT CM
+\def\fgruler at cm@upperright@#1#2{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{#2})(-\fgruler at lentounit{#1},-\fgruler at lentounit{#2})%
+\fgruler at cm@leftdown{#1}%
+\fgruler at cm@downleft{#2}%
+\ifdim#1>.5cm\put(-5,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@upperright@@#1#2{\leavevmode\hbox{}\lower#2\hbox{\fgruler at cm@upperright@{#1}{#2}}}
+
+\def\fgruler at cm@upperright at fg@#1#2{%
+\begingroup%
+\setlength{\fgruler at fg@width}{\paperwidth}%
+\addtolength{\fgruler at fg@width}{-#1}%
+\setlength{\fgruler at fg@height}{\paperheight}%
+\addtolength{\fgruler at fg@height}{-#2}%
+\fgruler at fgsetting%
+\AtPageLowerLeft{\fgruler at cm@upperright@{\fgruler at fg@width}{\fgruler at fg@height}}%
+\endgroup}
+
+\def\fgruler at cm@upperright at fg{\fgruler at cm@upperright at fg@{\fgruler at hshift}{\fgruler at vshift}}
+
+%% UPPERRIGHT IN
+\def\fgruler at in@upperright@#1#2{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{#2})(-\fgruler at lentounit{#1},-\fgruler at lentounit{#2})%
+\fgruler at in@leftdown{#1}%
+\fgruler at in@downleft{#2}%
+\ifdim#1>.5in\put(-8,-\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[t]{\fgruler at font@\fgruler at caption@in}}\fi%
+\end{picture}}
+
+\def\fgruler at in@upperright@@#1#2{\leavevmode\hbox{}\lower#2\hbox{\fgruler at in@upperright@{#1}{#2}}}
+
+\def\fgruler at in@upperright at fg@#1#2{%
+\begingroup%
+\setlength{\fgruler at fg@width}{\paperwidth}%
+\addtolength{\fgruler at fg@width}{-#1}%
+\setlength{\fgruler at fg@height}{\paperheight}%
+\addtolength{\fgruler at fg@height}{-#2}%
+\fgruler at fgsetting%
+\AtPageLowerLeft{\fgruler at in@upperright@{\fgruler at fg@width}{\fgruler at fg@height}}%
+\endgroup}
+
+\def\fgruler at in@upperright at fg{\fgruler at in@upperright at fg@{\fgruler at hshift}{\fgruler at vshift}}
+
+%% LOWERLEFT CM
+\def\fgruler at cm@lowerleft@#1#2{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{#2})%
+\fgruler at cm@rightup{#1}%
+\fgruler at cm@upright{#2}%
+\ifdim#1>.5cm\put(5,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@lowerleft@@#1#2{\leavevmode\hbox{}\lower#2\hbox{\fgruler at cm@lowerleft@{#1}{#2}}}
+
+\def\fgruler at cm@lowerleft at fg@#1#2{%
+\begingroup%
+\setlength{\fgruler at fg@width}{\paperwidth}%
+\addtolength{\fgruler at fg@width}{-#1}%
+\setlength{\fgruler at fg@height}{\paperheight}%
+\addtolength{\fgruler at fg@height}{-#2}%
+\fgruler at fgsetting%
+\AtPageLowerLeft{\put(\fgruler at lentounit{#1},\fgruler at lentounit{#2}){%
+\fgruler at cm@lowerleft@{\fgruler at fg@width}{\fgruler at fg@height}}}%
+\endgroup}
+
+\def\fgruler at cm@lowerleft at fg{\fgruler at cm@lowerleft at fg@{\fgruler at hshift}{\fgruler at vshift}}
+
+%% LOWERLEFT IN
+\def\fgruler at in@lowerleft@#1#2{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{#2})%
+\fgruler at in@rightup{#1}%
+\fgruler at in@upright{#2}%
+\ifdim#1>.5in\put(8,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@in}}\fi%
+\end{picture}}
+
+\def\fgruler at in@lowerleft@@#1#2{\leavevmode\hbox{}\lower#2\hbox{\fgruler at in@lowerleft@{#1}{#2}}}
+
+\def\fgruler at in@lowerleft at fg@#1#2{%
+\begingroup%
+\setlength{\fgruler at fg@width}{\paperwidth}%
+\addtolength{\fgruler at fg@width}{-#1}%
+\setlength{\fgruler at fg@height}{\paperheight}%
+\addtolength{\fgruler at fg@height}{-#2}%
+\fgruler at fgsetting%
+\AtPageLowerLeft{\put(\fgruler at lentounit{#1},\fgruler at lentounit{#2}){%
+\fgruler at in@lowerleft@{\fgruler at fg@width}{\fgruler at fg@height}}}%
+\endgroup}
+
+\def\fgruler at in@lowerleft at fg{\fgruler at in@lowerleft at fg@{\fgruler at hshift}{\fgruler at vshift}}
+
+%% LOWERRIGHT CM
+\def\fgruler at cm@lowerright@#1#2{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{#2})(-\fgruler at lentounit{#1},0)%
+\fgruler at cm@leftup{#1}%
+\fgruler at cm@upleft{#2}%
+\ifdim#1>.5cm\put(-5,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\end{picture}}
+
+\def\fgruler at cm@lowerright@@#1#2{\leavevmode\hbox{}\lower#2\hbox{\fgruler at cm@lowerright@{#1}{#2}}}
+
+\def\fgruler at cm@lowerright at fg@#1#2{%
+\begingroup%
+\setlength{\fgruler at fg@width}{\paperwidth}%
+\addtolength{\fgruler at fg@width}{-#1}%
+\setlength{\fgruler at fg@height}{\paperheight}%
+\addtolength{\fgruler at fg@height}{-#2}%
+\fgruler at fgsetting%
+\AtPageLowerLeft{\put(0,\fgruler at lentounit{#2}){%
+\fgruler at cm@lowerright@{\fgruler at fg@width}{\fgruler at fg@height}}}%
+\endgroup}
+
+\def\fgruler at cm@lowerright at fg{\fgruler at cm@lowerright at fg@{\fgruler at hshift}{\fgruler at vshift}}
+
+%% LOWERRIGHT IN
+\def\fgruler at in@lowerright@#1#2{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(\fgruler at lentounit{#1},\fgruler at lentounit{#2})(-\fgruler at lentounit{#1},0)%
+\fgruler at in@leftup{#1}%
+\fgruler at in@upleft{#2}%
+\ifdim#1>.5in\put(-8,\fgruler at lentounit{\fgruler at sep}){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@in}}\fi%
+\end{picture}}
+
+\def\fgruler at in@lowerright@@#1#2{\leavevmode\hbox{}\lower#2\hbox{\fgruler at in@lowerright@{#1}{#2}}}
+
+\def\fgruler at in@lowerright at fg@#1#2{%
+\begingroup%
+\setlength{\fgruler at fg@width}{\paperwidth}%
+\addtolength{\fgruler at fg@width}{-#1}%
+\setlength{\fgruler at fg@height}{\paperheight}%
+\addtolength{\fgruler at fg@height}{-#2}%
+\fgruler at fgsetting%
+\AtPageLowerLeft{\put(0,\fgruler at lentounit{#2}){%
+\fgruler at in@lowerright@{\fgruler at fg@width}{\fgruler at fg@height}}}%
+\endgroup}
+
+\def\fgruler at in@lowerright at fg{\fgruler at in@lowerright at fg@{\fgruler at hshift}{\fgruler at vshift}}
+\endinput
+%%
+%% End of file `fgruler.sty'.

Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2017-01-16 01:02:37 UTC (rev 42965)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2017-01-16 23:09:41 UTC (rev 42966)
@@ -251,7 +251,7 @@
     fancyref fancyslides fancytabs fancytooltips fancyvrb fandol
     FAQ-en fast-diagram fbb fbithesis fbs
     fc fcavtex fcltxdoc fcolumn fdsymbol featpost fei fenixpar
-    fetamont feupphdteses feyn feynmf feynmp-auto ffslides fge
+    fetamont feupphdteses feyn feynmf feynmp-auto ffslides fge fgruler
     fibeamer fifinddo-info fifo-stack fig4latex figbas figbib figflow figsize
     filecontents filecontentsdef filedate filehook fileinfo filemod
     findhyph fink finstrut fira first-latex-doc fitbox fithesis

Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds	2017-01-16 01:02:37 UTC (rev 42965)
+++ trunk/Master/tlpkg/libexec/ctan2tds	2017-01-16 23:09:41 UTC (rev 42966)
@@ -502,6 +502,7 @@
  'gfsporson',   "&MAKEflatten",
  'gfssolomos',  "&MAKEflatten",
  'ghostgum',    "die 'skipping, nonfree'",
+ 'gladtex',	"die 'skipping, requires python setup.py?'",
  'glhyph',      "die 'skipping, merged into hyph-utf8'",
  'glossary',    "die 'skipping, replaced by glossaries'",
  'glosstex',    "die 'skipping, requires compilation'",

Modified: trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2017-01-16 01:02:37 UTC (rev 42965)
+++ trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2017-01-16 23:09:41 UTC (rev 42966)
@@ -379,6 +379,7 @@
 depend fancytooltips
 depend fcolumn
 depend ffslides
+depend fgruler
 depend fibeamer
 depend fifo-stack
 depend figsize

Added: trunk/Master/tlpkg/tlpsrc/fgruler.tlpsrc
===================================================================


More information about the tex-live-commits mailing list