%%
%% This is file `scalebar.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% scalebar.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2003 by Michael Lake <mikel@speleonics.com.au>
%% 
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.2 of this license
%% or (at your option) any later version.  The latest version of this
%% license is in:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% and version 1.2 or later is part of all distributions of LaTeX version
%% 1999/12/01 or later.
%% 
\ProvidesPackage{scalebar}%
           [2003/05/01 v1.0 Scalebars for maps and diagrams]
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\RequirePackage{ifthen}
\RequirePackage{calc}
\RequirePackage{fp}
\newlength{\SB@Length}%
\newcounter{SB@majordivs}%
\newcounter{SB@minordivs}%
\newcounter{SB@evenodd}%
\newcounter{SB@countup}%
\newlength{\SB@Height}%
\newlength{\SB@Thick}%
\newlength{\SB@MajorWidth}%
\newlength{\SB@MinorWidth}%
\newlength{\SB@DivisionWidth}%
\newlength{\SB@TextWidth}%
\newcommand{\SB@unitT}{%
\rule{\SB@DivisionWidth}{\SB@Height}\hspace{-\SB@DivisionWidth}%
\raisebox{-\SB@Height}{\rule{\SB@DivisionWidth}{\SB@Thick}}}%
\newcommand{\SB@unitB}{%
\raisebox{\SB@Height-\SB@Thick}%
{\rule{\SB@DivisionWidth}{\SB@Thick}}\hspace{-\SB@DivisionWidth}%
\raisebox{-\SB@Height}{\rule{\SB@DivisionWidth}{\SB@Height}}}%
\newcommand{\scalebar}[7][]{%
\ifthenelse{\equal{inverse}{#1}}%
{\setcounter{SB@evenodd}{1}}%
{\setcounter{SB@evenodd}{0}}%
\setlength{\SB@Length}{#2}%
\setcounter{SB@minordivs}{#3}%
\setcounter{SB@majordivs}{#4}%
\def\SB@StartNo{#5}%
\def\SB@EndNo{#6}%
\def\SB@TextUnits{#7}%
\setlength{\SB@Height}{1.2ex}%
\setlength{\SB@Thick}{0.2mm}%
\setlength{\SB@MajorWidth}{\SB@Length / \theSB@majordivs}%
\setlength{\SB@MinorWidth}{\SB@MajorWidth / \theSB@minordivs}%
\raisebox{-\SB@Height}{\rule{\SB@Thick}{2\SB@Height}}%
\setlength{\SB@DivisionWidth}{\SB@MinorWidth}%
\setcounter{SB@countup}{0}%
\whiledo{\not\theSB@countup=\theSB@minordivs}{%
\ifthenelse{\isodd{\value{SB@evenodd}}}{\SB@unitB}{\SB@unitT}%
\addtocounter{SB@evenodd}{1}%
\addtocounter{SB@countup}{1}}%
\setlength{\SB@DivisionWidth}{\SB@MajorWidth}%
\setcounter{SB@countup}{1}%
\whiledo{\not\theSB@countup=\theSB@majordivs}{%
\ifthenelse{\isodd{\value{SB@evenodd}}}{\SB@unitB}{\SB@unitT}%
\addtocounter{SB@evenodd}{1}%
\addtocounter{SB@countup}{1}}%
\raisebox{-\SB@Height}{\rule{\SB@Thick}{2\SB@Height}}%
\FPupn\SBIncrement%
{\the\value{SB@majordivs} \SB@StartNo{} \SB@EndNo{} - /}%
\def\SBRound{0}%
\FPifint\SBIncrement%
\else\def\SBRound{1}\FPupn\SBIncrement{\SBIncrement{} 1 round}\fi%
\FPifint\SB@StartNo%
\else\def\SBRound{1}\FPupn\SB@StartNo{\SB@StartNo{} 1 round}\fi%
\FPifint\SB@EndNo%
\else\def\SBRound{1}\FPupn\SB@EndNo{\SB@EndNo{} 1 round}\fi%
\hspace{-\SB@Length}\hspace{-\SB@Thick}%
\raisebox{-3\SB@Height}{%
\FPset\SBNextNo\SB@StartNo%
\setcounter{SB@countup}{0}%
\whiledo{\not\theSB@countup>\theSB@majordivs}{%
\FPupn\SBNextNo{\SBNextNo{} \SBRound{} round}%
\settowidth{\SB@TextWidth}{\SBNextNo}%
\hspace{-0.5\SB@TextWidth}%
\SBNextNo\hspace{-0.5\SB@TextWidth}\hspace{\SB@MajorWidth}%
\FPupn\SBNextNo{\SBNextNo{} \SBIncrement{} add}%
\addtocounter{SB@countup}{1}}%
\hspace{-\SB@MajorWidth}\hspace{0.5\SB@TextWidth}\,\SB@TextUnits}%
}%
\endinput
%%
%% End of file `scalebar.sty'.
