diff options
author | Karl Berry <karl@freefriends.org> | 2011-12-11 22:47:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-12-11 22:47:41 +0000 |
commit | ca26f45ec466f61e5ecb17b5756dd8bc2c20be07 (patch) | |
tree | 050c69532668e7f42ddd6c03571f9f63175468aa /Master/texmf-dist/tex/latex/copyrightbox/copyrightbox.sty | |
parent | 7158919adc92478a4718547983f2acdb38911965 (diff) |
new latex package copyrightbox (11dec11)
git-svn-id: svn://tug.org/texlive/trunk@24829 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/copyrightbox/copyrightbox.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/copyrightbox/copyrightbox.sty | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/copyrightbox/copyrightbox.sty b/Master/texmf-dist/tex/latex/copyrightbox/copyrightbox.sty new file mode 100644 index 00000000000..7f413987f3e --- /dev/null +++ b/Master/texmf-dist/tex/latex/copyrightbox/copyrightbox.sty @@ -0,0 +1,87 @@ +% C O P Y R I G H T B O X . S T Y ver 0.1 (Nov 27, 2011) +% +% Copyright (C) 2010-2011 +% +% Thomas Fischer <thomas.fischer@t-fischer.net> +% and +% Ives van der Flaas <ives.vdf@gmail.com> +% +% This software is released under the terms of the LaTeX Project +% public license. +% + +\RequirePackage{tikz} +\RequirePackage{ifthen} +\usetikzlibrary{positioning} + + +%%%%% ----- Begin definitions ----- %%%%% +\newdimen\tu@tmpa% +\newdimen\CRB@ydiffl% +\newdimen\CRB@xdiffl% +\newcommand\CRB@ydiff[2]{% + \coordinate (tmpnamea) at (#1);% + \coordinate (tmpnameb) at (#2);% + \pgfextracty{\tu@tmpa}{\pgfpointanchor{tmpnamea}{center}}% + \pgfextracty{\CRB@ydiffl}{\pgfpointanchor{tmpnameb}{center}}% + \advance\CRB@ydiffl by -\tu@tmpa% +} +\newcommand\CRB@xdiff[2]{% + \coordinate (tmpnamea) at (#1);% + \coordinate (tmpnameb) at (#2);% + \pgfextractx{\tu@tmpa}{\pgfpointanchor{tmpnamea}{center}}% + \pgfextractx{\CRB@xdiffl}{\pgfpointanchor{tmpnameb}{center}}% + \advance\CRB@xdiffl by -\tu@tmpa% +} + +\newcommand{\CRB@setcopyrightfont}{% +\footnotesize +\color{black!33} +\sf +} + +\newcommand{\CRB@setcopyrightparagraphstyle}{\raggedright} + +\newcommand{\copyrightbox}[3][r]{% +\begin{tikzpicture}% +\node[inner sep=0pt,minimum size=2em](ciimage){#2}; +\CRB@setcopyrightfont +\CRB@ydiff{ciimage.south}{ciimage.north} +\CRB@xdiff{ciimage.west}{ciimage.east} +\ifthenelse{\equal{#1}{r}}{% +\node[inner sep=0pt,right=1ex of ciimage.south east,anchor=north west,rotate=90]% +{\raggedleft\parbox{\the\CRB@ydiffl}{\CRB@setcopyrightparagraphstyle{}#3}};% +}{% +\ifthenelse{\equal{#1}{l}}{% +\node[inner sep=2ex,right=1ex of ciimage.south west,anchor=south west,rotate=90] +% Separation needed to be 2ex otherwise letters like j would +% cross into the image +{\raggedleft\parbox{\the\CRB@ydiffl}{\CRB@setcopyrightparagraphstyle{}#3}};% +}{% +\node[inner sep=0pt,below=1ex of ciimage.south west,anchor=north west]% +{\raggedleft\parbox{\the\CRB@xdiffl}{\CRB@setcopyrightparagraphstyle{}#3}};% +} +} +\end{tikzpicture} +} + +\ProvidesPackage{copyrightbox}[2011/11/27 \space v 0.1] +\endinput + +%%%%% ----- End definitions ----- %%%%% + +%%%%% ----- Begin Instructions ----- %%%%% +See copyrightbox.pdf, but the short version is + +\copyrightbox[<placement>]{<image>}{<text>} + +where <placement> is either + r (Default) Text to the right of the image + l Text to the left of the image + b Text below the image + +which puts <text> positioned according to <placement> near <image>. E.g. + +\copyrightbox[l] + {\includegraphics[scale=0.5]{coin}} + {Image put in the public domain by the U.S. Mint.} |