| 1 |
\documentclass[a4paper,12pt]{article} |
| 2 |
\usepackage{scalebar} |
| 3 |
\usepackage{tabularx} |
| 4 |
\usepackage{moreverb} |
| 5 |
\begin{document} |
| 6 |
\thispagestyle{empty} |
| 7 |
|
| 8 |
\setlength{\parindent}{0pt} |
| 9 |
\setlength{\parskip}{0.4\baselineskip} |
| 10 |
|
| 11 |
{\huge \centering Examples for the \texttt{scalebars} Package |
| 12 |
|
| 13 |
} |
| 14 |
\vspace{2\baselineskip} |
| 15 |
|
| 16 |
{\raggedleft Michael Lake\\ |
| 17 |
\small http://www.speleonics.com.au/mikes/\\ |
| 18 |
\makeatletter [email protected] \makeatother |
| 19 |
|
| 20 |
} |
| 21 |
\vspace{2\baselineskip} |
| 22 |
|
| 23 |
Usage:\\ |
| 24 |
\verb+\scalebar[inverse]{length}{minordivs}{majordivs}+\\ |
| 25 |
\verb+ {starting No.}{ending No.}{units}+ |
| 26 |
|
| 27 |
where:\\ |
| 28 |
\begin{tabularx}{\textwidth}{lX} |
| 29 |
\texttt{length} &the desired length of the scalebar e.g.\ 10cm or 4in\\ |
| 30 |
\texttt{minordivs} &number of minor divisions within the first major |
| 31 |
division e.g.\ 4 (the first major division will always be |
| 32 |
subdivided unless this value is set to 1)\\ |
| 33 |
\texttt{majordivs} &number of major divisions e.g.\ 5 \\ |
| 34 |
\texttt{starting No.}&the number that the scalebar text will start from |
| 35 |
e.g.\ 0 or -0.5\\ |
| 36 |
\texttt{ending No.}&the number that the scalebar text will end with |
| 37 |
e.g.\ 2.5 or 25\\ |
| 38 |
\texttt{units}&the units for the scalebar text e.g.\ $\mu$m or km |
| 39 |
\end{tabularx} |
| 40 |
|
| 41 |
|
| 42 |
\section*{Examples} |
| 43 |
|
| 44 |
|
| 45 |
\verb+\scalebar{10cm}{4}{5}{0}{10}{m}+\\ |
| 46 |
\scalebar{10cm}{4}{5}{0}{10}{m} |
| 47 |
\vspace{\baselineskip} |
| 48 |
|
| 49 |
|
| 50 |
This is how to indent a scalebar:\\ |
| 51 |
\verb+\hspace*{2cm}\scalebar{10cm}{4}{5}{0}{10}{m}+\\ |
| 52 |
\hspace*{2cm}\scalebar{10cm}{4}{5}{0}{10}{m} |
| 53 |
\vspace{\baselineskip} |
| 54 |
|
| 55 |
|
| 56 |
Change the length of the scalebar:\\ |
| 57 |
\verb+\scalebar{12cm}{4}{5}{0}{10}{m}+\\ |
| 58 |
\scalebar{12cm}{4}{5}{0}{10}{m} |
| 59 |
|
| 60 |
\newpage |
| 61 |
|
| 62 |
In the following three examples notice how I have scaled the total |
| 63 |
length of the scalebar by roughly the same scale as the font change |
| 64 |
to maintain a nice aspect ratio. |
| 65 |
|
| 66 |
Make a larger scalebar:\\ |
| 67 |
I have scaled the length of the scalebar up (10cm to 12cm) by the same |
| 68 |
scale as the font change (\verb+\normal+ to \verb+\large+) to maintain |
| 69 |
a nice ratio of the length to its height.\\ |
| 70 |
\verb+\large\scalebar{12cm}{4}{5}{0}{10}{m}\normalsize+\\ |
| 71 |
\large\scalebar{12cm}{4}{5}{0}{10}{m}\normalsize |
| 72 |
\vspace{\baselineskip} |
| 73 |
|
| 74 |
|
| 75 |
Make a smaller scalebar:\\ |
| 76 |
Here I scale down the length by an amount similar to the font change.\\ |
| 77 |
\verb+\small\scalebar{8cm}{4}{5}{0}{10}{m}\normalsize+\\ |
| 78 |
\small\scalebar{8cm}{4}{5}{0}{10}{m}\normalsize |
| 79 |
\vspace{\baselineskip} |
| 80 |
|
| 81 |
|
| 82 |
Make a tiny scalebar:\\ |
| 83 |
Here I have to really reduce the length so I don't get a long, skinny and |
| 84 |
ugly looking scalebar.\\ |
| 85 |
\verb+\tiny\scalebar{4cm}{4}{5}{0}{10}{m}\normalsize+\\ |
| 86 |
\tiny\scalebar{4cm}{4}{5}{0}{10}{m}\normalsize |
| 87 |
\vspace{\baselineskip} |
| 88 |
|
| 89 |
|
| 90 |
Change the number of minor and major divisions in the scalebar:\\ |
| 91 |
\verb+\scalebar{10cm}{3}{4}{0}{10}{m}+\\ |
| 92 |
\scalebar{10cm}{3}{4}{0}{12}{m} |
| 93 |
\vspace{\baselineskip} |
| 94 |
|
| 95 |
|
| 96 |
Change the starting and ending numbers:\\ |
| 97 |
\verb+\scalebar{10cm}{4}{5}{-2}{8}{m}+\\ |
| 98 |
\scalebar{10cm}{4}{5}{-2}{8}{m} |
| 99 |
\vspace{\baselineskip} |
| 100 |
|
| 101 |
Change the units of the scalebar:\\ |
| 102 |
\verb+\scalebar{10cm}{4}{5}{0}{10}{$\mu$m}+\\ |
| 103 |
\scalebar{10cm}{4}{5}{0}{10}{$\mu$m} |
| 104 |
\vspace{\baselineskip} |
| 105 |
|
| 106 |
\newpage |
| 107 |
Use fractional values for starting and ending numbers:\\ |
| 108 |
\verb+\scalebar{10cm}{4}{6}{-0.5}{2.5}{m}+\\ |
| 109 |
\scalebar{10cm}{4}{6}{-0.5}{2.5}{m} |
| 110 |
\vspace{\baselineskip} |
| 111 |
|
| 112 |
|
| 113 |
Supress the minor divisions:\\ |
| 114 |
\verb+\scalebar{10cm}{1}{5}{0}{10}{m}+\\ |
| 115 |
\scalebar{10cm}{1}{5}{0}{10}{m} |
| 116 |
\vspace{\baselineskip} |
| 117 |
|
| 118 |
|
| 119 |
Invert the black/white bars:\\ |
| 120 |
\verb+\scalebar[inverse]{10cm}{4}{5}{0}{10}{m}+\\ |
| 121 |
\scalebar[inverse]{10cm}{4}{5}{0}{10}{m} |
| 122 |
\vspace{\baselineskip} |
| 123 |
|
| 124 |
|
| 125 |
Position a scalebar within a picture environment: |
| 126 |
\begin{verbatim} |
| 127 |
\setlength{\unitlength}{1mm} |
| 128 |
\fbox{\begin{picture}(120,50)% create picture 120mm x 50mm |
| 129 |
\put(2,11){Scale 1:200} |
| 130 |
\put(2,7){\small\scalebar{5cm}{2}{5}{0}{10}{m}} |
| 131 |
\end{picture}} |
| 132 |
\end{verbatim} |
| 133 |
\setlength{\unitlength}{1mm} |
| 134 |
\fbox{\begin{picture}(120,50)% create picture 120mm x 50mm |
| 135 |
\put(2,11){Scale 1:200} |
| 136 |
\put(2,7){\small\scalebar{5cm}{2}{5}{0}{10}{m}} |
| 137 |
\end{picture}} |
| 138 |
|
| 139 |
\newpage |
| 140 |
\section*{Problems} |
| 141 |
|
| 142 |
If the length of the scalebar is longer than the page width it will break:\\ |
| 143 |
(the page width here is: \the\textwidth)\\ |
| 144 |
\verb+\scalebar{15cm}{4}{5}{0}{10}{m}+\\ |
| 145 |
\scalebar{15cm}{4}{5}{0}{10}{m} |
| 146 |
\vspace{\baselineskip} |
| 147 |
|
| 148 |
Several mathematical operations are performed and silly use of zero in |
| 149 |
some parameters will result in a mathematical error. Consult the package |
| 150 |
documentation for what is happening. |
| 151 |
|
| 152 |
Also these math calculations do seem to take |
| 153 |
\TeX\ quite a while to perform -- perhaps there is a way to do |
| 154 |
these calculations faster. |
| 155 |
|
| 156 |
If you discover any serious problems please let me know. |
| 157 |
|
| 158 |
|
| 159 |
\vfill |
| 160 |
|
| 161 |
Michael Lake\\ |
| 162 |
\today |
| 163 |
|
| 164 |
\end{document} |
| 165 |
|