From f98f780b355bb279f2b6bec1e027ab0d34759000 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 30 Jan 2016 23:02:34 +0000 Subject: signchart (30jan16) git-svn-id: svn://tug.org/texlive/trunk@39516 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/signchart/signchart.dtx | 274 +++++++++++++++++++++ .../source/latex/signchart/signchart.ins | 71 ++++++ 2 files changed, 345 insertions(+) create mode 100644 Master/texmf-dist/source/latex/signchart/signchart.dtx create mode 100644 Master/texmf-dist/source/latex/signchart/signchart.ins (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/signchart/signchart.dtx b/Master/texmf-dist/source/latex/signchart/signchart.dtx new file mode 100644 index 00000000000..2c0f683ff76 --- /dev/null +++ b/Master/texmf-dist/source/latex/signchart/signchart.dtx @@ -0,0 +1,274 @@ +% \iffalse meta-comment +%<*internal> +\iffalse +% +%<*readme> +---------------------------------------------------------------- +signchart --- v1.0 +E-mail: anthonywmottaz@gmail.com +Released under the LaTeX Project Public License v1.3c or later +See http://www.latex-project.org/lppl.txt +---------------------------------------------------------------- + +The signchart package provides you with the ability to create +beautifully typeset sign charts. + +Refer to the documentation for usage instructions. Suggestions +for improvement can be sent to the email address above. + +------------------ INSTALLATION INSTRUCTIONS ------------------- +Copy the 'signchart.dtx' file to a temporary location, then +from a terminal run the following command twice: + pdflatex signchart.dtx +Then we need to create the index. Run the command: + makeindex -s gind.ist signchart +and then run pdflatex twice more. + +Finally, you need to move the 'signchart.sty' to folders that +are searched by your TeX distribution. +---------------------------------------------------------------- +% +%<*internal> +\fi +\def\nameofplainTeX{plain} +\ifx\fmtname\nameofplainTeX\else + \expandafter\begingroup +\fi +% +%<*install> +\input docstrip.tex +\keepsilent +\askforoverwritefalse +\preamble +---------------------------------------------------------------- +signchart --- Create beautiful sign charts. +E-mail: anthonywmottaz@gmail.com +Released under the LaTeX Project Public License v1.3c or later +See http://www.latex-project.org/lppl.txt +---------------------------------------------------------------- + +\endpreamble +\postamble + +Copyright (C) 2016 by Anthony Mottaz + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License (LPPL), either +version 1.3c of this license or (at your option) any later +version. The latest version of this license is in the file: + +http://www.latex-project.org/lppl.txt + +This work is "maintained" (as per LPPL maintenance status) by +You. + +This work consists of the file signchart.dtx +and the derived files signchart.ins, + signchart.pdf and + signchart.sty. + +\endpostamble +\usedir{tex/latex/signchart} +\generate{ + \file{\jobname.sty}{\from{\jobname.dtx}{package}} +} +% +%\endbatchfile +%<*internal> +\usedir{source/latex/signchart} +\generate{ + \file{\jobname.ins}{\from{\jobname.dtx}{install}} +} +\nopreamble\nopostamble +\usedir{doc/latex/signchart} +\generate{ + \file{README.txt}{\from{\jobname.dtx}{readme}} +} +\ifx\fmtname\nameofplainTeX + \expandafter\endbatchfile +\else + \expandafter\endgroup +\fi +% +%<*package> +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{signchart}[2016/01/29 v1.0 First release] +% +%<*driver> +\documentclass{ltxdoc} +\usepackage[T1]{fontenc} +\usepackage{lmodern} +\usepackage{\jobname} +\usepackage[numbered]{hypdoc} +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\begin{document} + \DocInput{\jobname.dtx} +\end{document} +% +% \fi +% +% \CheckSum{0} +% +%\GetFileInfo{\jobname.sty} +% +%\DoNotIndex{\if,\fi,\else,\ifnum} +%\DoNotIndex{\begin,\end,\def,\let,\foreach,\i,\j,\k,\s} +%\DoNotIndex{\pgfmathsetmacro,\pgfmathtruncatemacro} +%\DoNotIndex{\pgfplotsset,\makeatletter,\makeatother} +%\DoNotIndex{\CurrentOption,\DeclareOption,\define@key} +%\DoNotIndex{\newcommand,\relax} +% +%\title{^^A +% The \textsf{signchart} Package\thanks{^^A +% This file describes version \fileversion, last revised \filedate.^^A +% }^^A +%} +%\author{^^A +% Anthony Mottaz\thanks{E-mail: anthonywmottaz@gmail.com}^^A +%} +%\date{Released \filedate} +% +%\maketitle +% +%\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} +% +%The \texttt{signchart} package provides the command +%\begin{center} +%|\signchart|\oarg{options}\marg{values}\marg{signs} +%\end{center} +%for typesetting sign charts. For example, +%|\signchart{1,2,3}{+,-,+,-}| will produce +%\signchart{1,2,3}{+,-,+,-} +%This process is achieved using the \texttt{tikz} and \texttt{xstring} +%packages to extract the \meta{values} and \meta{signs} and place +%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} +% +%\DescribeMacro{signchart} +%|\signchart|\oarg{optons}\marg{values}\marg{signs} \quad The |\signchart| +%command produces a signchart---a number line with evenly spaced ticks, +%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 +%that will be placed above the tick marks in a comma separated list. +%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. +% +%The width, placement of +%\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{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} +%units (cm). If no option is given, then \meta{height}\texttt{= 0.3} is used. +% +%\DescribeMacro{arrows} +%The option \meta{arrows}=\meta{arrow style} can be used to specify the arrow +%head shape used on the number line. If no option is given, then +%\meta{arrows}\texttt{= <->} is used. +% +%\StopEventually{^^A +% \PrintChanges +% \PrintIndex +%} +% +%\section{Implementation} +% +% \begin{macrocode} +%<*package> +% \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.}} +\ProcessOptions\relax +\define@key{signchart}{height}[0.3]{\def\signHeight{#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} +\begin{center} +\begin{tikzpicture} +\pgfmathsetmacro{\snht}{\signHeight} +\pgfmathsetmacro{\wid}{\signChartWidth} +\def\vals{#2} +\def\signs{#3} +\def\valsarray{{\vals}} +\StrCount{\vals}{,}[\len] +\draw[\theArrow,thick] (0,0) -- (\wid,0); +\def\thisVal{-0} +\foreach \i in {0,...,\len} { + \pgfmathtruncatemacro{\k}{\i + 1} + \ifnum \i < \len + \StrPosition[\k]{\vals}{,}[\pos] + \StrBefore[\k]{\vals}{,}[\leftParti] + \ifnum \i = 0 + \def\thisVal{\leftParti} + \else + \StrBehind[\i]{\leftParti}{,}[\thisVal] + \fi + \else + \StrBehind[\i]{\vals}{,}[\thisVal] + \fi + \pgfmathtruncatemacro{\j}{\i + 1} + \StrBehind[\j]{\signs}{,}[\rightPart] + \StrLen{\rightPart}[\aLength] + \pgfmathtruncatemacro{\cutAmount}{\aLength + 1} + \StrGobbleRight{\signs}{\cutAmount}[\leftPartii] + \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}; + \node at (\signpos,\snht) {$\s$}; + \ifnum \i = \len + \pgfmathsetmacro{\signpos}{(\wid/(\len+2))*(\len+1.5)} + \pgfmathtruncatemacro{\j}{\len + 1} + \StrBehind[\j]{\signs}{,}[\s] + \node at (\signpos,\snht) {$\s$}; + \fi + } +\end{tikzpicture} +\end{center} +} +% \end{macrocode} +% +% +% \begin{macrocode} +% +% \end{macrocode} +%\Finale diff --git a/Master/texmf-dist/source/latex/signchart/signchart.ins b/Master/texmf-dist/source/latex/signchart/signchart.ins new file mode 100644 index 00000000000..85f2b5e7050 --- /dev/null +++ b/Master/texmf-dist/source/latex/signchart/signchart.ins @@ -0,0 +1,71 @@ +%% +%% This is file `signchart.ins', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% signchart.dtx (with options: `install') +%% ---------------------------------------------------------------- +%% signchart --- Create beautiful sign charts. +%% E-mail: anthonywmottaz@gmail.com +%% Released under the LaTeX Project Public License v1.3c or later +%% See http://www.latex-project.org/lppl.txt +%% ---------------------------------------------------------------- +%% +\input docstrip.tex +\keepsilent +\askforoverwritefalse +\preamble +---------------------------------------------------------------- +signchart --- Create beautiful sign charts. +E-mail: anthonywmottaz@gmail.com +Released under the LaTeX Project Public License v1.3c or later +See http://www.latex-project.org/lppl.txt +---------------------------------------------------------------- + +\endpreamble +\postamble + +Copyright (C) 2016 by Anthony Mottaz + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License (LPPL), either +version 1.3c of this license or (at your option) any later +version. The latest version of this license is in the file: + +http://www.latex-project.org/lppl.txt + +This work is "maintained" (as per LPPL maintenance status) by +You. + +This work consists of the file signchart.dtx +and the derived files signchart.ins, + signchart.pdf and + signchart.sty. + +\endpostamble +\usedir{tex/latex/signchart} +\generate{ + \file{\jobname.sty}{\from{\jobname.dtx}{package}} +} +\endbatchfile +%% +%% Copyright (C) 2016 by Anthony Mottaz +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License (LPPL), either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in the file: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This work is "maintained" (as per LPPL maintenance status) by +%% You. +%% +%% This work consists of the file signchart.dtx +%% and the derived files signchart.ins, +%% signchart.pdf and +%% signchart.sty. +%% +%% +%% End of file `signchart.ins'. -- cgit v1.2.3