summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/shadowtext
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/shadowtext
Initial commit
Diffstat (limited to 'macros/latex/contrib/shadowtext')
-rw-r--r--macros/latex/contrib/shadowtext/README48
-rw-r--r--macros/latex/contrib/shadowtext/shadowtext.pdfbin0 -> 142989 bytes
-rw-r--r--macros/latex/contrib/shadowtext/shadowtext.sty80
-rw-r--r--macros/latex/contrib/shadowtext/shadowtext.tex248
4 files changed, 376 insertions, 0 deletions
diff --git a/macros/latex/contrib/shadowtext/README b/macros/latex/contrib/shadowtext/README
new file mode 100644
index 0000000000..afeb7642ac
--- /dev/null
+++ b/macros/latex/contrib/shadowtext/README
@@ -0,0 +1,48 @@
+Shadowtext
+
+-----------------------------------------------------------------------
+shadowtext is the original work of Yori Zwols <yz2198@columbia.edu>
+-----------------------------------------------------------------------
+
+1 - Copyright
+ ---------
+
+COPYRIGHT 2010-2012 by Yori Zwols <yz2198@columbia.edu>.
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+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.3 or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+
+2 - Introduction
+ ------------
+
+The shadowtext package introduces a new command, namely the \shadowtext
+command, which adds a drop shadow to the text that is given as its
+argument. E.g. \shadowtext{hello world} would produce the text "hello
+world" with a drop shadow. The color and positioning of the shadow are
+customizable.
+
+3 - Documentation
+ -------------
+
+Documentation is available in the form of the file shadowtext.tex.
+
+
+4 - Version History
+ ---------------
+
+v0.3: - Fixed some errors in the documentation
+ - Colors specified in \shadowcolor should now be specified using
+ color names, not RGB values. The command for specifying colors
+ using RGB values has been renamed to \shadowrgb.
+ (I apologize for the backwards incompatibility).
+ - The base line of the text is now correct.
+
+v0.2: - First public release
+
+
diff --git a/macros/latex/contrib/shadowtext/shadowtext.pdf b/macros/latex/contrib/shadowtext/shadowtext.pdf
new file mode 100644
index 0000000000..b3dee44f09
--- /dev/null
+++ b/macros/latex/contrib/shadowtext/shadowtext.pdf
Binary files differ
diff --git a/macros/latex/contrib/shadowtext/shadowtext.sty b/macros/latex/contrib/shadowtext/shadowtext.sty
new file mode 100644
index 0000000000..a6be493235
--- /dev/null
+++ b/macros/latex/contrib/shadowtext/shadowtext.sty
@@ -0,0 +1,80 @@
+%% This is file `shadowtext.sty',
+%% Copyright 2012 Yori Zwols
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% 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.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Y. Zwols.
+%
+%
+% Version history
+% v0.3: - Fixed some errors in the documentation
+% - Colors specified in \shadowcolor should now be specified using
+% color names, not RGB values. The command for specifying colors
+% using RGB values has been renamed to \shadowrgb.
+% (I apologize for the backwards incompatibility).
+% - The base line of the text is now correct.
+%
+
+\NeedsTeXFormat{LaTeX2e}[1996/12/01]
+\ProvidesPackage{shadowtext}
+ [2012/05/07 v0.3 Shadow Text]
+
+\RequirePackage{color}
+
+\makeatletter
+
+
+
+\newlength\st@shadowoffsetx
+\newlength\st@shadowoffsety
+
+\st@shadowoffsetx=1pt
+\st@shadowoffsety=1pt
+
+\newcommand\shadowoffset[1]{\setlength\st@shadowoffsetx{#1}\setlength\st@shadowoffsety{#1}}
+\newcommand\shadowoffsetx[1]{\setlength\st@shadowoffsetx{#1}}
+\newcommand\shadowoffsety[1]{\setlength\st@shadowoffsety{#1}}
+\newcommand\shadowcolor[1]{\def\st@shadowcolor{#1}}
+\newcommand\shadowrgb[1]{\definecolor{st@shadowcolorrgb}{rgb}{#1}\shadowcolor{st@shadowcolorrgb}}
+
+\shadowrgb{0.66,0.66,0.66}
+
+\newlength\st@temp@width
+\newlength\st@temp@height
+\newlength\st@pic@width
+\newlength\st@pic@height
+
+\newcommand\shadowtext[1]%
+{%
+ \begingroup%
+ \settowidth{\st@temp@width}{#1}%
+ \settoheight{\st@temp@height}{#1}%
+ \setlength{\st@pic@width}{\st@temp@width}%
+ \setlength{\st@pic@height}{\st@temp@height}%
+ \addtolength{\st@pic@width}{\st@shadowoffsetx}%
+ \addtolength{\st@pic@height}{\st@shadowoffsety}%
+ %
+ \edef\num@tw{\strip@pt\st@temp@width}%
+ \edef\num@th{\strip@pt\st@temp@height}%
+ \edef\num@pw{\strip@pt\st@pic@width}%
+ \edef\num@ph{\strip@pt\st@pic@height}%
+ \edef\num@offsetx{\strip@pt\st@shadowoffsetx}%
+ \edef\num@offsety{\strip@pt\st@shadowoffsety}%
+ \raisebox{-\st@shadowoffsety}{
+ \begin{picture}(\num@pw,\num@ph)(0,0)
+ \put(\num@offsetx,0){\makebox(\num@tw,\num@th)[tl]{\color{\st@shadowcolor}\def\color##1{}\ignorespaces #1}}
+ \put(0,\num@offsety){\makebox(\num@tw,\num@th)[tl]{\ignorespaces #1}}
+ \end{picture}}%
+ \endgroup%
+ \ignorespaces%
+}
+
+\makeatother
diff --git a/macros/latex/contrib/shadowtext/shadowtext.tex b/macros/latex/contrib/shadowtext/shadowtext.tex
new file mode 100644
index 0000000000..641d025f23
--- /dev/null
+++ b/macros/latex/contrib/shadowtext/shadowtext.tex
@@ -0,0 +1,248 @@
+%% This is file `shadowtext.tex',
+%% Copyright 2012 Yori Zwols
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% 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.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Y. Zwols.
+%
+%
+
+\documentclass{article}
+
+\usepackage{xcolor}
+\usepackage{shadowtext}
+\usepackage{multicol}
+
+\begin{document}
+\title{\bf The shadowtext package \\ \bigskip \normalfont\small Version 0.3}
+\author{Y. Zwols (yz2198@columbia.edu)}
+\maketitle
+
+\shadowoffset{1pt}
+\parindent=0pt
+\parskip=8pt
+
+\section{Usage}
+The shadowtext package introduces a new command, namely the {\tt $\backslash$shadowtext} command. This is a box
+that adds a shadow behind text. Its usage is simple. The following code and its output illustrates the usage.
+
+\begin{minipage}{\textwidth}
+\begin{multicols*}{2}
+{\footnotesize
+\begin{verbatim}
+\shadowtext{This is a shadowtext}
+\end{verbatim}}
+
+\shadowtext{This is a shadowtext}
+\end{multicols*}
+\end{minipage}
+
+\section{Changing the position of the shadow}
+The position of the shadow consists of two components: a horizontal offset and a vertical offset.
+The package offers two ways of changing the position of the shadow. The first and easiest way of
+changing the position is by using the {\tt $\backslash$setshadowoffset} command. This commands
+sets the horizontal and vertical offset simultaneously. For example:
+
+\begin{minipage}{\textwidth}
+\begin{multicols*}{2}
+{\footnotesize
+\begin{verbatim}
+\shadowoffset{2pt}
+\shadowtext{This is a shadowtext}
+\end{verbatim}}
+
+\shadowoffset{2pt}
+\shadowtext{This is a shadowtext}
+\end{multicols*}
+\end{minipage}
+
+Alternatively, one may use the commands {\tt shadowoffsetx} and {\tt shadowoffsety} to independently change
+the horizontal and vertical offset. For example:
+
+\begin{minipage}{\textwidth}
+\begin{multicols*}{2}
+{\footnotesize
+\begin{verbatim}
+\shadowoffsetx{1pt}
+\shadowoffsety{4pt}
+\shadowtext{This is a shadow text}
+\end{verbatim}}
+
+\shadowoffsetx{1pt}
+\shadowoffsety{4pt}
+\shadowtext{This is a shadow text}\\
+\phantom{}
+\end{multicols*}
+\end{minipage}
+
+\section{Changing the color of the shadow}
+The color of the shadow may be changed by using the {\tt shadowcolor} and {\tt shadowrgb} commands.\footnote{Internally, the
+package uses the {\tt $\backslash$color} command from the color package to set its color}
+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
+values. For example, the following code adds a blueish shadow using {\tt $\backslash$shadowcolor}:
+
+\begin{minipage}{\textwidth}
+\begin{multicols*}{2}
+{\footnotesize
+\begin{verbatim}
+\shadowoffset{2pt}
+\shadowcolor{blue!40!white}
+\shadowtext{This is a shadow text}
+\end{verbatim}}
+
+\shadowoffset{2pt}
+\shadowcolor{blue!40!white}
+\shadowtext{This is a shadow text}\\
+\phantom{}
+\end{multicols*}
+\end{minipage}
+
+The following code produces a red shadow using {\tt $\backslash$shadowrgb}:
+
+\begin{minipage}{\textwidth}
+\begin{multicols*}{2}
+{\footnotesize
+\begin{verbatim}
+\shadowoffset{2pt}
+\shadowrgb{1.0, 0.5, 0.5}
+\shadowtext{This is a shadow text}
+\end{verbatim}}
+
+\shadowoffset{2pt}
+\shadowrgb{1.0, 0.5, 0.5}
+\shadowtext{This is a shadow text}\\
+\phantom{}
+\end{multicols*}
+\end{minipage}
+
+\section{More examples}
+The following code illustrates how to use shadowtext in more interesting settings:
+
+\definecolor{navy}{rgb}{0,0,0.5}
+
+\begin{minipage}{\textwidth}
+\begin{multicols*}{2}
+{\footnotesize
+\begin{verbatim}
+\definecolor{navy}{rgb}{0,0,0.5}
+\shadowrgb{0.8, 0.8, 1}
+\shadowoffset{1pt}
+\shadowtext{
+ \color{navy}
+ \fontsize{16}{16}\selectfont
+ Large!}
+\end{verbatim}}
+
+\color{navy}
+\shadowrgb{0.8, 0.8, 1}
+\shadowoffset{2pt}
+\shadowtext{\fontsize{16}{16}\selectfont \textbf{Large!}}\\
+\phantom{}\\
+\phantom{}\\
+\phantom{}
+\end{multicols*}
+\end{minipage}
+
+
+\color{black}
+
+
+
+
+\begin{minipage}{\textwidth}
+\begin{multicols*}{2}
+{\footnotesize
+\begin{verbatim}
+\shadowoffset{1pt}
+\color{black}
+\shadowtext{%
+ \begin{tabular}{|l|l|}
+ \hline
+ 1 & 2 \\
+ 3 & 4 \\
+ \hline
+ \end{tabular}
+}
+\end{verbatim}}
+
+\shadowoffset{1pt}
+\shadowtext{
+ \begin{tabular}{|l|l|}
+ \hline
+ 1 & 2 \\
+ 3 & 4 \\
+ \hline
+ \end{tabular}
+}
+\phantom{}\\
+\phantom{}\\
+\phantom{}\\
+\phantom{}\\
+\phantom{}\\
+\phantom{}
+\end{multicols*}
+\end{minipage}
+
+
+
+
+
+\begin{minipage}{\textwidth}
+\begin{multicols*}{2}
+{\footnotesize
+\begin{verbatim}
+\shadowoffset{1pt}
+\shadowtext{$\sqrt{2\pi}e^{-n}$}
+\end{verbatim}}
+
+\shadowoffset{1pt}
+\shadowtext{$\sqrt{2\pi}e^{-n}$}\\
+\phantom{}
+\end{multicols*}
+\end{minipage}
+
+\color{black}
+
+\begin{minipage}{\textwidth}
+\begin{multicols*}{2}
+{\footnotesize
+\begin{verbatim}
+\shadowoffset{2pt}
+\shadowtext{
+ \color{navy}%
+ \fontencoding{T1}%
+ \fontfamily{pag}%
+ \fontseries{b}%
+ \fontsize{32}{32}%
+ \selectfont%
+ Section \color{red}\arabic{section}%
+}
+\end{verbatim}}
+
+\shadowoffset{2pt}
+\shadowtext{
+ \color{navy}%
+ \fontencoding{T1}%
+ \fontfamily{pag}%
+ \fontseries{b}%
+ \fontsize{32}{32}%
+ \selectfont%
+ Section \color{red}\arabic{section}
+}
+\phantom{}\\
+\phantom{}\\
+\phantom{}\\
+\phantom{}\\
+\end{multicols*}
+\end{minipage}
+
+
+\end{document}