| 1 |
%% This is file `shadowtext.tex', |
| 2 |
%% Copyright 2012 Yori Zwols |
| 3 |
% |
| 4 |
% This work may be distributed and/or modified under the |
| 5 |
% conditions of the LaTeX Project Public License, either version 1.3 |
| 6 |
% of this license or (at your option) any later version. |
| 7 |
% The latest version of this license is in |
| 8 |
% http://www.latex-project.org/lppl.txt |
| 9 |
% and version 1.3 or later is part of all distributions of LaTeX |
| 10 |
% version 2005/12/01 or later. |
| 11 |
% |
| 12 |
% This work has the LPPL maintenance status `maintained'. |
| 13 |
% |
| 14 |
% The Current Maintainer of this work is Y. Zwols. |
| 15 |
% |
| 16 |
% |
| 17 |
|
| 18 |
\documentclass{article} |
| 19 |
|
| 20 |
\usepackage{xcolor} |
| 21 |
\usepackage{shadowtext} |
| 22 |
\usepackage{multicol} |
| 23 |
|
| 24 |
\begin{document} |
| 25 |
\title{\bf The shadowtext package \\ \bigskip \normalfont\small Version 0.3} |
| 26 |
\author{Y. Zwols ([email protected])} |
| 27 |
\maketitle |
| 28 |
|
| 29 |
\shadowoffset{1pt} |
| 30 |
\parindent=0pt |
| 31 |
\parskip=8pt |
| 32 |
|
| 33 |
\section{Usage} |
| 34 |
The shadowtext package introduces a new command, namely the {\tt $\backslash$shadowtext} command. This is a box |
| 35 |
that adds a shadow behind text. Its usage is simple. The following code and its output illustrates the usage. |
| 36 |
|
| 37 |
\begin{minipage}{\textwidth} |
| 38 |
\begin{multicols*}{2} |
| 39 |
{\footnotesize |
| 40 |
\begin{verbatim} |
| 41 |
\shadowtext{This is a shadowtext} |
| 42 |
\end{verbatim}} |
| 43 |
|
| 44 |
\shadowtext{This is a shadowtext} |
| 45 |
\end{multicols*} |
| 46 |
\end{minipage} |
| 47 |
|
| 48 |
\section{Changing the position of the shadow} |
| 49 |
The position of the shadow consists of two components: a horizontal offset and a vertical offset. |
| 50 |
The package offers two ways of changing the position of the shadow. The first and easiest way of |
| 51 |
changing the position is by using the {\tt $\backslash$setshadowoffset} command. This commands |
| 52 |
sets the horizontal and vertical offset simultaneously. For example: |
| 53 |
|
| 54 |
\begin{minipage}{\textwidth} |
| 55 |
\begin{multicols*}{2} |
| 56 |
{\footnotesize |
| 57 |
\begin{verbatim} |
| 58 |
\shadowoffset{2pt} |
| 59 |
\shadowtext{This is a shadowtext} |
| 60 |
\end{verbatim}} |
| 61 |
|
| 62 |
\shadowoffset{2pt} |
| 63 |
\shadowtext{This is a shadowtext} |
| 64 |
\end{multicols*} |
| 65 |
\end{minipage} |
| 66 |
|
| 67 |
Alternatively, one may use the commands {\tt shadowoffsetx} and {\tt shadowoffsety} to independently change |
| 68 |
the horizontal and vertical offset. For example: |
| 69 |
|
| 70 |
\begin{minipage}{\textwidth} |
| 71 |
\begin{multicols*}{2} |
| 72 |
{\footnotesize |
| 73 |
\begin{verbatim} |
| 74 |
\shadowoffsetx{1pt} |
| 75 |
\shadowoffsety{4pt} |
| 76 |
\shadowtext{This is a shadow text} |
| 77 |
\end{verbatim}} |
| 78 |
|
| 79 |
\shadowoffsetx{1pt} |
| 80 |
\shadowoffsety{4pt} |
| 81 |
\shadowtext{This is a shadow text}\\ |
| 82 |
\phantom{} |
| 83 |
\end{multicols*} |
| 84 |
\end{minipage} |
| 85 |
|
| 86 |
\section{Changing the color of the shadow} |
| 87 |
The color of the shadow may be changed by using the {\tt shadowcolor} and {\tt shadowrgb} commands.\footnote{Internally, the |
| 88 |
package uses the {\tt $\backslash$color} command from the color package to set its color} |
| 89 |
The {\tt shadowcolor} command takes as an argument the name of a color, whereas {\tt shadowrgb} takes a comma-separated list of red, green, blue |
| 90 |
values. For example, the following code adds a blueish shadow using {\tt $\backslash$shadowcolor}: |
| 91 |
|
| 92 |
\begin{minipage}{\textwidth} |
| 93 |
\begin{multicols*}{2} |
| 94 |
{\footnotesize |
| 95 |
\begin{verbatim} |
| 96 |
\shadowoffset{2pt} |
| 97 |
\shadowcolor{blue!40!white} |
| 98 |
\shadowtext{This is a shadow text} |
| 99 |
\end{verbatim}} |
| 100 |
|
| 101 |
\shadowoffset{2pt} |
| 102 |
\shadowcolor{blue!40!white} |
| 103 |
\shadowtext{This is a shadow text}\\ |
| 104 |
\phantom{} |
| 105 |
\end{multicols*} |
| 106 |
\end{minipage} |
| 107 |
|
| 108 |
The following code produces a red shadow using {\tt $\backslash$shadowrgb}: |
| 109 |
|
| 110 |
\begin{minipage}{\textwidth} |
| 111 |
\begin{multicols*}{2} |
| 112 |
{\footnotesize |
| 113 |
\begin{verbatim} |
| 114 |
\shadowoffset{2pt} |
| 115 |
\shadowrgb{1.0, 0.5, 0.5} |
| 116 |
\shadowtext{This is a shadow text} |
| 117 |
\end{verbatim}} |
| 118 |
|
| 119 |
\shadowoffset{2pt} |
| 120 |
\shadowrgb{1.0, 0.5, 0.5} |
| 121 |
\shadowtext{This is a shadow text}\\ |
| 122 |
\phantom{} |
| 123 |
\end{multicols*} |
| 124 |
\end{minipage} |
| 125 |
|
| 126 |
\section{More examples} |
| 127 |
The following code illustrates how to use shadowtext in more interesting settings: |
| 128 |
|
| 129 |
\definecolor{navy}{rgb}{0,0,0.5} |
| 130 |
|
| 131 |
\begin{minipage}{\textwidth} |
| 132 |
\begin{multicols*}{2} |
| 133 |
{\footnotesize |
| 134 |
\begin{verbatim} |
| 135 |
\definecolor{navy}{rgb}{0,0,0.5} |
| 136 |
\shadowrgb{0.8, 0.8, 1} |
| 137 |
\shadowoffset{1pt} |
| 138 |
\shadowtext{ |
| 139 |
\color{navy} |
| 140 |
\fontsize{16}{16}\selectfont |
| 141 |
Large!} |
| 142 |
\end{verbatim}} |
| 143 |
|
| 144 |
\color{navy} |
| 145 |
\shadowrgb{0.8, 0.8, 1} |
| 146 |
\shadowoffset{2pt} |
| 147 |
\shadowtext{\fontsize{16}{16}\selectfont \textbf{Large!}}\\ |
| 148 |
\phantom{}\\ |
| 149 |
\phantom{}\\ |
| 150 |
\phantom{} |
| 151 |
\end{multicols*} |
| 152 |
\end{minipage} |
| 153 |
|
| 154 |
|
| 155 |
\color{black} |
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
\begin{minipage}{\textwidth} |
| 161 |
\begin{multicols*}{2} |
| 162 |
{\footnotesize |
| 163 |
\begin{verbatim} |
| 164 |
\shadowoffset{1pt} |
| 165 |
\color{black} |
| 166 |
\shadowtext{% |
| 167 |
\begin{tabular}{|l|l|} |
| 168 |
\hline |
| 169 |
1 & 2 \\ |
| 170 |
3 & 4 \\ |
| 171 |
\hline |
| 172 |
\end{tabular} |
| 173 |
} |
| 174 |
\end{verbatim}} |
| 175 |
|
| 176 |
\shadowoffset{1pt} |
| 177 |
\shadowtext{ |
| 178 |
\begin{tabular}{|l|l|} |
| 179 |
\hline |
| 180 |
1 & 2 \\ |
| 181 |
3 & 4 \\ |
| 182 |
\hline |
| 183 |
\end{tabular} |
| 184 |
} |
| 185 |
\phantom{}\\ |
| 186 |
\phantom{}\\ |
| 187 |
\phantom{}\\ |
| 188 |
\phantom{}\\ |
| 189 |
\phantom{}\\ |
| 190 |
\phantom{} |
| 191 |
\end{multicols*} |
| 192 |
\end{minipage} |
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
\begin{minipage}{\textwidth} |
| 199 |
\begin{multicols*}{2} |
| 200 |
{\footnotesize |
| 201 |
\begin{verbatim} |
| 202 |
\shadowoffset{1pt} |
| 203 |
\shadowtext{$\sqrt{2\pi}e^{-n}$} |
| 204 |
\end{verbatim}} |
| 205 |
|
| 206 |
\shadowoffset{1pt} |
| 207 |
\shadowtext{$\sqrt{2\pi}e^{-n}$}\\ |
| 208 |
\phantom{} |
| 209 |
\end{multicols*} |
| 210 |
\end{minipage} |
| 211 |
|
| 212 |
\color{black} |
| 213 |
|
| 214 |
\begin{minipage}{\textwidth} |
| 215 |
\begin{multicols*}{2} |
| 216 |
{\footnotesize |
| 217 |
\begin{verbatim} |
| 218 |
\shadowoffset{2pt} |
| 219 |
\shadowtext{ |
| 220 |
\color{navy}% |
| 221 |
\fontencoding{T1}% |
| 222 |
\fontfamily{pag}% |
| 223 |
\fontseries{b}% |
| 224 |
\fontsize{32}{32}% |
| 225 |
\selectfont% |
| 226 |
Section \color{red}\arabic{section}% |
| 227 |
} |
| 228 |
\end{verbatim}} |
| 229 |
|
| 230 |
\shadowoffset{2pt} |
| 231 |
\shadowtext{ |
| 232 |
\color{navy}% |
| 233 |
\fontencoding{T1}% |
| 234 |
\fontfamily{pag}% |
| 235 |
\fontseries{b}% |
| 236 |
\fontsize{32}{32}% |
| 237 |
\selectfont% |
| 238 |
Section \color{red}\arabic{section} |
| 239 |
} |
| 240 |
\phantom{}\\ |
| 241 |
\phantom{}\\ |
| 242 |
\phantom{}\\ |
| 243 |
\phantom{}\\ |
| 244 |
\end{multicols*} |
| 245 |
\end{minipage} |
| 246 |
|
| 247 |
|
| 248 |
\end{document} |