texlive[63721] Master/texmf-dist: fgruler (25jun22)

commits+karl at tug.org commits+karl at tug.org
Sat Jun 25 22:22:33 CEST 2022


Revision: 63721
          http://tug.org/svn/texlive?view=revision&revision=63721
Author:   karl
Date:     2022-06-25 22:22:32 +0200 (Sat, 25 Jun 2022)
Log Message:
-----------
fgruler (25jun22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/fgruler/fgruler.pdf
    trunk/Master/texmf-dist/source/latex/fgruler/fgruler.dtx
    trunk/Master/texmf-dist/tex/latex/fgruler/fgruler.sty

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

Modified: trunk/Master/texmf-dist/source/latex/fgruler/fgruler.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fgruler/fgruler.dtx	2022-06-25 20:22:10 UTC (rev 63720)
+++ trunk/Master/texmf-dist/source/latex/fgruler/fgruler.dtx	2022-06-25 20:22:32 UTC (rev 63721)
@@ -21,22 +21,19 @@
 \ProvidesFile{fgruler.dtx}
 %</driver>
 %<package>\NeedsTeXFormat{LaTeX2e}[2020/10/01]
-%<package>\ProvidesPackage{fgruler}[2022/06/19 v1.4 Package for drawing rulers on the foreground or in the text]
+%<package>\ProvidesPackage{fgruler}[2022/06/25 v1.5 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}
+\AddToHook{begindocument/before}[doc/hyperref]{\hypersetup{pdfstartview=FitH,allcolors=black}}% see in doc.sty and hypdoc.sty
+\usepackage[a4paper,margin=25mm,marginparwidth=15mm,marginparsep=5mm,headsep=5mm,headheight=4mm,footskip=10mm]{geometry}
 \usepackage[T1]{fontenc}
 \usepackage{lmodern}
 \usepackage[english]{babel}
-\usepackage{listings,fontawesome,fancyvrb}
-\usepackage[type=none,color=red!80!black]{fgruler}
+\usepackage{listings,fontawesome}
+\usepackage[type=none]{fgruler}
 
-\flushbottom
-\VerbatimFootnotes
-
 \setlength{\labelsep}{0pt}
 
 \lstnewenvironment{examplelst}{\lstset{
@@ -43,12 +40,13 @@
 gobble=2,
 belowskip=\bigskipamount,
 basicstyle=\ttfamily,
-backgroundcolor=\color{black!10},
+backgroundcolor=\color{blue!10},
+framerule=0pt,
 frame=trbl,
-framesep=3pt,
+framesep=5pt,
 columns=fullflexible,
-xleftmargin=3.4pt,
-xrightmargin=3.4pt,
+xleftmargin=5pt,
+xrightmargin=5pt,
 keepspaces}}{}
 
 \newcommand{\commandinline}{\lstinline[
@@ -65,46 +63,41 @@
 % \fi
 %
 % \GetFileInfo{fgruler.sty}
-%
-% \title{The {\bfseries\sffamily fgruler} package\\{\large v1.4 (2022/06/19)}}
-% \author{Tibor T\'{o}m\'{a}cs\\{\normalsize\url{tomacs.tibor at uni-eszterhazy.hu}}}
+% 
+% \title{The \texorpdfstring{{\bfseries\sffamily fgruler} package\\{\large v1.5 (2022/06/25)}}{fgruler package}}
+% \author{\texorpdfstring{Tibor T\'{o}m\'{a}cs\\{\normalsize\url{tomacs.tibor at uni-eszterhazy.hu}}}{Tibor T\'{o}m\'{a}cs}}
 % \date{}
 % \maketitle
 % 
-% \fgruler{upperleft}{0cm}{0cm}
-% \noindent
-% {\rulerparams{}{\scriptsize\sffamily\color{teal}}{blue}{}{}
-% {\fgrulerdefnum{}\fgrulercaptioncm{}\ruler{rightdown}{\textwidth}}\\[2pt]
-% \ruler{rightup}{\textwidth}}
+% \fgruler*[color=red!80!black]{upperleft}
+% \noindent{\rulerparams{}{\scriptsize\sffamily\color{teal}}{blue}{}{}\ruler{taperight}{\textwidth}}
 % 
 % \section{Introduction}
-% The \texttt{fgruler} is an abbreviation for the \emph{foreground ruler}.
-% This package draws horizontal and vertical rulers on the foreground of every (or a given) page at absolute position.
+% The |fgruler| package draws horizontal and vertical rulers on the foreground of every (or the current) page at absolute position.
 % In this way, you can check the page layout dimensions.
+% You can also draw various rulers in the text.
 % 
 % \medskip\noindent
-% Besides, you can draw various rulers in the text, too.
+% The |fgruler| package requires the services of the following packages: |kvoptions|, |etoolbox|, |xcolor|, |graphicx|, |eso-pic|.
 % 
-% \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}|
+% \commandinline|\usepackage[!<package options>!]{fgruler}|
 % \end{flushleft}
 % or
 % \begin{flushleft}
 % \commandinline|\usepackage{fgruler}|\\
-% \commandinline|\setfgruler{!<options>!}|
+% \commandinline|\setfgruler{!<package options>!}|
 % \end{flushleft}
-% The \verb|\setfgruler| command is usable in the \texttt{document} environment, too.
+% The |\setfgruler| command is usable in the document body, 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.
+% \section{Package options}\label{sec:options}
+% By default, the |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. The \commandinline|!<unit>!| legal values:
+% Ruler unit. Possible \commandinline|!<unit>!| values:
 % \begin{description}
 % \item\commandinline|cm| Metric ruler (centimeter). Default value.
 % \item\commandinline|in| English ruler (inch).
@@ -111,78 +104,86 @@
 % \end{description}
 % 
 % \item\commandinline|type=!<type name>!|\\
-% Origin, directions and lengths of the ruler. The \commandinline|!<type name>!| legal values:
+% It determines the origin, directions, and lengths of the ruler. Possible \commandinline|!<type name>!| values:
 % \begin{description}
-% \item\commandinline|upperleft| Default value. Origin: upper left corner of the paper. Directions: down and right. Lengths: paper sizes. See \ref{example:upperleft} example.
-% \item\commandinline|upperright| Origin: upper right corner of the paper. Directions: down and left. Lengths: paper sizes. See \ref{example:upperright} example.
-% \item\commandinline|lowerleft| Origin: lower left corner of the paper. Directions: up and right. Lengths: paper sizes. See \ref{example:lowerleft} example.
-% \item\commandinline|lowerright| Origin: lower right corner of the paper. Directions: up and left. Lengths: paper sizes. See \ref{example:lowerright} example.
-% \item\commandinline|upperleftT| Origin: upper left corner of the text area. Directions: down and right. Lengths: text area sizes. See \ref{example:upperleftT} example.
-% \item\commandinline|upperrightT| Origin: upper right corner of the text area. Directions: down and left. Lengths: text area sizes. See \ref{example:upperrightT} example.
-% \item\commandinline|lowerleftT| Origin: lower left corner of the text area. Directions: up and right. Lengths: text area sizes. See \ref{example:lowerleftT} example.
-% \item\commandinline|lowerrightT| Origin: lower right corner of the text area. Directions: up and left. Lengths: text area sizes. See \ref{example:lowerrightT} example.
+% \item\commandinline|upperleft| Default value. Square ruler (origin: upper left corner of the paper; directions: down and right; lengths: paper sizes). See Example \ref{example:upperleft}.
+% \item\commandinline|upperright| Square ruler (origin: upper right corner of the paper; directions: down and left; lengths: paper sizes). See Example \ref{example:upperright}.
+% \item\commandinline|lowerleft| Square ruler (origin: lower left corner of the paper; directions: up and right; lengths: paper sizes). See Example \ref{example:lowerleft}.
+% \item\commandinline|lowerright| Square ruler (origin: lower right corner of the paper; directions: up and left; lengths: paper sizes). See Example \ref{example:lowerright}.
+% \item\commandinline|upperleftT| Square ruler (origin: upper left corner of the text area; directions: down and right; lengths: text area sizes). See Example \ref{example:upperleftT}.
+% \item\commandinline|upperrightT| Square ruler (origin: upper right corner of the text area; directions: down and left; lengths: text area sizes). See Example \ref{example:upperrightT}.
+% \item\commandinline|lowerleftT| Square ruler (origin: lower left corner of the text area; directions: up and right; lengths: text area sizes). See Example \ref{example:lowerleftT}.
+% \item\commandinline|lowerrightT| Square ruler (origin: lower right corner of the text area; directions: up and left; lengths: text area sizes). See Example \ref{example:lowerrightT}.
 % \item\commandinline|alledges| There are rulers on all edges of the paper. 
 % Top ruler origin: upper left corner of the paper (direction: right). 
 % Bottom ruler origin: lower left corner of the paper (direction: right). 
 % Left ruler origin: upper left corner of the paper (direction: down). 
-% Right ruler origin: upper right corner of the paper (direction: down). Lengths: paper sizes. See \ref{example:alledges} example.
-% \item\commandinline|alledges*| It is similar to \verb|alledges| option, but bottom ruler origin is lower right corner of the paper (direction: left), 
+% Right ruler origin: upper right corner of the paper (direction: down). Lengths: paper sizes. See Example \ref{example:alledges}.
+% \item\commandinline|alledges*| It is similar to |alledges| option, but bottom ruler origin is lower right corner of the paper (direction: left), 
 % and left ruler origin is lower left corner of the paper (direction: up). 
-% See \ref{example:alledges*} example.
-% \item\commandinline|alledgesT| It is similar to \verb|alledges| option, but on the edges of the text area. See \ref{example:alledgesT} example.
-% \item\commandinline|alledgesT*| It is similar to \verb|alledges*| option, but on the edges of the text area. See \ref{example:alledgesT*} example.
-% \item\commandinline|none| Not drawing ruler.
+% See Example \ref{example:alledges*}.
+% \item\commandinline|alledgesT| It is similar to |alledges| option, but on the edges of the text area. See Example \ref{example:alledgesT}.
+% \item\commandinline|alledgesT*| It is similar to |alledges*| option, but on the edges of the text area. See Example \ref{example:alledgesT*}.
 % \item\commandinline|user| Each \commandinline|!<unit>!|--\commandinline|!<type name>!| pair activates an \commandinline|\fgrulertype{!<unit>!}{!<type name>!}| command.
-% After \commandinline|\fgrulerdefuser!<unit>!{!<code>!}| the expansion of \commandinline|\fgrulertype{!<unit>!}{user}| is \commandinline|!<code>!|,
-% which determines the effect of this option.
-% See \ref{example:user-first}--\ref{example:user-last} examples.
+% So the expansion of \commandinline|\fgrulertype{!<unit>!}{user}| determines the effect of this option.
+% It will be \commandinline|!<code>!| after using the \commandinline|\fgrulerdefuser{!<code>!}| command, 
+% where in the \commandinline|!<code>!| you have to referrence the unit as \commandinline|\fgrulerunit|.
+% For example, after\\ |\fgrulerdefuser{\fgrulertype{\fgrulerunit}{alledges}}|\\ the |type=user| option will be equivalent to the |type=alledges|.
+% See also Examples \ref{example:user-first}--\ref{example:user-last}.
+% \item\commandinline|none| No ruler drawn.
 % \end{description}
+%
+% \item\commandinline|type={!<type name list>!}|\\
+% The \commandinline|!<type name list>!| is a list of valid type names separated by commas. 
+% These types will be combined.
+% For example |type={alledges,alledgesT}|.
+% See the result in Example \ref{example:combining}.
 % 
 % \item\commandinline|hshift=!<length>!|\\
-% Horizontal shift of the ruler, if the \commandinline|!<type name>!| is \verb|upperleft|, \verb|lowerleft|, \verb|upperright|, or \verb|lowerright|.
-% The shift direction is right, if the \commandinline|!<type name>!| is \verb|upperleft| or \verb|lowerleft|.
-% The shift direction is left, if the \commandinline|!<type name>!| is \verb|upperright| or \verb|lowerright|.
-% Default: \verb|hshift=0cm|.
-% See \ref{example:shift-first}--\ref{example:shift-last} examples.
+% Horizontal shift of the ruler, if the \commandinline|!<type name>!| is |upperleft|, |lowerleft|, |upperright|, or |lowerright|.
+% The shift direction is right, if the \commandinline|!<type name>!| is |upperleft| or |lowerleft|.
+% The shift direction is left, if the \commandinline|!<type name>!| is |upperright| or |lowerright|.
+% Default: |hshift=0cm|.
+% See Examples \ref{example:shift-first}--\ref{example:shift-last}.
 % 
 % \item\commandinline|vshift=!<length>!|\\
-% Vertical shift of the ruler, if the \commandinline|!<type name>!| is \verb|upperleft|, \verb|lowerleft|, \verb|upperright|, or \verb|lowerright|.
-% The shift direction is down, if the \commandinline|!<type name>!| is \verb|upperleft| or \verb|upperright|.
-% The shift direction is up, if the \commandinline|!<type name>!| is \verb|lowerleft| or \verb|lowerright|.
-% Default: \verb|vshift=0cm|.
-% See \ref{example:shift-first}--\ref{example:shift-last} examples.
+% Vertical shift of the ruler, if the \commandinline|!<type name>!| is |upperleft|, |lowerleft|, |upperright|, or |lowerright|.
+% The shift direction is down, if the \commandinline|!<type name>!| is |upperleft| or |upperright|.
+% The shift direction is up, if the \commandinline|!<type name>!| is |lowerleft| or |lowerright|.
+% Default: |vshift=0cm|.
+% See Examples \ref{example:shift-first}--\ref{example:shift-last}.
 % 
 % \item\commandinline|color=!<color name>!|\\
-% Ruler color (see \texttt{xcolor} package). Default: \verb|color=black|. 
-% See \ref{example:showframe-color} example.
+% Ruler color (see |xcolor| package). Default: |color=black|. 
+% See Example \ref{example:showframe-color}.
 % 
 % \item\commandinline|numsep=!<length>!|\\
-% Separation between number and ruler. Default: \verb|numsep=3pt|.
+% Separation between number and ruler. Default: |numsep=3pt|.
 % 
 % \item\commandinline|markthick=!<length>!|\\
-% Mark thickness. Default: \verb|markthick=0.4pt|.
+% Mark thickness. Default: |markthick=0.4pt|.
 % 
 % \item\commandinline|marklength=!<length>!|\\
 % Mark length at integer units (see the red marks):
 % {\fgrulernoborderline\fgrulercaptioncm{}\fgrulerthickcm{}{}{1pt}\fgrulercolorcm{}{}{red}\ruler{rightup}{3cm}}
-% Default: \verb|marklength=2mm|. See the length of the other marks in Section \ref{sec:additional}.
+% Default: |marklength=2mm|. See the length of the other marks in Section \ref{sec:additional}.
 % 
 % \item\commandinline|numfont=!<font type>!|\\
-% Number font type. Default: \verb|numfont=\scriptsize\sffamily|. You can use this option only in \verb|\setfgruler| command.
+% Number font type. Default: |numfont=\scriptsize\sffamily|. You can use this option only in |\setfgruler| and |\fgruler*| (see Section \ref{sec:currentpage}) commands.
 % 
 % \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.
-% See \ref{example:showframe-color} example.
+% Their color and thickness are determined by the |color| and the |markthick| options.
+% See Example \ref{example:showframe-color}.
 % 
 % \item\commandinline|showframe=false|\\
-% It deactivates the \texttt{showframe} option.
+% It deactivates the |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.
+% It kills all of the rulers on the foreground, including also those, which are generated by |\fgruler| or |\fgruler*| (see Section \ref{sec:currentpage}).
+% But the rulers, which were drawn by |\ruler| and |\squareruler| (see Section \ref{sec:intext}), do not disappear.
+% Furthermore it deactivates the |showframe| option, too.
+% In this case the |fgruler| package does not load the |eso-pic| package.
 % This option works only in preamble.
 % 
 % It is recommended to use in two cases:
@@ -191,48 +192,65 @@
 % \item To halt the checking function temporarily.
 % \end{itemize}
 % 
-% The \texttt{type=none} is not identical with \texttt{nonefgrulers} option. The differences:
+% The |type=none| is not identical with |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}.
+% \item |type=none| does not kill the |\fgruler| and |\fgruler*| commands and the |showframe| option.
+% \item |type=none| is alterable in any point of the document.
+% \item The |fgruler| package loads the |eso-pic| package, if you use the |type=none| option without |nonefgrulers|.
 % \end{itemize}
 % \end{description}
 % 
-% \section{Drawing square rulers on the foreground of a given page}\label{sec:givenpage}
+% \section{Drawing rulers on the foreground of the current page}\label{sec:currentpage}
 % \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.
+% You can use more |\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|.
+% The package options (see Section \ref{sec:options}) also work on this command, except for |type|, |hshift|, and |vshift|.
 % 
-% If you use \texttt{nonefgrulers} option in preamble, then this command is effectless.
+% This command is effectless, if you use the |nonefgrulers| package option in the preamble.
 % \begin{description}
-% \item\commandinline|!<unit!>| options:\\
-% \commandinline|cm| Metric ruler (centimeter). Default option.\\
-% \commandinline|in| English ruler (inch).
+% \item\commandinline|!<unit!>| options: 
+% \commandinline|cm|, \commandinline|in| (see Section \ref{sec:options}).
+% Its default value is the same as the value specified by the |unit=|\commandinline|!<unit!>| package option.
 % 
-% \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|!<type name!>| parameters:
+% \commandinline|upperleft|, \commandinline|upperright|, \commandinline|lowerleft|, \commandinline|lowerright| (see Section \ref{sec:options}).
 % 
 % \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.
+% The shift direction is right, if the \commandinline|!<type name>!| is |upperleft| or |lowerleft|, otherwise 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.
+% The shift direction is down, if the \commandinline|!<type name>!| is |upperleft| or |upperright|, otherwise up.
+% \end{description}
 % 
-% \item Example:
-% \verb|\fgruler[in]{upperright}{1in}{2.5in}|
+% Example: |\fgruler[in]{upperright}{1in}{2.5in}|
 % \end{description}
+% \begin{description}
+% \item\commandinline|\fgruler*[!<package options!>]{!<type name>!}|\\
+% It draws a ruler on the foreground of that page, where this command is expanded.
+% You can use more |\fgruler*| commands in the same page.
+% 
+% The package options (see Section \ref{sec:options}) also work on this command, except for |type|.
+% 
+% This command is effectless, if you use the |nonefgrulers| package option in the preamble.
+% \begin{description}
+% \item\commandinline|!<package options!>|
+% All options from Section \ref{sec:options}, except for |type|, |showframe|, and |nonefgrulers|.
+% 
+% \item\commandinline|!<type name!>| 
+% All possible values of the |type| option from Section \ref{sec:options}, except for the |none| value.
 % \end{description}
 % 
+% Example: |\fgruler*[color=red,type=in]{alledges}|
+%
+% Note that the following two commands are equivalent:\\
+% |\fgruler*[unit=in,hshift=1in,vshift=2.5in]{upperright}|\\
+% |\fgruler[in]{upperright}{1in}{2.5in}|
+% \end{description}
+% 
 % \section{Drawing rulers in the text}\label{sec:intext}
 % \begin{description}
 % \item\commandinline|\ruler[!<unit!>]{!<type name>!}{!<length>!}|\\
@@ -252,22 +270,22 @@
 % \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.
+% \commandinline|leftup    | Direction: left. The numbers are on the up side.\\
+% \commandinline|taperight | Tape measure (direction: right). See Example \ref{example:tape}.\\
+% \commandinline|tapeleft  | Tape measure (direction: left). See Example \ref{example:tape}.
 % 
 % \item\commandinline|!<length>!|
 % Ruler length.
-% 
-% \item Example:
-% \verb|\ruler{rightdown}{5cm}|
-% \ruler{rightdown}{5cm}
 % \end{description}
 % 
+% Example: |\ruler{rightdown}{5cm}| \ruler{rightdown}{5cm}
+% 
 % \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.
+% It works like |\ruler|, but the top of the ruler is aligned to the baseline of the surrounding text.
 % 
 % Example:
-% \verb|\ruler*{rightdown}{5cm}|
-% \ruler*{rightdown}{5cm}
+% |\ruler*{taperight}{5cm}|
+% \ruler*{taperight}{5cm}
 % 
 % \item\commandinline|\squareruler[!<unit!>]{!<type name>!}{!<width>!}{!<height>!}|\\
 % It draws a square ruler.
@@ -289,92 +307,93 @@
 % 
 % \item\commandinline|!<height>!|
 % Square ruler height.
+% \end{description}
 % 
-% \item Example:
-% \verb|\squareruler{upperleft}{5cm}{1cm}|
+% Example:
+% |\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.
+% It works like |\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}|
 % \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|. 
+% It sets the parameters of the rulers, which are drawn by |\ruler| or |\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.
+% \item\commandinline|!<markthick>!| Mark thickness. Default: |0.4pt|
+% \item\commandinline|!<numfont>!| Number font type. Default: |\scriptsize\sffamily|
+% \item\commandinline|!<color>!| Ruler line color. Default: |black|
+% \item\commandinline|!<marklength>!| Mark length at integer units. Default: |2mm|
+% \item\commandinline|!<numsep>!| Separation between number and ruler. Default: |3pt|
 % \end{description}
+%
+% For example, |\rulerparams{}{}{red}{}{}| changes the ruler color to red.
 % 
 % \item\commandinline|\rulerparamsfromfg|\\
-% It sets the ruler parameters from the actual foreground ruler parameters.
+% It sets the ruler parameters from the current foreground ruler parameters.
 % 
 % \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$.
+% By default, the numbers of the vertical rulers (which were generated by |\ruler| or |\squareruler|) are rotated by 90$^\circ$.
 % It kills this action.
-% This command is usable only in \texttt{document} environment.
+% This command can only be expanded in the document body.
 % 
-% Example: \verb|{\rulernorotatenum\ruler{upright}{1cm}}| {\rulernorotatenum\ruler{upright}{1cm}}
+% Example: |{\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.
+% After |\rulernorotatenum|, it reactivates the number rotating.
+% This command can only be expanded in the document body.
 % \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.
+% The following commands can work on all of the rulers, which are drawn by |fgruler| package.
 % \begin{description}
 % \item\commandinline|\fgrulerstartnum{!<num>!}|\\
 % The \commandinline|!<num>!| is a nonnegative integer, which will be the starting number on the horizontal and vertical rulers.
-% Default: \verb|\fgrulerstartnum{0}|
+% Default: |\fgrulerstartnum{0}|
 % 
-% Example: \verb|{\fgrulerstartnum{5}\squareruler{lowerleft}{3cm}{1cm}}| {\fgrulerstartnum{5}\squareruler{lowerleft}{3cm}{1cm}}
+% Example: |{\fgrulerstartnum{5}\squareruler{lowerleft}{3cm}{1cm}}| {\fgrulerstartnum{5}\squareruler{lowerleft}{3cm}{1cm}}
 % 
 % \item\commandinline|\fgrulerstartnumh{!<num>!}|\\
 % The \commandinline|!<num>!| is a nonnegative integer, which will be the starting number on the horizontal rulers.
-% Default: \verb|\fgrulerstartnumh{0}|
+% Default: |\fgrulerstartnumh{0}|
 % 
-% Example: \verb|{\fgrulerstartnumh{5}\squareruler{lowerleft}{3cm}{1cm}}| {\fgrulerstartnumh{5}\squareruler{lowerleft}{3cm}{1cm}}
+% Example: |{\fgrulerstartnumh{5}\squareruler{lowerleft}{3cm}{1cm}}| {\fgrulerstartnumh{5}\squareruler{lowerleft}{3cm}{1cm}}
 % 
 % \item\commandinline|\fgrulerstartnumv{!<num>!}|\\
 % The \commandinline|!<num>!| is a nonnegative integer, which will be the starting number on the vertical rulers.
-% Default: \verb|\fgrulerstartnumv{0}|
+% Default: |\fgrulerstartnumv{0}|
 % 
-% Example: \verb|{\fgrulerstartnumv{5}\squareruler{lowerleft}{3cm}{1cm}}| {\fgrulerstartnumv{5}\squareruler{lowerleft}{3cm}{1cm}}
+% Example: |{\fgrulerstartnumv{5}\squareruler{lowerleft}{3cm}{1cm}}| {\fgrulerstartnumv{5}\squareruler{lowerleft}{3cm}{1cm}}
 % 
 % \item\commandinline|\fgrulernoborderline|\\
 % By default, there is a borderline on one side of the ruler.
 % It disappears by this command.
 % 
-% Example: \verb|{\fgrulernoborderline\ruler{rightup}{3cm}}| {\fgrulernoborderline\ruler{rightup}{3cm}}
+% Example: |{\fgrulernoborderline\ruler{rightup}{3cm}}| {\fgrulernoborderline\ruler{rightup}{3cm}}
 % 
 % \item\commandinline|\fgrulerborderline|\\
-% After \verb|\fgrulernoborderline|, it reactivates the previous default effect.
+% After |\fgrulernoborderline|, it reactivates the previous default effect.
 % 
 % \item\commandinline|\fgrulercaptioncm{!<caption>!}|\\
 % Unit caption in metric ruler.
-% Default: \verb|\fgrulercaptioncm{cm}|
+% Default: |\fgrulercaptioncm{cm}|
 % 
-% Example: \verb|{\fgrulercaptioncm{}\ruler{rightup}{3cm}}| {\fgrulercaptioncm{}\ruler{rightup}{3cm}}
+% Example: |{\fgrulercaptioncm{}\ruler{rightup}{3cm}}| {\fgrulercaptioncm{}\ruler{rightup}{3cm}}
 % 
 % \item\commandinline|\fgrulercaptionin{!<caption>!}|\\
 % Unit caption in English ruler.
-% Default: \verb|\fgrulercaptionin{inch}|
+% Default: |\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}}|.
+% Its default definition is |\def\thefgrulernum{\arabic{fgrulernum}}|, which is equivalent to |\fgrulerdefnum{\arabic{fgrulernum}}|.
 % 
-% Example: \verb|{\fgrulerdefnum{}\fgrulercaptioncm{}\ruler{rightdown}{2cm}}| {\fgrulerdefnum{}\fgrulercaptioncm{}\ruler{rightdown}{2cm}}
+% Example: |{\fgrulerdefnum{}\fgrulercaptioncm{}\ruler{rightdown}{2cm}}| {\fgrulerdefnum{}\fgrulercaptioncm{}\ruler{rightdown}{2cm}}
 % 
 % \item\commandinline|\fgrulerratiocm{!<ratio1>!}{!<ratio2>!}|\\
 % Mark length ratios in metric rulers.
@@ -388,10 +407,10 @@
 % \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}
 % 
+% Default: |\fgrulerratiocm{0.5}{0.75}|
+% 
 % \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.
@@ -411,10 +430,10 @@
 % \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}
 % 
