From dd5c634836f2baa30078beba0229fdc67906d5cc Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 13 Feb 2016 22:32:45 +0000 Subject: signchart (13feb16) git-svn-id: svn://tug.org/texlive/trunk@39707 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/signchart/signchart.dtx | 93 ++++++++++++++++------ 1 file changed, 69 insertions(+), 24 deletions(-) (limited to 'Master/texmf-dist/source/latex/signchart') diff --git a/Master/texmf-dist/source/latex/signchart/signchart.dtx b/Master/texmf-dist/source/latex/signchart/signchart.dtx index 2c0f683ff76..a450128960d 100644 --- a/Master/texmf-dist/source/latex/signchart/signchart.dtx +++ b/Master/texmf-dist/source/latex/signchart/signchart.dtx @@ -4,7 +4,7 @@ % %<*readme> ---------------------------------------------------------------- -signchart --- v1.0 +signchart --- v1.01 2016/02/12 E-mail: anthonywmottaz@gmail.com Released under the LaTeX Project Public License v1.3c or later See http://www.latex-project.org/lppl.txt @@ -92,7 +92,7 @@ and the derived files signchart.ins, % %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{signchart}[2016/01/29 v1.0 First release] +\ProvidesPackage{signchart}[2016/02/12 v1.01] % %<*driver> \documentclass{ltxdoc} @@ -100,6 +100,8 @@ and the derived files signchart.ins, \usepackage{lmodern} \usepackage{\jobname} \usepackage[numbered]{hypdoc} +\usepackage{fancyvrb} +\usepackage{microtype} \EnableCrossrefs \CodelineIndex \RecordChanges @@ -109,7 +111,7 @@ and the derived files signchart.ins, % % \fi % -% \CheckSum{0} +% \CheckSum{166} % %\GetFileInfo{\jobname.sty} % @@ -121,7 +123,7 @@ and the derived files signchart.ins, %\DoNotIndex{\newcommand,\relax} % %\title{^^A -% The \textsf{signchart} Package\thanks{^^A +% The \textsf{signchart} package\thanks{^^A % This file describes version \fileversion, last revised \filedate.^^A % }^^A %} @@ -135,7 +137,6 @@ and the derived files signchart.ins, %\abstract{The signchart package provides you with the ability to create %beautifully typeset sign charts.} % -%\changes{v1.0}{2016/01/29}{First public release} % % %\section{Introduction} @@ -152,14 +153,30 @@ and the derived files signchart.ins, %them on a number line. % % -%\section{Future Development Goals} -% -%\begin{itemize} -%\item Create option for placing \meta{values} or \meta{signs} underneath -%the number line. -%\end{itemize} % %\section{Usage} +%\subsection{Load the package} +% +%Load the package: +%\begin{Verbatim}[gobble=1] +% \usepackage\oarg{options}{signchart} +%\end{Verbatim} +% +%Currently, there are two options that can be called when loading the +%|signchart| package. +% +%\DescribeMacro{signunder} +%Loading the package with this option will cause the signs to be placed below +%the sign chart. This is achieved by changing the default value of +%\texttt{height} to \texttt{$-0.3$}. \emph{(See macro options below)} +% +%\DescribeMacro{valunder} +%Loading the package with this option will cause the values to be placed below +%the sign chart. This is achieved by changing the default anchor position of +%the values from \texttt{south} to \texttt{north}. \emph{(See macro options +%below)} +% +%\subsection{Macros} % %\DescribeMacro{signchart} %|\signchart|\oarg{optons}\marg{values}\marg{signs} \quad The |\signchart| @@ -167,23 +184,37 @@ and the derived files signchart.ins, %with \meta{values} placed over each tick mark and \meta{signs} placed %between each value. % -%This command takes two arguments along with a few optional key-value -%options. For the \meta{value} argument, the user should enter the values +%\DescribeMacro{\meta{values}} +%For the \meta{values} argument, the user should enter the values %that will be placed above the tick marks in a comma separated list. +% +%\DescribeMacro{\meta{signs}} %For the \meta{signs} argument, the user should enter the signs that will -%be placed between each of the \meta{values}. \textbf{It is important to -%note} that the number of signs should be at most one more than the number -%of values. Any additional signs will give undesired results. +%be placed between each of the \meta{values}, also in a comma separated list. +%\textbf{It is important to note} that the number of signs should be at most +%one more than the number of values. Any additional signs will be considered as +%one sign and give undesired results. % +%\DescribeMacro{\oarg{options}} %The width, placement of -%\meta{signs}, and the arrows can be adjusted with +%\meta{values} and \meta{signs}, and the arrows can be adjusted with %\meta{options}. -% %\DescribeMacro{width} %The option \meta{width}=\meta{number} can be used to specify the width of %the sign chart using the default \texttt{tikzpicture} units (cm). If no %option is given, then \meta{width}\texttt{= 5} is used. % +%\DescribeMacro{valanchor} +%This macro can change the anchor for placing the \meta{values}. By default, +%this is set to \texttt{south} in order to place the \meta{values} above the +%number line. The other possibility is to set \texttt{valanchor=north}. +% +%\DescribeMacro{valsep} +%This macro controls the separation distance from the \meta{values} to the +%number line. By default, this is set to \texttt{3pt}. When the option +%\texttt{valunder} is passed to the package, this is redefined to \texttt{13pt} +%to achieve a similar distance underneath the number line. +% %\DescribeMacro{height} %The option \meta{height}=\meta{number} can be used to specify the distance %between the number line and the signs using the default \texttt{tikzpicture} @@ -194,6 +225,9 @@ and the derived files signchart.ins, %head shape used on the number line. If no option is given, then %\meta{arrows}\texttt{= <->} is used. % +%\changes{v1.0}{2016/01/29}{First public release} +%\changes{v1.01}{2016/02/12}{Improved Documentation, addition of package +%options} %\StopEventually{^^A % \PrintChanges % \PrintIndex @@ -206,22 +240,31 @@ and the derived files signchart.ins, % \end{macrocode} % % -%\changes{v1.0}{2009/10/06}{Some change from the previous version} % \begin{macrocode} \RequirePackage{tikz} \RequirePackage{pgfplots} \pgfplotsset{compat = 1.10} \RequirePackage{xstring} \RequirePackage{xkeyval} -\DeclareOption*{\PackageWarning{examplepackage}{Unknown option `\CurrentOption'. - This package does not accept any options.}} +\def\signHeightKey{0.3} +\def\valNorthSouthKey{south} +\def\valSepKey{3pt} +\DeclareOption{signunder}{\def\signHeightKey{-0.3}} +\DeclareOption{valunder}{% +\def\valNorthSouthKey{north}% +\def\valSepKey{13pt}} +\DeclareOption*{% +\PackageWarning{signchart}{Unknown option ‘\CurrentOption’}% +} \ProcessOptions\relax -\define@key{signchart}{height}[0.3]{\def\signHeight{#1}} +\define@key{signchart}{height}[\signHeightKey]{\def\signHeight{#1}} +\define@key{signchart}{valanchor}[\valNorthSouthKey]{\def\valNorthSouth{#1}} +\define@key{signchart}{valsep}[\valSepKey]{\def\valSep{#1}} \define@key{signchart}{width}[5]{\def\signChartWidth{#1}} \define@key{signchart}{arrows}[<->]{\def\theArrow{#1}} \makeatother \newcommand{\signchart}[3][]{ -\setkeys{signchart}{height, width, arrows, #1} +\setkeys{signchart}{height, valanchor, valsep, width, arrows, #1} \begin{center} \begin{tikzpicture} \pgfmathsetmacro{\snht}{\signHeight} @@ -253,7 +296,9 @@ and the derived files signchart.ins, \StrBehind[\j]{,\leftPartii}{,}[\s] \pgfmathsetmacro{\valpos}{(\wid/(\len+2))*(\i+1)} \pgfmathsetmacro{\signpos}{(\wid/(\len+2))*(\i+0.5)} - \draw (\valpos,-0.15) -- (\valpos,0.15) node[anchor=south] {\thisVal}; + \draw (\valpos,-0.15) -- (\valpos,0.15) node[anchor=\valNorthSouth, + inner sep=\valSep] + {\thisVal}; \node at (\signpos,\snht) {$\s$}; \ifnum \i = \len \pgfmathsetmacro{\signpos}{(\wid/(\len+2))*(\len+1.5)} -- cgit v1.2.3