summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/scalebar/scalebar_examples.tex
blob: ab68149cc14433a85b134c3c19665103c32fd287 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
\documentclass[a4paper,12pt]{article}
\usepackage{scalebar}
\usepackage{tabularx}
\usepackage{moreverb}
\begin{document}
\thispagestyle{empty}

\setlength{\parindent}{0pt}
\setlength{\parskip}{0.4\baselineskip}

{\huge \centering Examples for the \texttt{scalebars} Package

}
\vspace{2\baselineskip}

{\raggedleft Michael Lake\\
\small http://www.speleonics.com.au/mikes/\\
\makeatletter mikeL@speleonics.com.au \makeatother

}
\vspace{2\baselineskip}

Usage:\\
\verb+\scalebar[inverse]{length}{minordivs}{majordivs}+\\
\verb+                  {starting No.}{ending No.}{units}+

where:\\
\begin{tabularx}{\textwidth}{lX}
\texttt{length}    &the desired length of the scalebar e.g.\ 10cm or 4in\\
\texttt{minordivs} &number of minor divisions within the first major
           division e.g.\ 4 (the first major division will always be
           subdivided unless this value is set to 1)\\
\texttt{majordivs} &number of major divisions e.g.\ 5 \\
\texttt{starting No.}&the number that the scalebar text will start from 
                      e.g.\ 0 or -0.5\\
\texttt{ending No.}&the number that the scalebar text will end with 
                    e.g.\ 2.5 or 25\\
\texttt{units}&the units for the scalebar text e.g.\ $\mu$m or km
\end{tabularx}


\section*{Examples}


\verb+\scalebar{10cm}{4}{5}{0}{10}{m}+\\
      \scalebar{10cm}{4}{5}{0}{10}{m}
\vspace{\baselineskip}


This is how to indent a scalebar:\\
\verb+\hspace*{2cm}\scalebar{10cm}{4}{5}{0}{10}{m}+\\
      \hspace*{2cm}\scalebar{10cm}{4}{5}{0}{10}{m}
\vspace{\baselineskip}


Change the length of the scalebar:\\
\verb+\scalebar{12cm}{4}{5}{0}{10}{m}+\\
      \scalebar{12cm}{4}{5}{0}{10}{m}

\newpage

In the following three examples notice how I have scaled the total 
length of the scalebar by roughly the same scale as the font change 
to maintain a nice aspect ratio.

Make a larger scalebar:\\
I have scaled the length of the scalebar up (10cm to 12cm) by the same 
scale as the font change (\verb+\normal+ to \verb+\large+) to maintain 
a nice ratio of the length to its height.\\
\verb+\large\scalebar{12cm}{4}{5}{0}{10}{m}\normalsize+\\
      \large\scalebar{12cm}{4}{5}{0}{10}{m}\normalsize
\vspace{\baselineskip}


Make a smaller scalebar:\\
Here I scale down the length by an amount similar to the font change.\\
\verb+\small\scalebar{8cm}{4}{5}{0}{10}{m}\normalsize+\\
      \small\scalebar{8cm}{4}{5}{0}{10}{m}\normalsize
\vspace{\baselineskip}


Make a tiny scalebar:\\
Here I have to really reduce the length so I don't get a long, skinny and 
ugly looking scalebar.\\
\verb+\tiny\scalebar{4cm}{4}{5}{0}{10}{m}\normalsize+\\
      \tiny\scalebar{4cm}{4}{5}{0}{10}{m}\normalsize
\vspace{\baselineskip}


Change the number of minor and major divisions in the scalebar:\\
\verb+\scalebar{10cm}{3}{4}{0}{10}{m}+\\
      \scalebar{10cm}{3}{4}{0}{12}{m}
\vspace{\baselineskip}


Change the starting and ending numbers:\\
\verb+\scalebar{10cm}{4}{5}{-2}{8}{m}+\\
      \scalebar{10cm}{4}{5}{-2}{8}{m} 
\vspace{\baselineskip}

Change the units of the scalebar:\\
\verb+\scalebar{10cm}{4}{5}{0}{10}{$\mu$m}+\\
      \scalebar{10cm}{4}{5}{0}{10}{$\mu$m}
\vspace{\baselineskip}

\newpage
Use fractional values for starting and ending numbers:\\
\verb+\scalebar{10cm}{4}{6}{-0.5}{2.5}{m}+\\
      \scalebar{10cm}{4}{6}{-0.5}{2.5}{m} 
\vspace{\baselineskip}


Supress the minor divisions:\\
\verb+\scalebar{10cm}{1}{5}{0}{10}{m}+\\
      \scalebar{10cm}{1}{5}{0}{10}{m} 
\vspace{\baselineskip}


Invert the black/white bars:\\
\verb+\scalebar[inverse]{10cm}{4}{5}{0}{10}{m}+\\
      \scalebar[inverse]{10cm}{4}{5}{0}{10}{m} 
\vspace{\baselineskip}


Position a scalebar within a picture environment:
\begin{verbatim}
\setlength{\unitlength}{1mm}
\fbox{\begin{picture}(120,50)% create picture 120mm x 50mm
\put(2,11){Scale 1:200}
\put(2,7){\small\scalebar{5cm}{2}{5}{0}{10}{m}}
\end{picture}}
\end{verbatim}
\setlength{\unitlength}{1mm}
\fbox{\begin{picture}(120,50)% create picture 120mm x 50mm
\put(2,11){Scale 1:200}
\put(2,7){\small\scalebar{5cm}{2}{5}{0}{10}{m}}
\end{picture}}

\newpage
\section*{Problems}

If the length of the scalebar is longer than the page width it will break:\\
(the page width here is: \the\textwidth)\\
\verb+\scalebar{15cm}{4}{5}{0}{10}{m}+\\
\scalebar{15cm}{4}{5}{0}{10}{m}
\vspace{\baselineskip}

Several mathematical operations are performed and silly use of zero in 
some parameters will result in a mathematical error. Consult the package 
documentation for what is happening. 

Also these math calculations do seem to take 
\TeX\ quite a while to perform -- perhaps there is a way to do 
these calculations faster.

If you discover any serious problems please let me know.


\vfill

Michael Lake\\ 
\today

\end{document}