+% Default: |\fgrulerratioin{0.25}{0.375}{0.625}{0.75}|
+% 
 % \item\commandinline|\fgrulerthickcm{!<thick1>!}{!<thick2>!}{!<thick3>!}|\\
 % Mark thicknesses in metric rulers.
 % If an argument is empty, then that parameter will not be changed.
@@ -427,19 +446,19 @@
 % 
 % \item\commandinline|!<thick3>!|
 % Mark thickness at integer units.
+% \end{description}
 % 
-% \item The default values are given by \commandinline|!<markthick>!| of \verb|\rulerparams|, respectively by \texttt{markthick} option.
+% The default values are given by \commandinline|!<markthick>!| of |\rulerparams|, respectively by |markthick| option.
 % 
-% \item Example:\\
-% \verb|{\fgrulerthickcm{}{}{2pt}|\\
-% \verb|\rulerparams{}{}{}{5mm}{}|\\
-% \verb|\fgrulernoborderline|\\
-% \verb|\ruler{rightdown}{3cm}}|\\[2mm]
+% Example:\\
+% |{\fgrulerthickcm{}{}{2pt}|\\
+% |\rulerparams{}{}{}{5mm}{}|\\
+% |\fgrulernoborderline|\\
+% |\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.
@@ -459,19 +478,19 @@
 % 
 % \item\commandinline|!<thick5>!|
 % Mark thickness at integer units.
+% \end{description}
 % 
-% \item The default values are given by \commandinline|!<markthick>!| of \verb|\rulerparams|, respectively by \texttt{markthick} option.
+% The default values are given by \commandinline|!<markthick>!| of |\rulerparams|, respectively by |markthick| option.
 % 
-% \item Example:\\
-% \verb|{\fgrulerthickin{}{}{}{}{2pt}|\\
-% \verb|\rulerparams{}{}{}{5mm}{}|\\
-% \verb|\fgrulernoborderline|\\
-% \verb|\ruler[in]{rightdown}{3in}}|\\[2mm]
+% Example:\\
+% |{\fgrulerthickin{}{}{}{}{2pt}|\\
+% |\rulerparams{}{}{}{5mm}{}|\\
+% |\fgrulernoborderline|\\
+% |\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.
@@ -485,19 +504,19 @@
 % 
 % \item\commandinline|!<color3>!|
 % Mark color at integer units.
+% \end{description}
 % 
-% \item The default values are given by \commandinline|!<color>!| of \verb|\rulerparams|, respectively by \texttt{color} option.
+% The default values are given by \commandinline|!<color>!| of |\rulerparams|, respectively by |color| option.
 % 
-% \item Example:\\
-% \verb|{\fgrulercolorcm{green}{blue}{red}|\\
-% \verb|\rulerparams{1pt}{}{}{5mm}{}|\\
-% \verb|\fgrulernoborderline|\\
-% \verb|\ruler{rightdown}{3cm}}|\\[2mm]
+% Example:\\
+% |{\fgrulercolorcm{green}{blue}{red}|\\
+% |\rulerparams{1pt}{}{}{5mm}{}|\\
+% |\fgrulernoborderline|\\
+% |\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.
@@ -517,32 +536,32 @@
 % 
 % \item\commandinline|!<color5>!|
 % Mark color at integer units.
+% \end{description}
 % 
-% \item The default values are given by \commandinline|!<color>!| of \verb|\rulerparams|, respectively by \texttt{color} option.
+% The default values are given by \commandinline|!<color>!| of |\rulerparams|, respectively by |color| option.
 % 
-% \item Example:\\
-% \verb|{\fgrulercolorin{yellow}{orange}{green}{blue}{red}|\\
-% \verb|\rulerparams{1pt}{}{}{5mm}{}|\\
-% \verb|\fgrulernoborderline|\\
-% \verb|\ruler[in]{rightdown}{3in}}|\\[2mm]
+% Example:\\
+% |{\fgrulercolorin{yellow}{orange}{green}{blue}{red}|\\
+% |\rulerparams{1pt}{}{}{5mm}{}|\\
+% |\fgrulernoborderline|\\
+% |\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.
+% This command can only be expanded in the document body.
 % \end{description}
 % 
-% \medskip\noindent\textcolor{red}{\faWarning}
-% All setting commands 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.
+% \medskip\noindent
+% \colorbox{red!10}{\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\textcolor{red}{\faWarning}
+% \itshape All setting commands 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}\label{example:upperleft}
-% The output of the following example is the ruler in this page. It is the default case.
 % \begin{examplelst}
 % \documentclass{article}
 % \usepackage{fgruler}
@@ -726,20 +745,14 @@
 % ...
 % \end{document}
 % \end{examplelst}
-% 
+%
 % \newpage\fgrulerreset
-% \subsection{Setting the \texttt{type=user} option}\label{example:user-first}
-% In the next example the \texttt{type=user} option activates \texttt{type=upperright} or \texttt{type=upperleft}, depending on the page number is odd or even.
-% \setfgruler{type=none}
+% \subsection{Combining type names}\label{example:combining}
+% \setfgruler{type={alledges,alledgesT}}
+% \fgrulerdefusercm{\fgrulertype{cm}{alledges}\fgrulertype{cm}{alledgesT}}
 % \begin{examplelst}
 % \documentclass{article}
-% \usepackage[type=user]{fgruler}
-% \fgrulerdefusercm{%
-%     \ifodd\value{page}\fgrulertype{cm}{upperright}%
-%         \else\fgrulertype{cm}{upperleft}\fi}
-% \fgrulerdefuserin{%
-%     \ifodd\value{page}\fgrulertype{in}{upperright}%
-%         \else\fgrulertype{in}{upperleft}\fi}
+% \usepackage[type={alledges,alledgesT}]{fgruler}
 % \begin{document}
 % ...
 % \end{document}
@@ -746,51 +759,35 @@
 % \end{examplelst}
 % 
 % \newpage\fgrulerreset
-% \subsection{Setting the \texttt{type=user} option}
-% In the next example the \texttt{type=user} option combines the effect of \texttt{type=upperleft} and \texttt{type=upperleftT}.
-% \setfgruler{type=user}
-% \fgrulerdefusercm{\fgrulertype{cm}{upperleft}\fgrulertype{cm}{upperleftT}}
+% \subsection{Setting the \texttt{type=user} option}\label{example:user-first}
+% In the next example the |type=user| option activates |type=upperright| or |type=upperleft|, depending on the page number is odd or even.
+% \setfgruler{type=none}
 % \begin{examplelst}
 % \documentclass{article}
 % \usepackage[type=user]{fgruler}
-% \fgrulerdefusercm{\fgrulertype{cm}{upperleft}\fgrulertype{cm}{upperleftT}}
-% \fgrulerdefuserin{\fgrulertype{in}{upperleft}\fgrulertype{in}{upperleftT}}
+% \fgrulerdefuser{
+%     \ifodd\value{page}\fgrulertype{\fgrulerunit}{upperright}
+%         \else\fgrulertype{\fgrulerunit}{upperleft}\fi
+% }
 % \begin{document}
 % ...
 % \end{document}
 % \end{examplelst}
-%
-% \newpage\fgrulerreset
-% \subsection{Setting the \texttt{type=user} option}
-% In this example the \texttt{type=user} option combines the effect of \texttt{type=alledges} and \texttt{type=alledgesT}.
-% \setfgruler{type=user}
-% \fgrulerdefusercm{\fgrulertype{cm}{alledges}\fgrulertype{cm}{alledgesT}}
-% \begin{examplelst}
-% \documentclass{article}
-% \usepackage[type=user]{fgruler}
-% \fgrulerdefusercm{\fgrulertype{cm}{alledges}\fgrulertype{cm}{alledgesT}}
-% \fgrulerdefuserin{\fgrulertype{in}{alledges}\fgrulertype{in}{alledgesT}}
-% \begin{document}
-% ...
-% \end{document}
-% \end{examplelst}
 % 
 % \newpage\fgrulerreset
 % \subsection{Setting the \texttt{type=user} option}
-% In the next example the \texttt{type=user} option places a vertical ruler at the left border of the text area.
+% In the next example the |type=user| option places a vertical ruler at the left border of the text area.
 % \setfgruler{type=user}
-%\fgrulerdefusercm{\AtTextLowerLeft{\ignorespaces\rulerparamsfromfg\llap{\ruler{downleft}{\textheight}}}}
+%\fgrulerdefuser{\AtTextLowerLeft{\ignorespaces\rulerparamsfromfg\llap{\ruler[\fgrulerunit]{downleft}{\textheight}}}}
 % \begin{examplelst}
 % \documentclass{article}
 % \usepackage[type=user]{fgruler}
-% \newcommand{\fgruleruser}[1]{%
+% \fgrulerdefuser{
 %     \AtTextLowerLeft{% See eso-pic package!
-%         \rulerparamsfromfg%
-%         \llap{\ruler[#1]{downleft}{\textheight}}%
-%     }%
+%         \rulerparamsfromfg
+%         \llap{\ruler[\fgrulerunit]{downleft}{\textheight}}
+%     }
 % }
-% \fgrulerdefusercm{\fgruleruser{cm}}
-% \fgrulerdefuserin{\fgruleruser{in}}
 % \begin{document}
 % ...
 % \end{document}
@@ -798,22 +795,20 @@
 % 
 % \newpage\fgrulerreset
 % \subsection{Setting the \texttt{type=user} option}
-% In the next example the \texttt{type=user} option places rulers at the right and bottom borders of the text area.
+% In the next example the |type=user| option places rulers at the right and bottom borders of the text area.
 % \setfgruler{type=user}
-%\fgrulerdefusercm{\AtTextLowerLeft{\ignorespaces\rulerparamsfromfg\rulernorotatenum\llap{\ruler{downleft}{\textheight}}\ruler*{rightdown}{\textwidth}}}
+%\fgrulerdefuser{\AtTextLowerLeft{\ignorespaces\rulerparamsfromfg\rulernorotatenum\llap{\ruler[\fgrulerunit]{downleft}{\textheight}}\ruler*[\fgrulerunit]{rightdown}{\textwidth}}}
 % \begin{examplelst}
 % \documentclass{article}
 % \usepackage[type=user]{fgruler}
-% \newcommand{\fgruleruser}[1]{%
+% \fgrulerdefuser{
 %     \AtTextLowerLeft{% See eso-pic package!
-%         \rulerparamsfromfg%
-%         \rulernorotatenum%
-%         \llap{\ruler[#1]{downleft}{\textheight}}%
-%         \ruler*[#1]{rightdown}{\textwidth}%
-%     }%
+%         \rulerparamsfromfg
+%         \rulernorotatenum
+%         \llap{\ruler[\fgrulerunit]{downleft}{\textheight}}%
+%         \ruler*[\fgrulerunit]{rightdown}{\textwidth}
+%     }
 % }
-% \fgrulerdefusercm{\fgruleruser{cm}}
-% \fgrulerdefuserin{\fgruleruser{in}}
 % \begin{document}
 % ...
 % \end{document}
@@ -821,24 +816,23 @@
 % 
 % \newpage\fgrulerreset
 % \subsection{Setting the \texttt{type=user} option}\label{example:user-last}
-% In the next example the \texttt{type=user} option places rulers at the right and top borders of the text area.
+% In the next example the |type=user| option places rulers at the right and top borders of the text area.
 % \setfgruler{type=user}
-%\fgrulerdefusercm{\AtTextUpperLeft{\ignorespaces%
-%\rulerparamsfromfg\ruler{rightup}{\textwidth}\ignorespaces%
-%\rulernorotatenum\fgrulercaptioncm{}\ignorespaces\ruler*{downright}{\textheight}}}
+%\fgrulerdefuser{\AtTextUpperLeft{\ignorespaces%
+%\rulerparamsfromfg\ruler[\fgrulerunit]{rightup}{\textwidth}\ignorespaces%
+%\rulernorotatenum\fgrulercaptioncm{}\ignorespaces\ruler*[\fgrulerunit]{downright}{\textheight}}}
 % \begin{examplelst}
 % \documentclass{article}
 % \usepackage[type=user]{fgruler}
-% \newcommand{\fgruleruser}[1]{%
+% \fgrulerdefuser{
 %     \AtTextUpperLeft{% See eso-pic package!
-%         \rulerparamsfromfg%
-%         \ruler[#1]{rightup}{\textwidth}%
-%         \rulernorotatenum\fgrulercaptioncm{}\fgrulercaptionin{}%
-%         \ruler*[#1]{downright}{\textheight}%
-%     }%
+%         \rulerparamsfromfg
+%         \ruler[\fgrulerunit]{rightup}{\textwidth}%
+%         \rulernorotatenum
+%         \csname fgrulercaption\fgrulerunit\endcsname{}%
+%         \ruler*[\fgrulerunit]{downright}{\textheight}
+%     }
 % }
-% \fgrulerdefusercm{\fgruleruser{cm}}
-% \fgrulerdefuserin{\fgruleruser{in}}
 % \begin{document}
 % ...
 % \end{document}
@@ -845,9 +839,9 @@
 % \end{examplelst}
 %
 % \newpage\fgrulerreset
-% \subsection{Rulers on the foreground of a given page, and in text}
+% \subsection{Rulers on the foreground of the current page and in the text}
 % \setfgruler{color=blue}
-% \fgruler{upperleft}{1cm}{1.5cm}
+% \fgruler{upperleft}{1cm}{1.5cm}\fgruler*[color=red,unit=in]{lowerrightT}
 % \noindent
 % text
 % \rulerparams{}{\color{red}\tiny\ttfamily}{green}{}{}
@@ -863,6 +857,7 @@
 % \usepackage[color=blue]{fgruler}
 % \begin{document}
 %     \fgruler{upperleft}{1cm}{1.5cm}
+%     \fgruler*[color=red,unit=in]{lowerrightT}
 %     \noindent
 %     text
 %     \rulerparams{}{\color{red}\tiny\ttfamily}{green}{}{}
@@ -876,10 +871,10 @@
 % \end{examplelst}
 % 
 % \newpage\fgrulerreset
-% \subsection{Ruler types in text}
+% \subsection{Ruler types in the text}
 % \setfgruler{type=none}
 % \noindent
-% \rulerparams{}{}{red}{}{1pt}
+% \rulerparams{}{}{red}{}{3pt}
 % \ruler{rightdown}{3cm}
 % \hfill
 % \ruler{rightup}{3cm}
@@ -908,15 +903,16 @@
 % \hfill
 % \squareruler{upperright}{2cm}{3cm}
 % \hfill
-% {\rulerparams{}{\footnotesize\bfseries\color{red}}{}{5mm}{-8pt}\squareruler[in]{lowerleft}{2in}{3cm}}
+% {\rulerparams{}{\footnotesize\bfseries\color{red}}{}{5mm}{}\squareruler[in]{lowerleft}{2in}{3cm}}
 % 
 % \bigskip
 % \begin{examplelst}
 % \documentclass{article}
+% \usepackage[a4paper,margin=25mm]{geometry}
 % \usepackage[nonefgrulers]{fgruler}
 % \begin{document}
 %     \noindent
-%     \rulerparams{}{}{red}{}{1pt}
+%     \rulerparams{}{}{red}{}{3pt}
 %     \ruler{rightdown}{3cm}
 %     \hfill
 %     \ruler{rightup}{3cm}
@@ -945,12 +941,43 @@
 %     \hfill
 %     \squareruler{upperright}{2cm}{3cm}
 %     \hfill
-%     {\rulerparams{}{\footnotesize\bfseries\color{red}}{}{5mm}{-8pt}
+%     {\rulerparams{}{\footnotesize\bfseries\color{red}}{}{5mm}{}
 %     \squareruler[in]{lowerleft}{2in}{3cm}}
 % \end{document}
 % \end{examplelst}
 % 
 % \newpage\fgrulerreset
+% \subsection{Measuring tapes}\label{example:tape}
+% \setfgruler{type=none}
+% 
+%\noindent\ignorespaces\ruler{taperight}{\textwidth}\\[2pt]\rotatebox[origin=br]{-90}{\ruler{tapeleft}{3cm}}~\ruler{taperight}{10cm}
+%\par\medskip\noindent{\fgrulerdefnum{}\ruler{taperight}{\textwidth}}
+%\par\medskip\noindent{\fgrulerdefnum{}\fgrulercaptioncm{}\rulerparams{}{}{red}{}{0pt}\ruler{taperight}{\textwidth}}
+%
+% \bigskip
+% \begin{examplelst}
+% \documentclass{article}
+% \usepackage[a4paper,margin=25mm]{geometry}
+% \usepackage[nonefgrulers]{fgruler}
+% \begin{document}
+%     \noindent
+%     \ruler{taperight}{\textwidth}\\[2pt]
+%     \rotatebox[origin=br]{-90}{\ruler{tapeleft}{3cm}}
+%     \ruler{taperight}{10cm}
+%
+%     \medskip\noindent
+%     {\fgrulerdefnum{}
+%     \ruler{taperight}{\textwidth}}
+%     
+%     \medskip\noindent
+%     {\fgrulerdefnum{}
+%     \fgrulercaptioncm{}
+%     \rulerparams{}{}{red}{}{0pt}
+%     \ruler{taperight}{\textwidth}}
+% \end{document}
+% \end{examplelst}
+% 
+% \newpage\fgrulerreset
 % \subsection{Mark length and rotating}
 % \setfgruler{type=none}
 % \noindent
@@ -990,6 +1017,7 @@
 % \bigskip
 % \begin{examplelst}
 % \documentclass{article}
+% \usepackage[a4paper,margin=25mm]{geometry}
 % \usepackage[nonefgrulers]{fgruler}
 % \begin{document}
 %     \noindent
@@ -1001,36 +1029,6 @@
 %     \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}
 %
 % \newpage\fgrulerreset
 % \subsection{A new square ruler type}
@@ -1085,9 +1083,17 @@
 \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}
+\ifx\thefgrulernum\@empty%
+  \expandafter\ifx\csname fgruler at caption@\fgruler at unit\endcsname\@empty%
+    \setlength{\fgruler at width}{\fgruler at marklth}%
+  \else
+    \settoheight{\fgruler at width}{\fgruler at font@\csname fgruler at caption@\fgruler at unit\endcsname}%
+    \addtolength{\fgruler at width}{\fgruler at sep}%
+  \fi
+\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%
@@ -1109,31 +1115,35 @@
 \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 output{}%
 \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%
 \PackageError{fgruler}{\fgruler at unit\space is invalid unit}{Valid 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{upperleftT}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{upperrightT}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{lowerleftT}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{lowerrightT}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{alledges}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{alledges*}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{alledgesT}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{alledgesT*}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{none}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{user}\ifx\fgruler at type\fgruler at check\else%
-\PackageError{fgruler}{\fgruler at type\space is invalid type}%
+\def\do##1{%
+\expandafter\def\expandafter\fgruler at type@item\expandafter{##1}%
+\def\fgruler at check{upperleft}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{upperright}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{lowerleft}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{lowerright}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{upperleftT}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{upperrightT}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{lowerleftT}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{lowerrightT}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{alledges}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{alledges*}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{alledgesT}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{alledgesT*}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{none}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{user}\ifx\fgruler at type@item\fgruler at check\else%
+\PackageError{fgruler}{\fgruler at type@item\space is invalid type}%
 {Valid types:\MessageBreak
 upperleft, upperright, lowerleft, lowerright,\MessageBreak
 upperleftT, upperrightT, lowerleftT, lowerrightT,\MessageBreak
 alledges, alledges*, alledgesT, alledgesT*, user, none}%
 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
-\def\fgruler at output{\csname fgruler@\fgruler at unit @\fgruler at type @fg\endcsname}}
+\g at addto@macro\fgruler at output{\csname fgruler@\fgruler at unit @##1 at fg\endcsname}}%
+\expandafter\docsvlist\expandafter{\fgruler at type}}
 
 \def\fgrulerratiocm#1#2{%
 \ifx#1\@empty\else\def\fgruler at cm@ratio at i{#1}\fi%
@@ -1210,12 +1220,12 @@
 \@tempcnta\fgruler at tempdima\advance\@tempcnta\@ne}
 
 \def\fgruler at check@param#1#2{%
-\def\fgruler at param{#1}%
+\expandafter\def\expandafter\fgruler at param\expandafter{#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%
 \PackageError{fgruler}{\fgruler at param\space is invalid parameter}{Valid parameters: cm, in}%
 \fi\fi%
-\def\fgruler at param{#2}%
+\expandafter\def\expandafter\fgruler at param\expandafter{#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%
@@ -1224,19 +1234,21 @@
 \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%
+\def\fgruler at check{taperight}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{tapeleft}\ifx\fgruler at param\fgruler at check\else%
 \PackageError{fgruler}{\fgruler at param\space is invalid parameter}%
 {Valid parameters:\MessageBreak
 rightdown, rightup, leftdown, leftup,\MessageBreak
-downright, downleft, upright, upleft}%
-\fi\fi\fi\fi\fi\fi\fi\fi}
+downright, downleft, upright, upleft, taperight, tapeleft}%
+\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
 
 \def\fgruler at check@param@#1#2{%
-\def\fgruler at param{#1}%
+\expandafter\def\expandafter\fgruler at param\expandafter{#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%
 \PackageError{fgruler}{\fgruler at param\space is invalid parameter}{Valid parameters: cm, in}%
 \fi\fi%
-\def\fgruler at param{#2}%
+\expandafter\def\expandafter\fgruler at param\expandafter{#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%
@@ -1246,6 +1258,33 @@
 upperleft, upperright, lowerleft, lowerright}%
 \fi\fi\fi\fi}
 
+\def\fgruler at check@param@@#1#2{%
+\expandafter\def\expandafter\fgruler at param\expandafter{#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%
+\PackageError{fgruler}{\fgruler at param\space is invalid parameter}{Valid parameters: cm, in}%
+\fi\fi%
+\expandafter\def\expandafter\fgruler at param\expandafter{#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%
+\def\fgruler at check{upperleftT}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{upperrightT}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{lowerleftT}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{lowerrightT}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{alledges}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{alledges*}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{alledgesT}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{alledgesT*}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{user}\ifx\fgruler at param\fgruler at check\else%
+\PackageError{fgruler}{\fgruler at param\space is invalid type}%
+{Valid types:\MessageBreak
+upperleft, upperright, lowerleft, lowerright,\MessageBreak
+upperleftT, upperrightT, lowerleftT, lowerrightT,\MessageBreak
+alledges, alledges*, alledgesT, alledgesT*, user}%
+\fi\fi\fi\fi\fi\fi\fi\fi\fi\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}}
@@ -1254,7 +1293,9 @@
 \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}}}
+\newcommand{\fgruler at fgruler}[4][\fgruler at unit]{\fgruler at check@param@{#1}{#2}\g at addto@macro\fgruler at output@{\csname fgruler@#1@#2 at fg@\endcsname{#3}{#4}}}
+\newcommand{\fgruler at fgruler@}[2][]{\g at addto@macro\fgruler at output@{{\setkeys{fgruler}{#1}\fgruler at check@param@@{\fgruler at unit}{#2}\csname fgruler@\fgruler at unit @#2 at fg\endcsname}}}
+\def\fgruler{\@ifstar{\fgruler at fgruler@}{\fgruler at fgruler}}
 
 \def\fgrulercaptioncm#1{\def\fgruler at caption@cm{#1}\ignorespaces}
 \def\fgruler at caption@cm{cm}
@@ -1345,6 +1386,7 @@
 \def\fgruler at startnumv{0}%
 \fgruler at borderlinetrue%
 \fgruler at showframefalse%
+\def\fgruler at output{\csname fgruler@\fgruler at unit @\fgruler at type @fg\endcsname}%
 \else\PackageError{fgruler}{Don't use \protect\fgrulerreset\space in preamble!}{}\fi%
 \ignorespaces}
 
@@ -1357,7 +1399,8 @@
 
 \iffgruler at nonefgrulers
 
-\renewcommand{\fgruler}[4][]{}
+\renewcommand{\fgruler at fgruler}[4][]{}
+\renewcommand{\fgruler at fgruler@}[2][]{}
 
 \else
 
@@ -1431,7 +1474,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(1,0){#1}}\fi%
+\iffgruler at borderline\put(-\@halfwidth,0){\line(1,0){#1+\@wholewidth}}\fi% \@wholewidth is current line thickness and \@halfwidth = 0.5\@wholewidth (see in latex.ltx)
 \setcounter{fgrulernum}{\fgruler at startnumh}\stepcounter{fgrulernum}%
 \multiput(10,-\fgruler at sep)(10,0){\fgruler at tempdima}{\makebox(0,0)[t]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
 
@@ -1464,7 +1507,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(1,0){#1}}\fi%
+\iffgruler at borderline\put(-\@halfwidth,0){\line(1,0){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumh}\stepcounter{fgrulernum}%
 \multiput(16,-\fgruler at sep)(16,0){\fgruler at tempdima}{\makebox(0,0)[t]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
 
@@ -1491,7 +1534,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(1,0){#1}}\fi%
+\iffgruler at borderline\put(-\@halfwidth,0){\line(1,0){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumh}\stepcounter{fgrulernum}%
 \multiput(10,\fgruler at sep)(10,0){\fgruler at tempdima}{\makebox(0,0)[b]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
 
@@ -1524,7 +1567,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(1,0){#1}}\fi%
+\iffgruler at borderline\put(-\@halfwidth,0){\line(1,0){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumh}\stepcounter{fgrulernum}%
 \multiput(16,\fgruler at sep)(16,0){\fgruler at tempdima}{\makebox(0,0)[b]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
 
@@ -1551,7 +1594,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(-1,0){#1}}\fi%
+\iffgruler at borderline\put(\@halfwidth,0){\line(-1,0){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumh}\stepcounter{fgrulernum}%
 \multiput(-10,-\fgruler at sep)(-10,0){\fgruler at tempdima}{\makebox(0,0)[t]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
 
@@ -1584,7 +1627,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(-1,0){#1}}\fi%
+\iffgruler at borderline\put(\@halfwidth,0){\line(-1,0){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumh}\stepcounter{fgrulernum}%
 \multiput(-16,-\fgruler at sep)(-16,0){\fgruler at tempdima}{\makebox(0,0)[t]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
 
@@ -1611,7 +1654,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(-1,0){#1}}\fi%
+\iffgruler at borderline\put(\@halfwidth,0){\line(-1,0){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumh}\stepcounter{fgrulernum}%
 \multiput(-10,\fgruler at sep)(-10,0){\fgruler at tempdima}{\makebox(0,0)[b]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
 
@@ -1644,7 +1687,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(-1,0){#1}}\fi%
+\iffgruler at borderline\put(\@halfwidth,0){\line(-1,0){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumh}\stepcounter{fgrulernum}%
 \multiput(-16,\fgruler at sep)(-16,0){\fgruler at tempdima}{\makebox(0,0)[b]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
 
@@ -1671,7 +1714,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(0,-1){#1}}\fi%
+\iffgruler at borderline\put(0,\@halfwidth){\line(0,-1){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumv}\stepcounter{fgrulernum}%
 \multiput(\fgruler at sep,-10)(0,-10){\fgruler at tempdima}{\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
 
@@ -1704,7 +1747,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(0,-1){#1}}\fi%
+\iffgruler at borderline\put(0,\@halfwidth){\line(0,-1){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumv}\stepcounter{fgrulernum}%
 \multiput(\fgruler at sep,-16)(0,-16){\fgruler at tempdima}{\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
 
@@ -1731,7 +1774,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(0,-1){#1}}\fi%
+\iffgruler at borderline\put(0,\@halfwidth){\line(0,-1){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumv}\stepcounter{fgrulernum}%
 \multiput(-\fgruler at sep,-10)(0,-10){\fgruler at tempdima}{\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
 
@@ -1764,7 +1807,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(0,-1){#1}}\fi%
+\iffgruler at borderline\put(0,\@halfwidth){\line(0,-1){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumv}\stepcounter{fgrulernum}%
 \multiput(-\fgruler at sep,-16)(0,-16){\fgruler at tempdima}{\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
 
@@ -1791,7 +1834,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(0,1){#1}}\fi%
+\iffgruler at borderline\put(0,-\@halfwidth){\line(0,1){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumv}\stepcounter{fgrulernum}%
 \multiput(\fgruler at sep,10)(0,10){\fgruler at tempdima}{\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
 
@@ -1824,7 +1867,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(0,1){#1}}\fi%
+\iffgruler at borderline\put(0,-\@halfwidth){\line(0,1){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumv}\stepcounter{fgrulernum}%
 \multiput(\fgruler at sep,16)(0,16){\fgruler at tempdima}{\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
 
@@ -1851,7 +1894,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(0,1){#1}}\fi%
+\iffgruler at borderline\put(0,-\@halfwidth){\line(0,1){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumv}\stepcounter{fgrulernum}%
 \multiput(-\fgruler at sep,10)(0,10){\fgruler at tempdima}{\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
 
@@ -1884,7 +1927,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(0,1){#1}}\fi%
+\iffgruler at borderline\put(0,-\@halfwidth){\line(0,1){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumv}\stepcounter{fgrulernum}%
 \multiput(-\fgruler at sep,16)(0,16){\fgruler at tempdima}{\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
 
@@ -1899,6 +1942,66 @@
 
 \def\fgruler at in@upleft@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at in@upleft@{#1}}}
 
+%% TAPERIGHT CM
+\def\fgruler at cm@taperight@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(#1,\fgruler at width+\fgruler at sep)%
+\fgruler at cm@rightup{#1}%
+\setcounter{fgrulernum}{\fgruler at startnumh}%
+\put(0,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5cm\put(5,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\def\thefgrulernum{}%
+\put(0,\fgruler at width+\fgruler at sep){\fgruler at cm@rightdown{#1}}%
+\end{picture}}
+
+\def\fgruler at cm@taperight@@#1{\leavevmode\hbox{}\lower\dimexpr
+\fgruler at width+\fgruler at sep\relax\hbox{\fgruler at cm@taperight@{#1}}}
+
+%% TAPERIGHT IN
+\def\fgruler at in@taperight@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(#1,\fgruler at width+\fgruler at sep)%
+\fgruler at in@rightup{#1}%
+\setcounter{fgrulernum}{\fgruler at startnumh}%
+\put(0,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5in\put(8,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@in}}\fi%
+\def\thefgrulernum{}%
+\put(0,\fgruler at width+\fgruler at sep){\fgruler at in@rightdown{#1}}%
+\end{picture}}
+
+\def\fgruler at in@taperight@@#1{\leavevmode\hbox{}\lower\dimexpr
+\fgruler at width+\fgruler at sep\relax\hbox{\fgruler at in@taperight@{#1}}}
+
+%% TAPELEFT CM
+\def\fgruler at cm@tapeleft@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(#1,\fgruler at width+\fgruler at sep)(-#1,0)%
+\fgruler at cm@leftup{#1}%
+\setcounter{fgrulernum}{\fgruler at startnumh}%
+\put(0,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5cm\put(-5,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\def\thefgrulernum{}%
+\put(0,\fgruler at width+\fgruler at sep){\fgruler at cm@leftdown{#1}}%
+\end{picture}}
+
+\def\fgruler at cm@tapeleft@@#1{\leavevmode\hbox{}\lower\dimexpr
+\fgruler at width+\fgruler at sep\relax\hbox{\fgruler at cm@tapeleft@{#1}}}
+
+%% TAPELEFT IN
+\def\fgruler at in@tapeleft@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(#1,\fgruler at width+\fgruler at sep)(-#1,0)%
+\fgruler at in@leftup{#1}%
+\setcounter{fgrulernum}{\fgruler at startnumh}%
+\put(0,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5in\put(-8,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@in}}\fi%
+\def\thefgrulernum{}%
+\put(0,\fgruler at width+\fgruler at sep){\fgruler at in@leftdown{#1}}%
+\end{picture}}
+
+\def\fgruler at in@tapeleft@@#1{\leavevmode\hbox{}\lower\dimexpr
+\fgruler at width+\fgruler at sep\relax\hbox{\fgruler at in@tapeleft@{#1}}}
+
 %% UPPERLEFT CM
 \def\fgruler at cm@upperleft@#1#2{%
 \setlength{\unitlength}{1mm}%
@@ -2292,7 +2395,7 @@
 \fgruler at in@downleft{\textheight}%
 \put(0,-\textheight){\fgruler at in@rightdown{\textwidth}}
 \put(\textwidth,0){\fgruler at in@downright{\textheight}}
-\put(5,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@in}}%
+\put(8,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@in}}%
 \setcounter{fgrulernum}{\fgruler at startnumh}%
 \put(0,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
 \put(0,-\textheight-\fgruler at sep){\makebox(0,0)[t]{\fgruler at font@\thefgrulernum}}%
@@ -2343,8 +2446,14 @@
 \def\fgruler at cm@user at fg{}
 \def\fgruler at in@user at fg{}
 \def\fgrulertype#1#2{\csname fgruler@#1@#2 at fg\endcsname}
-\def\fgrulerdefusercm#1{\def\fgruler at cm@user at fg{#1}}
-\def\fgrulerdefuserin#1{\def\fgruler at in@user at fg{#1}}
+
+\def\fgrulerdefusercm#1{\def\fgruler at cm@user at fg{#1}} % for old versions
+\def\fgrulerdefuserin#1{\def\fgruler at in@user at fg{#1}} % for old versions
+
+\def\fgrulerdefuser#1{%
+\expandafter\def\expandafter\fgrulerunit\expandafter{\fgruler at unit}%
+\@namedef{fgruler@\fgruler at unit @user at fg}{#1}}
+
 %    \end{macrocode}
 % \Finale
 \endinput
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/fgruler/fgruler.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fgruler/fgruler.sty	2022-06-25 20:22:10 UTC (rev 63720)
+++ trunk/Master/texmf-dist/tex/latex/fgruler/fgruler.sty	2022-06-25 20:22:32 UTC (rev 63721)
@@ -22,7 +22,7 @@
 %% The Current Maintainer of this work is Tibor Tomacs.
 %% 
 \NeedsTeXFormat{LaTeX2e}[2020/10/01]
-\ProvidesPackage{fgruler}[2022/06/19 v1.4 Package for drawing rulers on the foreground or in the text]
+\ProvidesPackage{fgruler}[2022/06/25 v1.5 Package for drawing rulers on the foreground or in the text]
 %%
 \@ifpackageloaded{kvoptions}{}{\RequirePackage{kvoptions}}
 \@ifpackageloaded{etoolbox}{}{\RequirePackage{etoolbox}}
@@ -55,9 +55,17 @@
 \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}
+\ifx\thefgrulernum\@empty%
+  \expandafter\ifx\csname fgruler at caption@\fgruler at unit\endcsname\@empty%
+    \setlength{\fgruler at width}{\fgruler at marklth}%
+  \else
+    \settoheight{\fgruler at width}{\fgruler at font@\csname fgruler at caption@\fgruler at unit\endcsname}%
+    \addtolength{\fgruler at width}{\fgruler at sep}%
+  \fi
+\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%
@@ -79,31 +87,35 @@
 \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 output{}%
 \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%
 \PackageError{fgruler}{\fgruler at unit\space is invalid unit}{Valid 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{upperleftT}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{upperrightT}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{lowerleftT}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{lowerrightT}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{alledges}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{alledges*}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{alledgesT}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{alledgesT*}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{none}\ifx\fgruler at type\fgruler at check\else%
-\def\fgruler at check{user}\ifx\fgruler at type\fgruler at check\else%
-\PackageError{fgruler}{\fgruler at type\space is invalid type}%
+\def\do##1{%
+\expandafter\def\expandafter\fgruler at type@item\expandafter{##1}%
+\def\fgruler at check{upperleft}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{upperright}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{lowerleft}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{lowerright}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{upperleftT}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{upperrightT}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{lowerleftT}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{lowerrightT}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{alledges}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{alledges*}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{alledgesT}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{alledgesT*}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{none}\ifx\fgruler at type@item\fgruler at check\else%
+\def\fgruler at check{user}\ifx\fgruler at type@item\fgruler at check\else%
+\PackageError{fgruler}{\fgruler at type@item\space is invalid type}%
 {Valid types:\MessageBreak
 upperleft, upperright, lowerleft, lowerright,\MessageBreak
 upperleftT, upperrightT, lowerleftT, lowerrightT,\MessageBreak
 alledges, alledges*, alledgesT, alledgesT*, user, none}%
 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
-\def\fgruler at output{\csname fgruler@\fgruler at unit @\fgruler at type @fg\endcsname}}
+\g at addto@macro\fgruler at output{\csname fgruler@\fgruler at unit @##1 at fg\endcsname}}%
+\expandafter\docsvlist\expandafter{\fgruler at type}}
 
 \def\fgrulerratiocm#1#2{%
 \ifx#1\@empty\else\def\fgruler at cm@ratio at i{#1}\fi%
@@ -180,12 +192,12 @@
 \@tempcnta\fgruler at tempdima\advance\@tempcnta\@ne}
 
 \def\fgruler at check@param#1#2{%
-\def\fgruler at param{#1}%
+\expandafter\def\expandafter\fgruler at param\expandafter{#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%
 \PackageError{fgruler}{\fgruler at param\space is invalid parameter}{Valid parameters: cm, in}%
 \fi\fi%
-\def\fgruler at param{#2}%
+\expandafter\def\expandafter\fgruler at param\expandafter{#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%
@@ -194,19 +206,21 @@
 \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%
+\def\fgruler at check{taperight}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{tapeleft}\ifx\fgruler at param\fgruler at check\else%
 \PackageError{fgruler}{\fgruler at param\space is invalid parameter}%
 {Valid parameters:\MessageBreak
 rightdown, rightup, leftdown, leftup,\MessageBreak
-downright, downleft, upright, upleft}%
-\fi\fi\fi\fi\fi\fi\fi\fi}
+downright, downleft, upright, upleft, taperight, tapeleft}%
+\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
 
 \def\fgruler at check@param@#1#2{%
-\def\fgruler at param{#1}%
+\expandafter\def\expandafter\fgruler at param\expandafter{#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%
 \PackageError{fgruler}{\fgruler at param\space is invalid parameter}{Valid parameters: cm, in}%
 \fi\fi%
-\def\fgruler at param{#2}%
+\expandafter\def\expandafter\fgruler at param\expandafter{#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%
@@ -216,6 +230,33 @@
 upperleft, upperright, lowerleft, lowerright}%
 \fi\fi\fi\fi}
 
+\def\fgruler at check@param@@#1#2{%
+\expandafter\def\expandafter\fgruler at param\expandafter{#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%
+\PackageError{fgruler}{\fgruler at param\space is invalid parameter}{Valid parameters: cm, in}%
+\fi\fi%
+\expandafter\def\expandafter\fgruler at param\expandafter{#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%
+\def\fgruler at check{upperleftT}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{upperrightT}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{lowerleftT}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{lowerrightT}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{alledges}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{alledges*}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{alledgesT}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{alledgesT*}\ifx\fgruler at param\fgruler at check\else%
+\def\fgruler at check{user}\ifx\fgruler at param\fgruler at check\else%
+\PackageError{fgruler}{\fgruler at param\space is invalid type}%
+{Valid types:\MessageBreak
+upperleft, upperright, lowerleft, lowerright,\MessageBreak
+upperleftT, upperrightT, lowerleftT, lowerrightT,\MessageBreak
+alledges, alledges*, alledgesT, alledgesT*, user}%
+\fi\fi\fi\fi\fi\fi\fi\fi\fi\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}}
@@ -224,7 +265,9 @@
 \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}}}
+\newcommand{\fgruler at fgruler}[4][\fgruler at unit]{\fgruler at check@param@{#1}{#2}\g at addto@macro\fgruler at output@{\csname fgruler@#1@#2 at fg@\endcsname{#3}{#4}}}
+\newcommand{\fgruler at fgruler@}[2][]{\g at addto@macro\fgruler at output@{{\setkeys{fgruler}{#1}\fgruler at check@param@@{\fgruler at unit}{#2}\csname fgruler@\fgruler at unit @#2 at fg\endcsname}}}
+\def\fgruler{\@ifstar{\fgruler at fgruler@}{\fgruler at fgruler}}
 
 \def\fgrulercaptioncm#1{\def\fgruler at caption@cm{#1}\ignorespaces}
 \def\fgruler at caption@cm{cm}
@@ -315,6 +358,7 @@
 \def\fgruler at startnumv{0}%
 \fgruler at borderlinetrue%
 \fgruler at showframefalse%
+\def\fgruler at output{\csname fgruler@\fgruler at unit @\fgruler at type @fg\endcsname}%
 \else\PackageError{fgruler}{Don't use \protect\fgrulerreset\space in preamble!}{}\fi%
 \ignorespaces}
 
@@ -327,7 +371,8 @@
 
 \iffgruler at nonefgrulers
 
-\renewcommand{\fgruler}[4][]{}
+\renewcommand{\fgruler at fgruler}[4][]{}
+\renewcommand{\fgruler at fgruler@}[2][]{}
 
 \else
 
@@ -401,7 +446,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(1,0){#1}}\fi%
+\iffgruler at borderline\put(-\@halfwidth,0){\line(1,0){#1+\@wholewidth}}\fi% \@wholewidth is current line thickness and \@halfwidth = 0.5\@wholewidth (see in latex.ltx)
 \setcounter{fgrulernum}{\fgruler at startnumh}\stepcounter{fgrulernum}%
 \multiput(10,-\fgruler at sep)(10,0){\fgruler at tempdima}{\makebox(0,0)[t]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
 
@@ -434,7 +479,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(1,0){#1}}\fi%
+\iffgruler at borderline\put(-\@halfwidth,0){\line(1,0){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumh}\stepcounter{fgrulernum}%
 \multiput(16,-\fgruler at sep)(16,0){\fgruler at tempdima}{\makebox(0,0)[t]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
 
@@ -461,7 +506,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(1,0){#1}}\fi%
+\iffgruler at borderline\put(-\@halfwidth,0){\line(1,0){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumh}\stepcounter{fgrulernum}%
 \multiput(10,\fgruler at sep)(10,0){\fgruler at tempdima}{\makebox(0,0)[b]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
 
@@ -494,7 +539,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(1,0){#1}}\fi%
+\iffgruler at borderline\put(-\@halfwidth,0){\line(1,0){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumh}\stepcounter{fgrulernum}%
 \multiput(16,\fgruler at sep)(16,0){\fgruler at tempdima}{\makebox(0,0)[b]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
 
@@ -521,7 +566,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(-1,0){#1}}\fi%
+\iffgruler at borderline\put(\@halfwidth,0){\line(-1,0){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumh}\stepcounter{fgrulernum}%
 \multiput(-10,-\fgruler at sep)(-10,0){\fgruler at tempdima}{\makebox(0,0)[t]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
 
@@ -554,7 +599,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(-1,0){#1}}\fi%
+\iffgruler at borderline\put(\@halfwidth,0){\line(-1,0){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumh}\stepcounter{fgrulernum}%
 \multiput(-16,-\fgruler at sep)(-16,0){\fgruler at tempdima}{\makebox(0,0)[t]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
 
@@ -581,7 +626,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(-1,0){#1}}\fi%
+\iffgruler at borderline\put(\@halfwidth,0){\line(-1,0){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumh}\stepcounter{fgrulernum}%
 \multiput(-10,\fgruler at sep)(-10,0){\fgruler at tempdima}{\makebox(0,0)[b]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
 
@@ -614,7 +659,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(-1,0){#1}}\fi%
+\iffgruler at borderline\put(\@halfwidth,0){\line(-1,0){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumh}\stepcounter{fgrulernum}%
 \multiput(-16,\fgruler at sep)(-16,0){\fgruler at tempdima}{\makebox(0,0)[b]{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}
 
@@ -641,7 +686,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(0,-1){#1}}\fi%
+\iffgruler at borderline\put(0,\@halfwidth){\line(0,-1){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumv}\stepcounter{fgrulernum}%
 \multiput(\fgruler at sep,-10)(0,-10){\fgruler at tempdima}{\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
 
@@ -674,7 +719,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(0,-1){#1}}\fi%
+\iffgruler at borderline\put(0,\@halfwidth){\line(0,-1){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumv}\stepcounter{fgrulernum}%
 \multiput(\fgruler at sep,-16)(0,-16){\fgruler at tempdima}{\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
 
@@ -701,7 +746,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(0,-1){#1}}\fi%
+\iffgruler at borderline\put(0,\@halfwidth){\line(0,-1){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumv}\stepcounter{fgrulernum}%
 \multiput(-\fgruler at sep,-10)(0,-10){\fgruler at tempdima}{\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
 
@@ -734,7 +779,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(0,-1){#1}}\fi%
+\iffgruler at borderline\put(0,\@halfwidth){\line(0,-1){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumv}\stepcounter{fgrulernum}%
 \multiput(-\fgruler at sep,-16)(0,-16){\fgruler at tempdima}{\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
 
@@ -761,7 +806,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(0,1){#1}}\fi%
+\iffgruler at borderline\put(0,-\@halfwidth){\line(0,1){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumv}\stepcounter{fgrulernum}%
 \multiput(\fgruler at sep,10)(0,10){\fgruler at tempdima}{\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
 
@@ -794,7 +839,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(0,1){#1}}\fi%
+\iffgruler at borderline\put(0,-\@halfwidth){\line(0,1){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumv}\stepcounter{fgrulernum}%
 \multiput(\fgruler at sep,16)(0,16){\fgruler at tempdima}{\makebox(0,0)[l]{\fgruler at rotatebox{90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
 
@@ -821,7 +866,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(0,1){#1}}\fi%
+\iffgruler at borderline\put(0,-\@halfwidth){\line(0,1){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumv}\stepcounter{fgrulernum}%
 \multiput(-\fgruler at sep,10)(0,10){\fgruler at tempdima}{\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
 
@@ -854,7 +899,7 @@
 \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 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 marklth}}%
-\iffgruler at borderline\put(0,0){\line(0,1){#1}}\fi%
+\iffgruler at borderline\put(0,-\@halfwidth){\line(0,1){#1+\@wholewidth}}\fi%
 \setcounter{fgrulernum}{\fgruler at startnumv}\stepcounter{fgrulernum}%
 \multiput(-\fgruler at sep,16)(0,16){\fgruler at tempdima}{\makebox(0,0)[r]{\fgruler at rotatebox{-90}{\fgruler at font@\thefgrulernum\stepcounter{fgrulernum}}}}}
 
@@ -869,6 +914,66 @@
 
 \def\fgruler at in@upleft@@#1{\leavevmode\hbox{}\lower#1\hbox{\fgruler at in@upleft@{#1}}}
 
+%% TAPERIGHT CM
+\def\fgruler at cm@taperight@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(#1,\fgruler at width+\fgruler at sep)%
+\fgruler at cm@rightup{#1}%
+\setcounter{fgrulernum}{\fgruler at startnumh}%
+\put(0,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5cm\put(5,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\def\thefgrulernum{}%
+\put(0,\fgruler at width+\fgruler at sep){\fgruler at cm@rightdown{#1}}%
+\end{picture}}
+
+\def\fgruler at cm@taperight@@#1{\leavevmode\hbox{}\lower\dimexpr
+\fgruler at width+\fgruler at sep\relax\hbox{\fgruler at cm@taperight@{#1}}}
+
+%% TAPERIGHT IN
+\def\fgruler at in@taperight@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(#1,\fgruler at width+\fgruler at sep)%
+\fgruler at in@rightup{#1}%
+\setcounter{fgrulernum}{\fgruler at startnumh}%
+\put(0,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5in\put(8,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@in}}\fi%
+\def\thefgrulernum{}%
+\put(0,\fgruler at width+\fgruler at sep){\fgruler at in@rightdown{#1}}%
+\end{picture}}
+
+\def\fgruler at in@taperight@@#1{\leavevmode\hbox{}\lower\dimexpr
+\fgruler at width+\fgruler at sep\relax\hbox{\fgruler at in@taperight@{#1}}}
+
+%% TAPELEFT CM
+\def\fgruler at cm@tapeleft@#1{%
+\setlength{\unitlength}{1mm}%
+\begin{picture}(#1,\fgruler at width+\fgruler at sep)(-#1,0)%
+\fgruler at cm@leftup{#1}%
+\setcounter{fgrulernum}{\fgruler at startnumh}%
+\put(0,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5cm\put(-5,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@cm}}\fi%
+\def\thefgrulernum{}%
+\put(0,\fgruler at width+\fgruler at sep){\fgruler at cm@leftdown{#1}}%
+\end{picture}}
+
+\def\fgruler at cm@tapeleft@@#1{\leavevmode\hbox{}\lower\dimexpr
+\fgruler at width+\fgruler at sep\relax\hbox{\fgruler at cm@tapeleft@{#1}}}
+
+%% TAPELEFT IN
+\def\fgruler at in@tapeleft@#1{%
+\setlength{\unitlength}{.0625in}%
+\begin{picture}(#1,\fgruler at width+\fgruler at sep)(-#1,0)%
+\fgruler at in@leftup{#1}%
+\setcounter{fgrulernum}{\fgruler at startnumh}%
+\put(0,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
+\ifdim#1>.5in\put(-8,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@in}}\fi%
+\def\thefgrulernum{}%
+\put(0,\fgruler at width+\fgruler at sep){\fgruler at in@leftdown{#1}}%
+\end{picture}}
+
+\def\fgruler at in@tapeleft@@#1{\leavevmode\hbox{}\lower\dimexpr
+\fgruler at width+\fgruler at sep\relax\hbox{\fgruler at in@tapeleft@{#1}}}
+
 %% UPPERLEFT CM
 \def\fgruler at cm@upperleft@#1#2{%
 \setlength{\unitlength}{1mm}%
@@ -1262,7 +1367,7 @@
 \fgruler at in@downleft{\textheight}%
 \put(0,-\textheight){\fgruler at in@rightdown{\textwidth}}
 \put(\textwidth,0){\fgruler at in@downright{\textheight}}
-\put(5,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@in}}%
+\put(8,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\fgruler at caption@in}}%
 \setcounter{fgrulernum}{\fgruler at startnumh}%
 \put(0,\fgruler at sep){\makebox(0,0)[b]{\fgruler at font@\thefgrulernum}}%
 \put(0,-\textheight-\fgruler at sep){\makebox(0,0)[t]{\fgruler at font@\thefgrulernum}}%
@@ -1313,8 +1418,14 @@
 \def\fgruler at cm@user at fg{}
 \def\fgruler at in@user at fg{}
 \def\fgrulertype#1#2{\csname fgruler@#1@#2 at fg\endcsname}
-\def\fgrulerdefusercm#1{\def\fgruler at cm@user at fg{#1}}
-\def\fgrulerdefuserin#1{\def\fgruler at in@user at fg{#1}}
+
+\def\fgrulerdefusercm#1{\def\fgruler at cm@user at fg{#1}} % for old versions
+\def\fgrulerdefuserin#1{\def\fgruler at in@user at fg{#1}} % for old versions
+
+\def\fgrulerdefuser#1{%
+\expandafter\def\expandafter\fgrulerunit\expandafter{\fgruler at unit}%
+\@namedef{fgruler@\fgruler at unit @user at fg}{#1}}
+
 \endinput
 %%
 %% End of file `fgruler.sty'.



More information about the tex-live-commits mailing list.