summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-13 00:06:05 +0000
committerKarl Berry <karl@freefriends.org>2006-01-13 00:06:05 +0000
commit4eec31e0faa8902f1a4a67a17b293c3e01e42962 (patch)
tree229553277bb7f66d847f55bdb262e2a2cb5c62e0 /Master/texmf-dist
parent5731628b891c42684fe816f34b3e27302796bb87 (diff)
scalebar
git-svn-id: svn://tug.org/texlive/trunk@1297 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/tex/latex/scalebar/scalebar.sty99
1 files changed, 99 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/scalebar/scalebar.sty b/Master/texmf-dist/tex/latex/scalebar/scalebar.sty
new file mode 100644
index 00000000000..1e842198f70
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/scalebar/scalebar.sty
@@ -0,0 +1,99 @@
+%%
+%% 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'.