summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/fgruler
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-11-05 03:02:04 +0000
committerNorbert Preining <norbert@preining.info>2020-11-05 03:02:04 +0000
commitb8f26d1a3ca0ba4b66477af6bd2cff2071ddd0fc (patch)
treef4f4a5d17850094c77b0ef61d004cd2532b9ad9e /macros/latex/contrib/fgruler
parent07794af1099869d326e5904c42f1224de759fd56 (diff)
CTAN sync 202011050302
Diffstat (limited to 'macros/latex/contrib/fgruler')
-rw-r--r--macros/latex/contrib/fgruler/fgruler.dtx547
-rw-r--r--macros/latex/contrib/fgruler/fgruler.pdfbin283694 -> 421392 bytes
2 files changed, 357 insertions, 190 deletions
diff --git a/macros/latex/contrib/fgruler/fgruler.dtx b/macros/latex/contrib/fgruler/fgruler.dtx
index 385795b7a8..855e1411a6 100644
--- a/macros/latex/contrib/fgruler/fgruler.dtx
+++ b/macros/latex/contrib/fgruler/fgruler.dtx
@@ -21,13 +21,15 @@
\ProvidesFile{fgruler.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}[2020/10/01]
-%<package>\ProvidesPackage{fgruler}[2020/10/26 v1.2 Package for drawing rulers on the foreground or in the text]
+%<package>\ProvidesPackage{fgruler}[2020/11/04 v1.3 Package for drawing rulers on the foreground or in the text]
%
%<*driver>
\documentclass{ltxdoc}
\OnlyDescription
\usepackage[a4paper,margin=25mm,marginparwidth=19mm,marginparsep=5mm,headsep=5mm,headheight=4mm,footskip=10mm]{geometry}
\usepackage[pdfstartview=FitH,colorlinks,allcolors=black,bookmarksnumbered,hyperfootnotes=false]{hyperref}
+\usepackage[T1]{fontenc}
+\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage{listings,fontawesome,fancyvrb}
\usepackage[type=none,color=red!80!black]{fgruler}
@@ -64,7 +66,7 @@ keepspaces]}
%
% \GetFileInfo{fgruler.sty}
%
-% \title{The {\bfseries\sffamily fgruler} package\\{\large v1.2 (2020/10/26)}}
+% \title{The {\bfseries\sffamily fgruler} package\\{\large v1.3 (2020/11/04)}}
% \author{Tibor T\'{o}m\'{a}cs\\{\normalsize\url{tomacs.tibor@uni-eszterhazy.hu}}}
% \date{}
% \maketitle
@@ -102,57 +104,59 @@ keepspaces]}
% By default, the \texttt{fgruler} package draws a square ruler on the foreground of every page. The following package options set the parameters of these rulers.
% \begin{description}
% \item\commandinline|unit=!<unit>!|\\
-% Ruler unit.
+% Ruler unit. The \commandinline|!<unit>!| legal values:
% \begin{description}
-% \item\commandinline|!<unit>!| values:\\
-% \commandinline|cm| Metric ruler (centimeter). Default value.\\
-% \commandinline|in| English ruler (inch).
+% \item\commandinline|cm| Metric ruler (centimeter). Default value.
+% \item\commandinline|in| English ruler (inch).
% \end{description}
%
% \item\commandinline|type=!<type name>!|\\
-% Origin and directions.
+% Origin, directions and lengths of the ruler. The \commandinline|!<type name>!| legal values:
% \begin{description}
-% \item\commandinline|!<type name>!| values:\\
-% \commandinline|upperleft | Origin: upper left corner. Directions: down and right. Default value.\\
-% \commandinline|upperright| Origin: upper right corner. Directions: down and left.\\
-% \commandinline|lowerleft | Origin: lower left corner. Directions: up and right.\\
-% \commandinline|lowerright| Origin: lower right corner. Directions: up and left.\\
-% \commandinline|none | Not drawing ruler.\\
-% \commandinline|user | Each \commandinline|!<unit>!|--\commandinline|!<type name>!| pair activates an \commandinline|\fgruler@!<unit>!@!<type name>!@fg| command. You can control the effect of this option by redefining the \commandinline|\fgruler@!<unit>!@user@fg| commands, which are empty in the default case. (See \ref{example:user1}, \ref{example:user2} and \ref{example:user3} examples.)
+% \item\commandinline|upperleft | Default value. Origin: upper left corner of the paper. Directions: down and right. Lengths: paper sizes.
+% \item\commandinline|upperright | Origin: upper right corner of the paper. Directions: down and left. Lengths: paper sizes.
+% \item\commandinline|lowerleft | Origin: lower left corner of the paper. Directions: up and right. Lengths: paper sizes.
+% \item\commandinline|lowerright | Origin: lower right corner of the paper. Directions: up and left. Lengths: paper sizes.
+% \item\commandinline|upperleftT | Origin: upper left corner of the text area. Directions: down and right. Lengths: text area sizes.
+% \item\commandinline|upperrightT| Origin: upper right corner of the text area. Directions: down and left. Lengths: text area sizes.
+% \item\commandinline|lowerleftT | Origin: lower left corner of the text area. Directions: up and right. Lengths: text area sizes.
+% \item\commandinline|lowerrightT| Origin: lower right corner of the text area. Directions: up and left. Lengths: text area sizes.
+% \item\commandinline|none| Not drawing ruler.
+% \item\commandinline|user| Each \commandinline|!<unit>!|--\commandinline|!<type name>!| pair activates an \commandinline|\fgruler@!<unit>!@!<type name>!@fg| command, which is equivalent to \commandinline|\fgrulertype{!<unit>!}{!<type name>!}|.\\
+% You can control the effect of this option by redefining the \commandinline|\fgruler@!<unit>!@user@fg| commands, which are empty in the default case.\\
+% \commandinline|\def\fgruler@cm@user@fg{!<code>!}| is equivalent to \commandinline|\fgrulerdefusercm{!<code>!}|.\\
+% Similarly, \commandinline|\def\fgruler@in@user@fg{!<code>!}| is equivalent to \commandinline|\fgrulerdefuserin{!<code>!}|.\\
+% See \ref{example:user-first}--\ref{example:user-last} examples.
% \end{description}
%
% \item\commandinline|hshift=!<length>!|\\
-% Horizontal shift.
-% The shift direction is right, if the \commandinline|!<type name>!| is \verb|upperleft| or \verb|lowerleft|, otherwise it is left.\\
-% Default: \verb|hshift=0cm|.\\ The \commandinline|!<length>!| is saved in \commandinline|\fgruler@hshift|.
+% 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|.
%
% \item\commandinline|vshift=!<length>!|\\
-% Vertical shift.
-% The shift direction is down, if the \commandinline|!<type name>!| is \verb|upperleft| or \verb|upperright|, otherwise it is up.\\
-% Default: \verb|vshift=0cm|.\\ The \commandinline|!<length>!| is saved in \commandinline|\fgruler@vshift|.
+% 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|.
%
% \item\commandinline|color=!<color name>!|\\
-% Ruler color (see \texttt{xcolor} package).\\
-% Default: \verb|color=black|.\\ The \commandinline|!<color name>!| is saved in \commandinline|\fgruler@color|.
+% Ruler color (see \texttt{xcolor} package). Default: \verb|color=black|.
%
% \item\commandinline|numsep=!<length>!|\\
-% Separation between number and ruler.\\
-% Default: \verb|numsep=3pt|.\\ The \commandinline|!<length>!| is saved in \commandinline|\fgruler@numsep|.
+% Separation between number and ruler. Default: \verb|numsep=3pt|.
%
% \item\commandinline|markthick=!<length>!|\\
-% Mark thickness.\\
-% Default: \verb|markthick=0.4pt|.\\ The \commandinline|!<length>!| is saved in \commandinline|\fgruler@markthick|.
+% Mark thickness. Default: \verb|markthick=0.4pt|.
%
% \item\commandinline|marklength=!<length>!|\\
-% Mark length at integer units:
-% {\fgrulernoborderline\fgrulercaptioncm{}\fgrulerthickcm{}{}{1pt}\fgrulercolorcm{}{}{red}\ruler{rightup}{3cm}}\\
-% Default: \verb|marklength=2mm|.\\ The \commandinline|!<length>!| is saved in \commandinline|\fgruler@marklength|.\\
-% See the length of the other marks in Section \ref{sec:additional}.
+% 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}.
%
% \item\commandinline|numfont=!<font type>!|\\
-% Number font type.\\
-% You can use this option only in \verb|\setfgruler| command.\\
-% Default: \verb|numfont=\scriptsize\sffamily|.\\ The \commandinline|!<font type>!| is saved in \commandinline|\fgruler@numfont|.
+% Number font type. Default: \verb|numfont=\scriptsize\sffamily|. You can use this option only in \verb|\setfgruler| command.
%
% \item\commandinline|showframe| or \commandinline|showframe=true|\\
% It draws visible frames for the text and margin area, and lines for the head and foot.
@@ -297,15 +301,15 @@ keepspaces]}
% \item For example, \verb|\rulerparams{}{}{red}{}{}| changes the ruler color to red.
% \end{description}
%
+% \item\commandinline|\rulerparamsfromfg|\\
+% It sets the ruler parameters from the actual 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$.
% It kills this action.
% This command is usable only in \texttt{document} environment.
%
-% Example: \verb|\ruler{upright}{1cm}| \ruler{upright}{1cm}\\
-% but
-% \verb|{\rulernorotatenum\ruler{upright}{1cm}}|
-% {\rulernorotatenum\ruler{upright}{1cm}}
+% Example: \verb|{\rulernorotatenum\ruler{upright}{1cm}}| {\rulernorotatenum\ruler{upright}{1cm}}
%
% \item\commandinline|\rulerrotatenum|\\
% After \verb|\rulernorotatenum|, it reactivates the number rotating.
@@ -316,19 +320,28 @@ keepspaces]}
% The following commands can work on all of the rulers, which are drawn by \texttt{fgruler} package.
% \begin{description}
% \item\commandinline|\fgrulerstartnum{!<num>!}|\\
-% The \commandinline|!<num>!| is a nonnegative integer, which will be the starting number on the ruler.
+% The \commandinline|!<num>!| is a nonnegative integer, which will be the starting number on the horizontal and vertical rulers.
% Default: \verb|\fgrulerstartnum{0}|
%
-% Example: \verb|{\fgrulerstartnum{5}\ruler{rightup}{3cm}}| {\fgrulerstartnum{5}\ruler{rightup}{3cm}}
+% Example: \verb|{\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}|
+%
+% Example: \verb|{\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}|
+%
+% Example: \verb|{\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|\ruler{rightup}{3cm}| \ruler{rightup}{3cm}\\
-% but
-% \verb|{\fgrulernoborderline\ruler{rightup}{3cm}}|
-% {\fgrulernoborderline\ruler{rightup}{3cm}}
+% Example: \verb|{\fgrulernoborderline\ruler{rightup}{3cm}}| {\fgrulernoborderline\ruler{rightup}{3cm}}
%
% \item\commandinline|\fgrulerborderline|\\
% After \verb|\fgrulernoborderline|, it reactivates the previous default effect.
@@ -337,10 +350,7 @@ keepspaces]}
% Unit caption in metric ruler.
% Default: \verb|\fgrulercaptioncm{cm}|
%
-% Example: \verb|\ruler{rightup}{3cm}| \ruler{rightup}{3cm}\\
-% but
-% \verb|{\fgrulercaptioncm{}\ruler{rightup}{3cm}}|
-% {\fgrulercaptioncm{}\ruler{rightup}{3cm}}
+% Example: \verb|{\fgrulercaptioncm{}\ruler{rightup}{3cm}}| {\fgrulercaptioncm{}\ruler{rightup}{3cm}}
%
% \item\commandinline|\fgrulercaptionin{!<caption>!}|\\
% Unit caption in English ruler.
@@ -351,9 +361,7 @@ keepspaces]}
% Its current value is printed by the \commandinline|\thefgrulernum|.
% Its default definition is \verb|\def\thefgrulernum{\arabic{fgrulernum}}|, which is equivalent to \verb|\fgrulerdefnum{\arabic{fgrulernum}}|.
%
-% Example:\\
-% \verb|{\fgrulerdefnum{}\fgrulercaptioncm{}\ruler{rightdown}{2cm}}|
-% {\fgrulerdefnum{}\fgrulercaptioncm{}\ruler{rightdown}{2cm}}
+% Example: \verb|{\fgrulerdefnum{}\fgrulercaptioncm{}\ruler{rightdown}{2cm}}| {\fgrulerdefnum{}\fgrulercaptioncm{}\ruler{rightdown}{2cm}}
%
% \item\commandinline|\fgrulerratiocm{!<ratio1>!}{!<ratio2>!}|\\
% Mark length ratios in metric rulers.
@@ -516,12 +524,12 @@ keepspaces]}
% \end{description}
%
% \medskip\noindent\textcolor{red}{\faWarning}
-% All setting commands\footnote{Namely \verb|\setfgruler|, \verb|\rulerparams|, \verb|\rulernorotatenum|, \verb|\rulerrotatenum|, furthermore all commands in this section.} obey the normal scoping rules, i.e.\ if you use them inside a group, then the changing of the parameters is not valid outside the group.
+% 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}
-% The output of the following code is the ruler in this page. It is the default case.
+% The output of the following example is the ruler in this page. It is the default case.
% \begin{examplelst}
% \documentclass{article}
% \usepackage{fgruler}
@@ -531,7 +539,7 @@ keepspaces]}
% \end{examplelst}
%
% \newpage\fgrulerreset
-% \subsection{The `showframe' option}
+% \subsection{The \texttt{showframe} and \texttt{color} options}
% \setfgruler{color=red,showframe}
% \begin{examplelst}
% \documentclass{article}
@@ -542,7 +550,7 @@ keepspaces]}
% \end{examplelst}
%
% \newpage\fgrulerreset
-% \subsection{Shifting in default case}
+% \subsection{Shift in default case}
% \setfgruler{hshift=1cm,vshift=2cm}
% \begin{examplelst}
% \documentclass{article}
@@ -553,7 +561,7 @@ keepspaces]}
% \end{examplelst}
%
% \newpage\fgrulerreset
-% \subsection{Shifting in case `type=upperright' option}
+% \subsection{Shift in case \texttt{type=upperright} option}
% \setfgruler{type=upperright,hshift=1cm,vshift=2cm}
% \begin{examplelst}
% \documentclass{article}
@@ -564,7 +572,7 @@ keepspaces]}
% \end{examplelst}
%
% \newpage\fgrulerreset
-% \subsection{Shifting in case `type=lowerleft' option}
+% \subsection{Shift in case \texttt{type=lowerleft} option}
% \setfgruler{type=lowerleft,hshift=1cm,vshift=2cm}
% \begin{examplelst}
% \documentclass{article}
@@ -575,7 +583,7 @@ keepspaces]}
% \end{examplelst}
%
% \newpage\fgrulerreset
-% \subsection{Shifting in case `type=lowerright' option}
+% \subsection{Shift in case \texttt{type=lowerright} option}
% \setfgruler{type=lowerright,hshift=1cm,vshift=2cm}
% \begin{examplelst}
% \documentclass{article}
@@ -586,104 +594,132 @@ keepspaces]}
% \end{examplelst}
%
% \newpage\fgrulerreset
-% \subsection{An example for the `type=user' option}\label{example:user1}
+% \subsection{The \texttt{type=upperleftT} option}
+% \setfgruler{type=upperleftT}
+% \begin{examplelst}
+% \documentclass{article}
+% \usepackage[type=upperleftT]{fgruler}
+% \begin{document}
+% ...
+% \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}
% \begin{examplelst}
% \documentclass{article}
% \usepackage[type=user]{fgruler}
-% \makeatletter
-% \def\fgruler@cm@user@fg{%
-% \ifodd\value{page}\fgruler@cm@upperright@fg%
-% \else\fgruler@cm@upperleft@fg\fi}
-% \def\fgruler@in@user@fg{%
-% \ifodd\value{page}\fgruler@in@upperright@fg%
-% \else\fgruler@in@upperleft@fg\fi}
-% \makeatother
+% \fgrulerdefusercm{%
+% \ifodd\value{page}\fgrulertype{cm}{upperright}%
+% \else\fgrulertype{cm}{upperleft}\fi}
+% \fgrulerdefuserin{%
+% \ifodd\value{page}\fgrulertype{in}{upperright}%
+% \else\fgrulertype{in}{upperleft}\fi}
% \begin{document}
% ...
% \end{document}
% \end{examplelst}
-% In this case the \texttt{type=upperright} option will be activated, if the page number is odd. Otherwise \texttt{type=upperleft} will be activated.
%
% \newpage\fgrulerreset
-% \subsection{An other example for the `type=user' option}\label{example:user2}
-% \setfgruler{type=user,color=red}
-%\makeatletter
-%\newlength{\fgruler@tempdim}
-%\renewcommand{\fgruler@cm@user@fg}{\AtTextLowerLeft{\ignorespaces%
-%\settowidth{\fgruler@tempdim}{\ruler{downleft}{\textheight}}%
-%\rulerparams{}{}{\fgruler@color}{}{}%
-%\put(-\fgruler@tempdim,0){\ignorespaces%
-%\rulernorotatenum\fgrulercaptioncm{}\ruler{downleft}{\textheight}}%
-%\put(0,\textheight){\ignorespaces\ruler{rightup}{\textwidth}}}}
-%\makeatother
+% \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}}
% \begin{examplelst}
% \documentclass{article}
-% \usepackage[type=user,color=red]{fgruler}
-% \makeatletter
-% \newlength{\fgruler@tempdim}
-% \newcommand{\fgruler@user}[1]{%
-% \AtTextLowerLeft{% See eso-pic package!
-% \rulerparams{\fgruler@markthick}{\fgruler@numfont}{\fgruler@color}%
-% {\fgruler@marklength}{\fgruler@numsep}%
-% \settowidth{\fgruler@tempdim}{\ruler[#1]{downleft}{\textheight}}%
-% \put(-\fgruler@tempdim,0){%
-% \rulernorotatenum%
-% \fgrulercaptioncm{}%
-% \fgrulercaptionin{}%
-% \ruler[#1]{downleft}{\textheight}%
-% }%
-% \put(0,\textheight){%
-% \ruler[#1]{rightup}{\textwidth}%
+% \usepackage[type=user]{fgruler}
+% \fgrulerdefusercm{\fgrulertype{cm}{upperleft}\fgrulertype{cm}{upperleftT}}
+% \fgrulerdefuserin{\fgrulertype{in}{upperleft}\fgrulertype{in}{upperleftT}}
+% \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=upperleftT} and \texttt{type=lowerrightT}.
+% \setfgruler{type=user}
+% \fgrulerdefusercm{\fgrulertype{cm}{upperleftT}\fgrulertype{cm}{lowerrightT}}
+% \begin{examplelst}
+% \documentclass{article}
+% \usepackage[type=user]{fgruler}
+% \fgrulerdefusercm{\fgrulertype{cm}{upperleftT}\fgrulertype{cm}{lowerrightT}}
+% \fgrulerdefuserin{\fgrulertype{in}{upperleftT}\fgrulertype{in}{lowerrightT}}
+% \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.
+% \setfgruler{type=user}
+%\fgrulerdefusercm{\AtTextLowerLeft{\ignorespaces\rulerparamsfromfg\llap{\ruler{downleft}{\textheight}}}}
+% \begin{examplelst}
+% \documentclass{article}
+% \usepackage[type=user]{fgruler}
+% \newcommand{\fgruleruser}[1]{%
+% \AtTextLowerLeft{% See eso-pic package!
+% \rulerparamsfromfg%
+% \llap{\ruler[#1]{downleft}{\textheight}}%
% }%
-% }%
% }
-% \renewcommand{\fgruler@cm@user@fg}{\fgruler@user{cm}}
-% \renewcommand{\fgruler@in@user@fg}{\fgruler@user{in}}
-% \makeatother
+% \fgrulerdefusercm{\fgruleruser{cm}}
+% \fgrulerdefuserin{\fgruleruser{in}}
% \begin{document}
% ...
% \end{document}
% \end{examplelst}
-% This code places rulers at the left and the top border of the body. In this case the \texttt{hshift} and \texttt{vshift} options don't work.
%
% \newpage\fgrulerreset
-% \subsection{The third example for the `type=user' option}\label{example:user3}
-% \setfgruler{type=user,color=blue}
-%\makeatletter
-%\renewcommand{\fgruler@cm@user@fg}{\fgruler@cm@upperleft@fg\AtTextLowerLeft{\ignorespaces%
-%\rulerparams{}{}{\fgruler@color}{}{}%
-%\put(\textwidth,0){\ignorespaces%
-%\rulernorotatenum\fgrulercaptioncm{}\ruler{downright}{\textheight}}%
-%\put(0,\textheight){\ignorespaces\ruler{rightup}{\textwidth}}}}
-%\makeatother
+% \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.
+% \setfgruler{type=user}
+%\fgrulerdefusercm{\AtTextLowerLeft{\ignorespaces\rulerparamsfromfg\rulernorotatenum\llap{\ruler{downleft}{\textheight}}\ruler*{rightdown}{\textwidth}}}
% \begin{examplelst}
% \documentclass{article}
-% \usepackage[type=user,color=blue]{fgruler}
-% \makeatletter
-% \newcommand{\fgruler@user}[1]{%
-% \AtTextLowerLeft{% See eso-pic package!
-% \rulerparams{\fgruler@markthick}{\fgruler@numfont}{\fgruler@color}%
-% {\fgruler@marklength}{\fgruler@numsep}%
-% \put(\textwidth,0){%
-% \rulernorotatenum%
-% \fgrulercaptioncm{}%
-% \fgrulercaptionin{}%
-% \ruler[#1]{downright}{\textheight}%
+% \usepackage[type=user]{fgruler}
+% \newcommand{\fgruleruser}[1]{%
+% \AtTextLowerLeft{% See eso-pic package!
+% \rulerparamsfromfg%
+% \rulernorotatenum%
+% \llap{\ruler[#1]{downleft}{\textheight}}%
+% \ruler*[#1]{rightdown}{\textwidth}%
% }%
-% \put(0,\textheight){%
-% \ruler[#1]{rightup}{\textwidth}%
+% }
+% \fgrulerdefusercm{\fgruleruser{cm}}
+% \fgrulerdefuserin{\fgruleruser{in}}
+% \begin{document}
+% ...
+% \end{document}
+% \end{examplelst}
+%
+% \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.
+% \setfgruler{type=user}
+%\fgrulerdefusercm{\AtTextUpperLeft{\ignorespaces%
+%\rulerparamsfromfg\ruler{rightup}{\textwidth}\ignorespaces%
+%\rulernorotatenum\fgrulercaptioncm{}\ignorespaces\ruler*{downright}{\textheight}}}
+% \begin{examplelst}
+% \documentclass{article}
+% \usepackage[type=user]{fgruler}
+% \newcommand{\fgruleruser}[1]{%
+% \AtTextUpperLeft{% See eso-pic package!
+% \rulerparamsfromfg%
+% \ruler[#1]{rightup}{\textwidth}%
+% \rulernorotatenum\fgrulercaptioncm{}\fgrulercaptionin{}%
+% \ruler*[#1]{downright}{\textheight}%
% }%
-% }%
% }
-% \renewcommand{\fgruler@cm@user@fg}{\fgruler@cm@upperleft@fg\fgruler@user{cm}}
-% \renewcommand{\fgruler@in@user@fg}{\fgruler@in@upperleft@fg\fgruler@user{in}}
-% \makeatother
+% \fgrulerdefusercm{\fgruleruser{cm}}
+% \fgrulerdefuserin{\fgruleruser{in}}
% \begin{document}
% ...
% \end{document}
% \end{examplelst}
-% In this code the effect of \texttt{type=user} is similar to \texttt{type=upperleft}, but it places further rulers at the right and the top border of the body.
%
% \newpage\fgrulerreset
% \subsection{Rulers on the foreground of a given page, and in text}
@@ -711,10 +747,10 @@ keepspaces]}
% text
% \ruler*{rightdown}{3cm}
% text
-% \rotatebox[origin=tl]{30}{\ruler*{rightdown}{3cm}}
+% \rotatebox[origin=tl]{30}{\ruler*{rightdown}{3cm}}
+% % \rotatebox is defined in graphicx package
% \end{document}
% \end{examplelst}
-% \emph{Remark.} The \verb|\rotatebox| command is defined in the \texttt{graphicx} package!
%
% \newpage\fgrulerreset
% \subsection{Ruler types in text}
@@ -874,31 +910,18 @@ keepspaces]}
% \end{examplelst}
%
% \newpage\fgrulerreset
-% \subsection{A new square ruler}
+% \subsection{A new square ruler type}
% \setfgruler{type=none}
-%
-% \makeatletter
-% \newcommand{\usersquareruler}[2]{
-% \begin{picture}(#1+1em+\fgruler@marklength,#2+1em+\fgruler@marklength)
-% {\fgrulercaptioncm{}
-% \ruler{downleft}{#2}}
-% \put(0,#2){\ruler{rightup}{#1}}
-% \end{picture}}
-% \makeatother
-% \usersquareruler{3cm}{5cm}
+% {\rulernorotatenum\fgrulercaptioncm{}\ruler*{downleft}{5cm}}\ruler{rightup}{3cm}
%
% \bigskip
% \begin{examplelst}
% \documentclass{article}
% \usepackage[type=none]{fgruler}
-% \makeatletter
% \newcommand{\usersquareruler}[2]{%
-% \begin{picture}(#1+1em+\fgruler@marklength,#2+1em+\fgruler@marklength)%
-% {\fgrulercaptioncm{}%
-% \ruler{downleft}{#2}}%
-% \put(0,#2){\ruler{rightup}{#1}}%
-% \end{picture}}
-% \makeatother
+% {\rulernorotatenum\fgrulercaptioncm{}\ruler*{downleft}{#2}}%
+% \ruler{rightup}{#1}%
+% }
% \begin{document}
% \usersquareruler{3cm}{5cm}
% \end{document}
@@ -953,6 +976,8 @@ keepspaces]}
\rulerparams{.4pt}{\scriptsize\sffamily}{black}{2mm}{3pt}
+\def\rulerparamsfromfg{\rulerparams{\fgruler@markthick}{\fgruler@numfont}{\fgruler@color}{\fgruler@marklength}{\fgruler@numsep}}
+
\def\fgruler@fgsetting{%
\fgruler@set{\fgruler@markthick}{\fgruler@numfont}{\fgruler@color}{\fgruler@marklength}{\fgruler@numsep}%
\rulernorotatenum}
@@ -963,14 +988,24 @@ keepspaces]}
\def\fgruler@activate@type{%
\def\fgruler@check{cm}\ifx\fgruler@unit\fgruler@check\else%
\def\fgruler@check{in}\ifx\fgruler@unit\fgruler@check\else%
-\@latexerr{Undefined unit: \fgruler@unit\space(Defined units: cm, in)}{}\fi\fi%
+\PackageError{fgruler}{\fgruler@unit\space is invalid unit}{Valid units: cm, in}%
+\fi\fi%
\def\fgruler@check{upperleft}\ifx\fgruler@type\fgruler@check\else%
\def\fgruler@check{upperright}\ifx\fgruler@type\fgruler@check\else%
\def\fgruler@check{lowerleft}\ifx\fgruler@type\fgruler@check\else%
\def\fgruler@check{lowerright}\ifx\fgruler@type\fgruler@check\else%
+\def\fgruler@check{upperleftT}\ifx\fgruler@type\fgruler@check\else%
+\def\fgruler@check{upperrightT}\ifx\fgruler@type\fgruler@check\else%
+\def\fgruler@check{lowerleftT}\ifx\fgruler@type\fgruler@check\else%
+\def\fgruler@check{lowerrightT}\ifx\fgruler@type\fgruler@check\else%
\def\fgruler@check{none}\ifx\fgruler@type\fgruler@check\else%
\def\fgruler@check{user}\ifx\fgruler@type\fgruler@check\else%
-\@latexerr{Undefined type: \fgruler@type\space(Defined types: upperleft, upperright, lowerleft, lowerright, user, none)}{}\fi\fi\fi\fi\fi\fi%
+\PackageError{fgruler}{\fgruler@type\space is invalid type}%
+{Valid types:\MessageBreak
+upperleft, upperright, lowerleft, lowerright,\MessageBreak
+upperleftT, upperrightT, lowerleftT, lowerrightT,\MessageBreak
+user, none}%
+\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
\def\fgruler@output{\csname fgruler@\fgruler@unit @\fgruler@type @fg\endcsname}}
\def\fgrulerratiocm#1#2{%
@@ -1051,7 +1086,7 @@ keepspaces]}
\def\fgruler@param{#1}%
\def\fgruler@check{cm}\ifx\fgruler@param\fgruler@check\else%
\def\fgruler@check{in}\ifx\fgruler@param\fgruler@check\else%
-\@latexerr{Invalid parameter: \fgruler@param\space(Defined parameters: cm, in)}{}%
+\PackageError{fgruler}{\fgruler@param\space is invalid parameter}{Valid parameters: cm, in}%
\fi\fi%
\def\fgruler@param{#2}%
\def\fgruler@check{rightdown}\ifx\fgruler@param\fgruler@check\else%
@@ -1062,21 +1097,26 @@ keepspaces]}
\def\fgruler@check{downleft}\ifx\fgruler@param\fgruler@check\else%
\def\fgruler@check{upright}\ifx\fgruler@param\fgruler@check\else%
\def\fgruler@check{upleft}\ifx\fgruler@param\fgruler@check\else%
-\@latexerr{Invalid parameter: \fgruler@param\space(Defined parameters: rightdown, rightup, leftdown, leftup, downright, downleft, upright, upleft)}{}%
+\PackageError{fgruler}{\fgruler@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}
\def\fgruler@check@param@#1#2{%
\def\fgruler@param{#1}%
\def\fgruler@check{cm}\ifx\fgruler@param\fgruler@check\else%
\def\fgruler@check{in}\ifx\fgruler@param\fgruler@check\else%
-\@latexerr{Invalid parameter: \fgruler@param\space(Defined parameters: cm, in)}{}%
+\PackageError{fgruler}{\fgruler@param\space is invalid parameter}{Valid parameters: cm, in}%
\fi\fi%
\def\fgruler@param{#2}%
\def\fgruler@check{upperleft}\ifx\fgruler@param\fgruler@check\else%
\def\fgruler@check{upperright}\ifx\fgruler@param\fgruler@check\else%
\def\fgruler@check{lowerleft}\ifx\fgruler@param\fgruler@check\else%
\def\fgruler@check{lowerright}\ifx\fgruler@param\fgruler@check\else%
-\@latexerr{Invalid parameter: \fgruler@param\space(Defined parameters: upperleft, upperright, lowerleft, lowerright)}{}%
+\PackageError{fgruler}{\fgruler@param\space is invalid parameter}%
+{Valid parameters:\MessageBreak
+upperleft, upperright, lowerleft, lowerright}%
\fi\fi\fi\fi}
\newcommand{\fgruler@ruler}[3][cm]{\fgruler@check@param{#1}{#2}\fgruler@intextsetting\csname fgruler@#1@#2@\endcsname{#3}}
@@ -1110,8 +1150,11 @@ keepspaces]}
\def\fgruler@ifodd#1{\ifodd\value{fgrulernum}#1\fi\stepcounter{fgrulernum}}
-\def\fgrulerstartnum#1{\def\fgruler@startnum{#1}\ignorespaces}
-\def\fgruler@startnum{0}
+\def\fgrulerstartnum#1{\def\fgruler@startnumh{#1}\def\fgruler@startnumv{#1}\ignorespaces}
+\def\fgrulerstartnumh#1{\def\fgruler@startnumh{#1}\ignorespaces}
+\def\fgrulerstartnumv#1{\def\fgruler@startnumv{#1}\ignorespaces}
+\def\fgruler@startnumh{0}
+\def\fgruler@startnumv{0}
\def\fgrulerdefnum#1{\def\thefgrulernum{#1}\ignorespaces}
@@ -1120,13 +1163,13 @@ keepspaces]}
\def\rulernorotatenum{%
\ifx\@onlypreamble\@notprerr%
\def\fgruler@rotatebox##1##2{##2}%
-\else\@latexerr{Don't use \protect\rulernorotatenum\space in preamble!}{}\fi%
+\else\PackageError{fgruler}{Don't use \protect\rulernorotatenum\space in preamble!}{}\fi%
\ignorespaces}
\def\rulerrotatenum{%
\ifx\@onlypreamble\@notprerr%
\def\fgruler@rotatebox##1##2{\rotatebox{##1}{##2}}%
-\else\@latexerr{Don't use \protect\rulerrotatenum\space in preamble!}{}\fi%
+\else\PackageError{fgruler}{Don't use \protect\rulerrotatenum\space in preamble!}{}\fi%
\ignorespaces}
\def\fgrulerreset{%
@@ -1171,10 +1214,11 @@ keepspaces]}
\def\thefgrulernum{\arabic{fgrulernum}}%
\def\fgruler@caption@cm{cm}%
\def\fgruler@caption@in{inch}%
-\def\fgruler@startnum{0}%
+\def\fgruler@startnumh{0}%
+\def\fgruler@startnumv{0}%
\fgruler@borderlinetrue%
\fgruler@showframefalse%
-\else\@latexerr{Don't use \protect\fgrulerreset\space in preamble!}{}\fi%
+\else\PackageError{fgruler}{Don't use \protect\fgrulerreset\space in preamble!}{}\fi%
\ignorespaces}
\AtEndPreamble{
@@ -1261,14 +1305,14 @@ keepspaces]}
\fgruler@div{#1}{10}%
\multiput(0,0)(10,0){\@tempcnta}{\fgruler@cm@thick@iii\fgruler@cm@color@iii\line(0,-1){\fgruler@marklth}}%
\iffgruler@borderline\put(0,0){\line(1,0){#1}}\fi%
-\setcounter{fgrulernum}{\fgruler@startnum}\stepcounter{fgrulernum}%
+\setcounter{fgrulernum}{\fgruler@startnumh}\stepcounter{fgrulernum}%
\multiput(10,-\fgruler@sep)(10,0){\fgruler@tempdima}{\makebox(0,0)[t]{\fgruler@font@\thefgrulernum\stepcounter{fgrulernum}}}}
\def\fgruler@cm@rightdown@#1{%
\setlength{\unitlength}{1mm}%
\begin{picture}(#1,\fgruler@width)(0,-\fgruler@width)%
\fgruler@cm@rightdown{#1}%
-\setcounter{fgrulernum}{\fgruler@startnum}%
+\setcounter{fgrulernum}{\fgruler@startnumh}%
\put(0,-\fgruler@sep){\makebox(0,0)[t]{\fgruler@font@\thefgrulernum}}%
\ifdim#1>.5cm\put(5,-\fgruler@sep){\makebox(0,0)[t]{\fgruler@font@\fgruler@caption@cm}}\fi%
\end{picture}}
@@ -1294,14 +1338,14 @@ keepspaces]}
\fgruler@div{#1}{16}%
\multiput(0,0)(16,0){\@tempcnta}{\fgruler@in@thick@v\fgruler@in@color@v\line(0,-1){\fgruler@marklth}}%
\iffgruler@borderline\put(0,0){\line(1,0){#1}}\fi%
-\setcounter{fgrulernum}{\fgruler@startnum}\stepcounter{fgrulernum}%
+\setcounter{fgrulernum}{\fgruler@startnumh}\stepcounter{fgrulernum}%
\multiput(16,-\fgruler@sep)(16,0){\fgruler@tempdima}{\makebox(0,0)[t]{\fgruler@font@\thefgrulernum\stepcounter{fgrulernum}}}}
\def\fgruler@in@rightdown@#1{%
\setlength{\unitlength}{.0625in}%
\begin{picture}(#1,\fgruler@width)(0,-\fgruler@width)%
\fgruler@in@rightdown{#1}%
-\setcounter{fgrulernum}{\fgruler@startnum}%
+\setcounter{fgrulernum}{\fgruler@startnumh}%
\put(0,-\fgruler@sep){\makebox(0,0)[t]{\fgruler@font@\thefgrulernum}}%
\ifdim#1>.5in\put(8,-\fgruler@sep){\makebox(0,0)[t]{\fgruler@font@\fgruler@caption@in}}\fi%
\end{picture}}
@@ -1321,14 +1365,14 @@ keepspaces]}
\fgruler@div{#1}{10}%
\multiput(0,0)(10,0){\@tempcnta}{\fgruler@cm@thick@iii\fgruler@cm@color@iii\line(0,1){\fgruler@marklth}}%
\iffgruler@borderline\put(0,0){\line(1,0){#1}}\fi%
-\setcounter{fgrulernum}{\fgruler@startnum}\stepcounter{fgrulernum}%
+\setcounter{fgrulernum}{\fgruler@startnumh}\stepcounter{fgrulernum}%
\multiput(10,\fgruler@sep)(10,0){\fgruler@tempdima}{\makebox(0,0)[b]{\fgruler@font@\thefgrulernum\stepcounter{fgrulernum}}}}
\def\fgruler@cm@rightup@#1{%
\setlength{\unitlength}{1mm}%
\begin{picture}(#1,\fgruler@width)%
\fgruler@cm@rightup{#1}%
-\setcounter{fgrulernum}{\fgruler@startnum}%
+\setcounter{fgrulernum}{\fgruler@startnumh}%
\put(0,\fgruler@sep){\makebox(0,0)[b]{\fgruler@font@\thefgrulernum}}%
\ifdim#1>.5cm\put(5,\fgruler@sep){\makebox(0,0)[b]{\fgruler@font@\fgruler@caption@cm}}\fi%
\end{picture}}
@@ -1354,14 +1398,14 @@ keepspaces]}
\fgruler@div{#1}{16}%
\multiput(0,0)(16,0){\@tempcnta}{\fgruler@in@thick@v\fgruler@in@color@v\line(0,1){\fgruler@marklth}}%
\iffgruler@borderline\put(0,0){\line(1,0){#1}}\fi%
-\setcounter{fgrulernum}{\fgruler@startnum}\stepcounter{fgrulernum}%
+\setcounter{fgrulernum}{\fgruler@startnumh}\stepcounter{fgrulernum}%
\multiput(16,\fgruler@sep)(16,0){\fgruler@tempdima}{\makebox(0,0)[b]{\fgruler@font@\thefgrulernum\stepcounter{fgrulernum}}}}
\def\fgruler@in@rightup@#1{%
\setlength{\unitlength}{.0625in}%
\begin{picture}(#1,\fgruler@width)%
\fgruler@in@rightup{#1}%
-\setcounter{fgrulernum}{\fgruler@startnum}%
+\setcounter{fgrulernum}{\fgruler@startnumh}%
\put(0,\fgruler@sep){\makebox(0,0)[b]{\fgruler@font@\thefgrulernum}}%
\ifdim#1>.5in\put(8,\fgruler@sep){\makebox(0,0)[b]{\fgruler@font@\fgruler@caption@in}}\fi%
\end{picture}}
@@ -1381,14 +1425,14 @@ keepspaces]}
\fgruler@div{#1}{10}%
\multiput(0,0)(-10,0){\@tempcnta}{\fgruler@cm@thick@iii\fgruler@cm@color@iii\line(0,-1){\fgruler@marklth}}%
\iffgruler@borderline\put(0,0){\line(-1,0){#1}}\fi%
-\setcounter{fgrulernum}{\fgruler@startnum}\stepcounter{fgrulernum}%
+\setcounter{fgrulernum}{\fgruler@startnumh}\stepcounter{fgrulernum}%
\multiput(-10,-\fgruler@sep)(-10,0){\fgruler@tempdima}{\makebox(0,0)[t]{\fgruler@font@\thefgrulernum\stepcounter{fgrulernum}}}}
\def\fgruler@cm@leftdown@#1{%
\setlength{\unitlength}{1mm}%
\begin{picture}(#1,\fgruler@width)(-#1,-\fgruler@width)%
\fgruler@cm@leftdown{#1}%
-\setcounter{fgrulernum}{\fgruler@startnum}%
+\setcounter{fgrulernum}{\fgruler@startnumh}%
\put(0,-\fgruler@sep){\makebox(0,0)[t]{\fgruler@font@\thefgrulernum}}%
\ifdim#1>.5cm\put(-5,-\fgruler@sep){\makebox(0,0)[t]{\fgruler@font@\fgruler@caption@cm}}\fi%
\end{picture}}
@@ -1414,14 +1458,14 @@ keepspaces]}
\fgruler@div{#1}{16}%
\multiput(0,0)(-16,0){\@tempcnta}{\fgruler@in@thick@v\fgruler@in@color@v\line(0,-1){\fgruler@marklth}}%
\iffgruler@borderline\put(0,0){\line(-1,0){#1}}\fi%
-\setcounter{fgrulernum}{\fgruler@startnum}\stepcounter{fgrulernum}%
+\setcounter{fgrulernum}{\fgruler@startnumh}\stepcounter{fgrulernum}%
\multiput(-16,-\fgruler@sep)(-16,0){\fgruler@tempdima}{\makebox(0,0)[t]{\fgruler@font@\thefgrulernum\stepcounter{fgrulernum}}}}
\def\fgruler@in@leftdown@#1{%
\setlength{\unitlength}{.0625in}%
\begin{picture}(#1,\fgruler@width)(-#1,-\fgruler@width)%
\fgruler@in@leftdown{#1}%
-\setcounter{fgrulernum}{\fgruler@startnum}%
+\setcounter{fgrulernum}{\fgruler@startnumh}%
\put(0,-\fgruler@sep){\makebox(0,0)[t]{\fgruler@font@\thefgrulernum}}%
\ifdim#1>.5in\put(-8,-\fgruler@sep){\makebox(0,0)[t]{\fgruler@font@\fgruler@caption@in}}\fi%
\end{picture}}
@@ -1441,14 +1485,14 @@ keepspaces]}
\fgruler@div{#1}{10}%
\multiput(0,0)(-10,0){\@tempcnta}{\fgruler@cm@thick@iii\fgruler@cm@color@iii\line(0,1){\fgruler@marklth}}%
\iffgruler@borderline\put(0,0){\line(-1,0){#1}}\fi%
-\setcounter{fgrulernum}{\fgruler@startnum}\stepcounter{fgrulernum}%
+\setcounter{fgrulernum}{\fgruler@startnumh}\stepcounter{fgrulernum}%
\multiput(-10,\fgruler@sep)(-10,0){\fgruler@tempdima}{\makebox(0,0)[b]{\fgruler@font@\thefgrulernum\stepcounter{fgrulernum}}}}
\def\fgruler@cm@leftup@#1{%
\setlength{\unitlength}{1mm}%
\begin{picture}(#1,\fgruler@width)(-#1,0)%
\fgruler@cm@leftup{#1}%
-\setcounter{fgrulernum}{\fgruler@startnum}%
+\setcounter{fgrulernum}{\fgruler@startnumh}%
\put(0,\fgruler@sep){\makebox(0,0)[b]{\fgruler@font@\thefgrulernum}}%
\ifdim#1>.5cm\put(-5,\fgruler@sep){\makebox(0,0)[b]{\fgruler@font@\fgruler@caption@cm}}\fi%
\end{picture}}
@@ -1474,14 +1518,14 @@ keepspaces]}
\fgruler@div{#1}{16}%
\multiput(0,0)(-16,0){\@tempcnta}{\fgruler@in@thick@v\fgruler@in@color@v\line(0,1){\fgruler@marklth}}%
\iffgruler@borderline\put(0,0){\line(-1,0){#1}}\fi%
-\setcounter{fgrulernum}{\fgruler@startnum}\stepcounter{fgrulernum}%
+\setcounter{fgrulernum}{\fgruler@startnumh}\stepcounter{fgrulernum}%
\multiput(-16,\fgruler@sep)(-16,0){\fgruler@tempdima}{\makebox(0,0)[b]{\fgruler@font@\thefgrulernum\stepcounter{fgrulernum}}}}
\def\fgruler@in@leftup@#1{%
\setlength{\unitlength}{.0625in}%
\begin{picture}(#1,\fgruler@width)(-#1,0)%
\fgruler@in@leftup{#1}%
-\setcounter{fgrulernum}{\fgruler@startnum}%
+\setcounter{fgrulernum}{\fgruler@startnumh}%
\put(0,\fgruler@sep){\makebox(0,0)[b]{\fgruler@font@\thefgrulernum}}%
\ifdim#1>.5in\put(-8,\fgruler@sep){\makebox(0,0)[b]{\fgruler@font@\fgruler@caption@in}}\fi%
\end{picture}}
@@ -1501,14 +1545,14 @@ keepspaces]}
\fgruler@div{#1}{10}%
\multiput(0,0)(0,-10){\@tempcnta}{\fgruler@cm@thick@iii\fgruler@cm@color@iii\line(1,0){\fgruler@marklth}}%
\iffgruler@borderline\put(0,0){\line(0,-1){#1}}\fi%
-\setcounter{fgrulernum}{\fgruler@startnum}\stepcounter{fgrulernum}%
+\setcounter{fgrulernum}{\fgruler@startnumv}\stepcounter{fgrulernum}%
\multiput(\fgruler@sep,-10)(0,-10){\fgruler@tempdima}{\makebox(0,0)[l]{\fgruler@rotatebox{90}{\fgruler@font@\thefgrulernum\stepcounter{fgrulernum}}}}}
\def\fgruler@cm@downright@#1{%
\setlength{\unitlength}{1mm}%
\begin{picture}(\fgruler@width,#1)(0,-#1)%
\fgruler@cm@downright{#1}%
-\setcounter{fgrulernum}{\fgruler@startnum}%
+\setcounter{fgrulernum}{\fgruler@startnumv}%
\put(\fgruler@sep,0){\makebox(0,0)[l]{\fgruler@rotatebox{90}{\fgruler@font@\thefgrulernum}}}%
\ifdim#1>.5cm\put(\fgruler@sep,-5){\makebox(0,0)[l]{\fgruler@rotatebox{90}{\fgruler@font@\fgruler@caption@cm}}}\fi%
\end{picture}}
@@ -1534,14 +1578,14 @@ keepspaces]}
\fgruler@div{#1}{16}%
\multiput(0,0)(0,-16){\@tempcnta}{\fgruler@in@thick@v\fgruler@in@color@v\line(1,0){\fgruler@marklth}}%
\iffgruler@borderline\put(0,0){\line(0,-1){#1}}\fi%
-\setcounter{fgrulernum}{\fgruler@startnum}\stepcounter{fgrulernum}%
+\setcounter{fgrulernum}{\fgruler@startnumv}\stepcounter{fgrulernum}%
\multiput(\fgruler@sep,-16)(0,-16){\fgruler@tempdima}{\makebox(0,0)[l]{\fgruler@rotatebox{90}{\fgruler@font@\thefgrulernum\stepcounter{fgrulernum}}}}}
\def\fgruler@in@downright@#1{%
\setlength{\unitlength}{.0625in}%
\begin{picture}(\fgruler@width,#1)(0,-#1)%
\fgruler@in@downright{#1}%
-\setcounter{fgrulernum}{\fgruler@startnum}%
+\setcounter{fgrulernum}{\fgruler@startnumv}%
\put(\fgruler@sep,0){\makebox(0,0)[l]{\fgruler@rotatebox{90}{\fgruler@font@\thefgrulernum}}}%
\ifdim#1>.5in\put(\fgruler@sep,-8){\makebox(0,0)[l]{\fgruler@rotatebox{90}{\fgruler@font@\fgruler@caption@in}}}\fi%
\end{picture}}
@@ -1561,14 +1605,14 @@ keepspaces]}
\fgruler@div{#1}{10}%
\multiput(0,0)(0,-10){\@tempcnta}{\fgruler@cm@thick@iii\fgruler@cm@color@iii\line(-1,0){\fgruler@marklth}}%
\iffgruler@borderline\put(0,0){\line(0,-1){#1}}\fi%
-\setcounter{fgrulernum}{\fgruler@startnum}\stepcounter{fgrulernum}%
+\setcounter{fgrulernum}{\fgruler@startnumv}\stepcounter{fgrulernum}%
\multiput(-\fgruler@sep,-10)(0,-10){\fgruler@tempdima}{\makebox(0,0)[r]{\fgruler@rotatebox{-90}{\fgruler@font@\thefgrulernum\stepcounter{fgrulernum}}}}}
\def\fgruler@cm@downleft@#1{%
\setlength{\unitlength}{1mm}%
\begin{picture}(\fgruler@width,#1)(-\fgruler@width,-#1)%
\fgruler@cm@downleft{#1}%
-\setcounter{fgrulernum}{\fgruler@startnum}%
+\setcounter{fgrulernum}{\fgruler@startnumv}%
\put(-\fgruler@sep,0){\makebox(0,0)[r]{\fgruler@rotatebox{-90}{\fgruler@font@\thefgrulernum}}}%
\ifdim#1>.5cm\put(-\fgruler@sep,-5){\makebox(0,0)[r]{\fgruler@rotatebox{-90}{\fgruler@font@\fgruler@caption@cm}}}\fi%
\end{picture}}
@@ -1594,14 +1638,14 @@ keepspaces]}
\fgruler@div{#1}{16}%
\multiput(0,0)(0,-16){\@tempcnta}{\fgruler@in@thick@v\fgruler@in@color@v\line(-1,0){\fgruler@marklth}}%
\iffgruler@borderline\put(0,0){\line(0,-1){#1}}\fi%
-\setcounter{fgrulernum}{\fgruler@startnum}\stepcounter{fgrulernum}%
+\setcounter{fgrulernum}{\fgruler@startnumv}\stepcounter{fgrulernum}%
\multiput(-\fgruler@sep,-16)(0,-16){\fgruler@tempdima}{\makebox(0,0)[r]{\fgruler@rotatebox{-90}{\fgruler@font@\thefgrulernum\stepcounter{fgrulernum}}}}}
\def\fgruler@in@downleft@#1{%
\setlength{\unitlength}{.0625in}%
\begin{picture}(\fgruler@width,#1)(-\fgruler@width,-#1)%
\fgruler@in@downleft{#1}%
-\setcounter{fgrulernum}{\fgruler@startnum}%
+\setcounter{fgrulernum}{\fgruler@startnumv}%
\put(-\fgruler@sep,0){\makebox(0,0)[r]{\fgruler@rotatebox{-90}{\fgruler@font@\thefgrulernum}}}%
\ifdim#1>.5in\put(-\fgruler@sep,-8){\makebox(0,0)[r]{\fgruler@rotatebox{-90}{\fgruler@font@\fgruler@caption@in}}}\fi%
\end{picture}}
@@ -1621,14 +1665,14 @@ keepspaces]}
\fgruler@div{#1}{10}%
\multiput(0,0)(0,10){\@tempcnta}{\fgruler@cm@thick@iii\fgruler@cm@color@iii\line(1,0){\fgruler@marklth}}%
\iffgruler@borderline\put(0,0){\line(0,1){#1}}\fi%
-\setcounter{fgrulernum}{\fgruler@startnum}\stepcounter{fgrulernum}%
+\setcounter{fgrulernum}{\fgruler@startnumv}\stepcounter{fgrulernum}%
\multiput(\fgruler@sep,10)(0,10){\fgruler@tempdima}{\makebox(0,0)[l]{\fgruler@rotatebox{90}{\fgruler@font@\thefgrulernum\stepcounter{fgrulernum}}}}}
\def\fgruler@cm@upright@#1{%
\setlength{\unitlength}{1mm}%
\begin{picture}(\fgruler@width,#1)%
\fgruler@cm@upright{#1}%
-\setcounter{fgrulernum}{\fgruler@startnum}%
+\setcounter{fgrulernum}{\fgruler@startnumv}%
\put(\fgruler@sep,0){\makebox(0,0)[l]{\fgruler@rotatebox{90}{\fgruler@font@\thefgrulernum}}}%
\ifdim#1>.5cm\put(\fgruler@sep,5){\makebox(0,0)[l]{\fgruler@rotatebox{90}{\fgruler@font@\fgruler@caption@cm}}}\fi%
\end{picture}}
@@ -1654,14 +1698,14 @@ keepspaces]}
\fgruler@div{#1}{16}%
\multiput(0,0)(0,16){\@tempcnta}{\fgruler@in@thick@v\fgruler@in@color@v\line(1,0){\fgruler@marklth}}%
\iffgruler@borderline\put(0,0){\line(0,1){#1}}\fi%
-\setcounter{fgrulernum}{\fgruler@startnum}\stepcounter{fgrulernum}%
+\setcounter{fgrulernum}{\fgruler@startnumv}\stepcounter{fgrulernum}%
\multiput(\fgruler@sep,16)(0,16){\fgruler@tempdima}{\makebox(0,0)[l]{\fgruler@rotatebox{90}{\fgruler@font@\thefgrulernum\stepcounter{fgrulernum}}}}}
\def\fgruler@in@upright@#1{%
\setlength{\unitlength}{.0625in}%
\begin{picture}(\fgruler@width,#1)%
\fgruler@in@upright{#1}%
-\setcounter{fgrulernum}{\fgruler@startnum}%
+\setcounter{fgrulernum}{\fgruler@startnumv}%
\put(\fgruler@sep,0){\makebox(0,0)[l]{\fgruler@rotatebox{90}{\fgruler@font@\thefgrulernum}}}%
\ifdim#1>.5in\put(\fgruler@sep,8){\makebox(0,0)[l]{\fgruler@rotatebox{90}{\fgruler@font@\fgruler@caption@in}}}\fi%
\end{picture}}
@@ -1681,14 +1725,14 @@ keepspaces]}
\fgruler@div{#1}{10}%
\multiput(0,0)(0,10){\@tempcnta}{\fgruler@cm@thick@iii\fgruler@cm@color@iii\line(-1,0){\fgruler@marklth}}%
\iffgruler@borderline\put(0,0){\line(0,1){#1}}\fi%
-\setcounter{fgrulernum}{\fgruler@startnum}\stepcounter{fgrulernum}%
+\setcounter{fgrulernum}{\fgruler@startnumv}\stepcounter{fgrulernum}%
\multiput(-\fgruler@sep,10)(0,10){\fgruler@tempdima}{\makebox(0,0)[r]{\fgruler@rotatebox{-90}{\fgruler@font@\thefgrulernum\stepcounter{fgrulernum}}}}}
\def\fgruler@cm@upleft@#1{%
\setlength{\unitlength}{1mm}%
\begin{picture}(\fgruler@width,#1)(-\fgruler@width,0)%
\fgruler@cm@upleft{#1}%
-\setcounter{fgrulernum}{\fgruler@startnum}%
+\setcounter{fgrulernum}{\fgruler@startnumv}%
\put(-\fgruler@sep,0){\makebox(0,0)[r]{\fgruler@rotatebox{-90}{\fgruler@font@\thefgrulernum}}}%
\ifdim#1>.5cm\put(-\fgruler@sep,5){\makebox(0,0)[r]{\fgruler@rotatebox{-90}{\fgruler@font@\fgruler@caption@cm}}}\fi%
\end{picture}}
@@ -1714,14 +1758,14 @@ keepspaces]}
\fgruler@div{#1}{16}%
\multiput(0,0)(0,16){\@tempcnta}{\fgruler@in@thick@v\fgruler@in@color@v\line(-1,0){\fgruler@marklth}}%
\iffgruler@borderline\put(0,0){\line(0,1){#1}}\fi%
-\setcounter{fgrulernum}{\fgruler@startnum}\stepcounter{fgrulernum}%
+\setcounter{fgrulernum}{\fgruler@startnumv}\stepcounter{fgrulernum}%
\multiput(-\fgruler@sep,16)(0,16){\fgruler@tempdima}{\makebox(0,0)[r]{\fgruler@rotatebox{-90}{\fgruler@font@\thefgrulernum\stepcounter{fgrulernum}}}}}
\def\fgruler@in@upleft@#1{%
\setlength{\unitlength}{.0625in}%
\begin{picture}(\fgruler@width,#1)(-\fgruler@width,0)%
\fgruler@in@upleft{#1}%
-\setcounter{fgrulernum}{\fgruler@startnum}%
+\setcounter{fgrulernum}{\fgruler@startnumv}%
\put(-\fgruler@sep,0){\makebox(0,0)[r]{\fgruler@rotatebox{-90}{\fgruler@font@\thefgrulernum}}}%
\ifdim#1>.5in\put(-\fgruler@sep,8){\makebox(0,0)[r]{\fgruler@rotatebox{-90}{\fgruler@font@\fgruler@caption@in}}}\fi%
\end{picture}}
@@ -1918,9 +1962,132 @@ keepspaces]}
\def\fgruler@in@lowerright@fg{\fgruler@in@lowerright@fg@{\fgruler@hshift}{\fgruler@vshift}}
+%% UPPERLEFTT CM
+\def\fgruler@cm@upperleftT@fg{%
+\AtTextLowerLeft{%
+\setlength{\unitlength}{1mm}%
+\fgruler@fgsetting%
+\begin{picture}(\textwidth,\textheight)(0,-\textheight)%
+\fgruler@cm@rightup{\textwidth}%
+\fgruler@cm@downleft{\textheight}%
+\put(5,\fgruler@sep){\makebox(0,0)[b]{\fgruler@font@\fgruler@caption@cm}}%
+\setcounter{fgrulernum}{\fgruler@startnumh}%
+\put(0,\fgruler@sep){\makebox(0,0)[b]{\fgruler@font@\thefgrulernum}}%
+\setcounter{fgrulernum}{\fgruler@startnumv}%
+\put(-\fgruler@sep,0){\makebox(0,0)[r]{\fgruler@font@\thefgrulernum}}%
+\end{picture}}}
+
+%% UPPERLEFTT IN
+\def\fgruler@in@upperleftT@fg{%
+\AtTextLowerLeft{%
+\setlength{\unitlength}{.0625in}%
+\fgruler@fgsetting%
+\begin{picture}(\textwidth,\textheight)(0,-\textheight)%
+\fgruler@in@rightup{\textwidth}%
+\fgruler@in@downleft{\textheight}%
+\put(8,\fgruler@sep){\makebox(0,0)[b]{\fgruler@font@\fgruler@caption@in}}%
+\setcounter{fgrulernum}{\fgruler@startnumh}%
+\put(0,\fgruler@sep){\makebox(0,0)[b]{\fgruler@font@\thefgrulernum}}%
+\setcounter{fgrulernum}{\fgruler@startnumv}%
+\put(-\fgruler@sep,0){\makebox(0,0)[r]{\fgruler@font@\thefgrulernum}}%
+\end{picture}}}
+
+%% UPPERRIGHTT CM
+\def\fgruler@cm@upperrightT@fg{%
+\AtTextLowerLeft{%
+\setlength{\unitlength}{1mm}%
+\fgruler@fgsetting%
+\begin{picture}(\textwidth,\textheight)(-\textwidth,-\textheight)%
+\fgruler@cm@leftup{\textwidth}%
+\fgruler@cm@downright{\textheight}%
+\put(-5,\fgruler@sep){\makebox(0,0)[b]{\fgruler@font@\fgruler@caption@cm}}%
+\setcounter{fgrulernum}{\fgruler@startnumh}%
+\put(0,\fgruler@sep){\makebox(0,0)[b]{\fgruler@font@\thefgrulernum}}%
+\setcounter{fgrulernum}{\fgruler@startnumv}%
+\put(\fgruler@sep,0){\makebox(0,0)[l]{\fgruler@font@\thefgrulernum}}%
+\end{picture}}}
+
+%% UPPERRIGHTT IN
+\def\fgruler@in@upperrightT@fg{%
+\AtTextLowerLeft{%
+\setlength{\unitlength}{.0625in}%
+\fgruler@fgsetting%
+\begin{picture}(\textwidth,\textheight)(-\textwidth,-\textheight)%
+\fgruler@in@leftup{\textwidth}%
+\fgruler@in@downright{\textheight}%
+\put(-8,\fgruler@sep){\makebox(0,0)[b]{\fgruler@font@\fgruler@caption@in}}%
+\setcounter{fgrulernum}{\fgruler@startnumh}%
+\put(0,\fgruler@sep){\makebox(0,0)[b]{\fgruler@font@\thefgrulernum}}%
+\setcounter{fgrulernum}{\fgruler@startnumv}%
+\put(\fgruler@sep,0){\makebox(0,0)[l]{\fgruler@font@\thefgrulernum}}%
+\end{picture}}}
+
+%% LOWERLEFTT CM
+\def\fgruler@cm@lowerleftT@fg{%
+\AtTextLowerLeft{%
+\setlength{\unitlength}{1mm}%
+\fgruler@fgsetting%
+\begin{picture}(\textwidth,\textheight)(0,0)%
+\fgruler@cm@rightdown{\textwidth}%
+\fgruler@cm@upleft{\textheight}%
+\put(5,-\fgruler@sep){\makebox(0,0)[t]{\fgruler@font@\fgruler@caption@cm}}%
+\setcounter{fgrulernum}{\fgruler@startnumh}%
+\put(0,-\fgruler@sep){\makebox(0,0)[t]{\fgruler@font@\thefgrulernum}}%
+\setcounter{fgrulernum}{\fgruler@startnumv}%
+\put(-\fgruler@sep,0){\makebox(0,0)[r]{\fgruler@font@\thefgrulernum}}%
+\end{picture}}}
+
+%% LOWERLEFTT IN
+\def\fgruler@in@lowerleftT@fg{%
+\AtTextLowerLeft{%
+\setlength{\unitlength}{.0625in}%
+\fgruler@fgsetting%
+\begin{picture}(\textwidth,\textheight)(0,0)%
+\fgruler@in@rightdown{\textwidth}%
+\fgruler@in@upleft{\textheight}%
+\put(8,-\fgruler@sep){\makebox(0,0)[t]{\fgruler@font@\fgruler@caption@in}}%
+\setcounter{fgrulernum}{\fgruler@startnumh}%
+\put(0,-\fgruler@sep){\makebox(0,0)[t]{\fgruler@font@\thefgrulernum}}%
+\setcounter{fgrulernum}{\fgruler@startnumv}%
+\put(-\fgruler@sep,0){\makebox(0,0)[r]{\fgruler@font@\thefgrulernum}}%
+\end{picture}}}
+
+%% LOWERRIGHTT CM
+\def\fgruler@cm@lowerrightT@fg{%
+\AtTextLowerLeft{%
+\setlength{\unitlength}{1mm}%
+\fgruler@fgsetting%
+\begin{picture}(\textwidth,\textheight)(-\textwidth,0)%
+\fgruler@cm@leftdown{\textwidth}%
+\fgruler@cm@upright{\textheight}%
+\put(-5,-\fgruler@sep){\makebox(0,0)[t]{\fgruler@font@\fgruler@caption@cm}}%
+\setcounter{fgrulernum}{\fgruler@startnumh}%
+\put(0,-\fgruler@sep){\makebox(0,0)[t]{\fgruler@font@\thefgrulernum}}%
+\setcounter{fgrulernum}{\fgruler@startnumv}%
+\put(\fgruler@sep,0){\makebox(0,0)[l]{\fgruler@font@\thefgrulernum}}%
+\end{picture}}}
+
+%% LOWERRIGHTT IN
+\def\fgruler@in@lowerrightT@fg{%
+\AtTextLowerLeft{%
+\setlength{\unitlength}{.0625in}%
+\fgruler@fgsetting%
+\begin{picture}(\textwidth,\textheight)(-\textwidth,0)%
+\fgruler@in@leftdown{\textwidth}%
+\fgruler@in@upright{\textheight}%
+\put(-8,-\fgruler@sep){\makebox(0,0)[t]{\fgruler@font@\fgruler@caption@in}}%
+\setcounter{fgrulernum}{\fgruler@startnumh}%
+\put(0,-\fgruler@sep){\makebox(0,0)[t]{\fgruler@font@\thefgrulernum}}%
+\setcounter{fgrulernum}{\fgruler@startnumv}%
+\put(\fgruler@sep,0){\makebox(0,0)[l]{\fgruler@font@\thefgrulernum}}%
+\end{picture}}}
+
%% USER
\def\fgruler@cm@user@fg{}
\def\fgruler@in@user@fg{}
+\def\fgrulertype#1#2{\csname fgruler@#1@#2@fg\endcsname}
+\def\fgrulerdefusercm#1{\def\fgruler@cm@user@fg{#1}}
+\def\fgrulerdefuserin#1{\def\fgruler@in@user@fg{#1}}
% \end{macrocode}
% \Finale
\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/fgruler/fgruler.pdf b/macros/latex/contrib/fgruler/fgruler.pdf
index cd1989fa8f..a823e23c5a 100644
--- a/macros/latex/contrib/fgruler/fgruler.pdf
+++ b/macros/latex/contrib/fgruler/fgruler.pdf
Binary files differ