From 54cfbffe63a3055a3a42d556f8de243ada39b588 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 30 Dec 2014 17:17:01 +0000 Subject: xprintlen (27dec14) git-svn-id: svn://tug.org/texlive/trunk@35928 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/xprintlen/LICENSE | 5 ++ Master/texmf-dist/doc/latex/xprintlen/README | 53 ++++++++++++++ Master/texmf-dist/doc/latex/xprintlen/ex01.png | Bin 0 -> 32132 bytes .../texmf-dist/doc/latex/xprintlen/xprintlen.pdf | Bin 0 -> 109654 bytes .../texmf-dist/doc/latex/xprintlen/xprintlen.tex | 77 +++++++++++++++++++++ .../texmf-dist/tex/latex/xprintlen/xprintlen.sty | 34 +++++++++ Master/tlpkg/bin/tlpkg-ctan-check | 2 +- Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc | 1 + Master/tlpkg/tlpsrc/xprintlen.tlpsrc | 0 9 files changed, 171 insertions(+), 1 deletion(-) create mode 100644 Master/texmf-dist/doc/latex/xprintlen/LICENSE create mode 100644 Master/texmf-dist/doc/latex/xprintlen/README create mode 100644 Master/texmf-dist/doc/latex/xprintlen/ex01.png create mode 100644 Master/texmf-dist/doc/latex/xprintlen/xprintlen.pdf create mode 100644 Master/texmf-dist/doc/latex/xprintlen/xprintlen.tex create mode 100644 Master/texmf-dist/tex/latex/xprintlen/xprintlen.sty create mode 100644 Master/tlpkg/tlpsrc/xprintlen.tlpsrc diff --git a/Master/texmf-dist/doc/latex/xprintlen/LICENSE b/Master/texmf-dist/doc/latex/xprintlen/LICENSE new file mode 100644 index 00000000000..136054bcdbb --- /dev/null +++ b/Master/texmf-dist/doc/latex/xprintlen/LICENSE @@ -0,0 +1,5 @@ +Released under the [LaTeX Project Public +License](http://www.latex-project.org/lppl.txt), v1.3c or later. + +The package has status 'maintained': the current maintainer is +[Liam Huang](liamhuang0205+xprintlen@gmail.com). diff --git a/Master/texmf-dist/doc/latex/xprintlen/README b/Master/texmf-dist/doc/latex/xprintlen/README new file mode 100644 index 00000000000..d40a8cdaa26 --- /dev/null +++ b/Master/texmf-dist/doc/latex/xprintlen/README @@ -0,0 +1,53 @@ + ========================= + The xprintlen Package + ========================= + + +Introduction +------------ + +This package defines a command, \printlen, to print lengths +in a variety of units. + +This work is released under the LaTeX Project Public License, +v1.3c or later. See the License file. + +Installation +------------ + +This package consists of the files xprintlen.sty, + xprintlen.tex, + xprintlen.pdf, + ex01.png, + README, + LICENSE. + +* Copy the files into proper directories searched by TeX. + TDS tree: + + TEXMF/doc/latex/xprintlen/xprintlen.tex + TEXMF/doc/latex/xprintlen/xprintlen.pdf + TEXMF/doc/latex/xprintlen/ex01.png + TEXMF/doc/latex/xprintlen/README + TEXMF/doc/latex/xprintlen/LICENSE + TEXMF/tex/latex/xprintlen/xprintlen.sty + +* Run texhash to refresh file name data base. + +Basic Usage +----------- + +You can read the PDF document for detailed explanations. + +Author +------ + +Liam Huang + +Email: liamhuang0205+xprintlen@gmail.com + +If you are interested in the process of development you may observe + + https://github.com/LiamHuang0205/xprintlen + +--- end of README --- diff --git a/Master/texmf-dist/doc/latex/xprintlen/ex01.png b/Master/texmf-dist/doc/latex/xprintlen/ex01.png new file mode 100644 index 00000000000..8b5ab48abfc Binary files /dev/null and b/Master/texmf-dist/doc/latex/xprintlen/ex01.png differ diff --git a/Master/texmf-dist/doc/latex/xprintlen/xprintlen.pdf b/Master/texmf-dist/doc/latex/xprintlen/xprintlen.pdf new file mode 100644 index 00000000000..b657f7c50cd Binary files /dev/null and b/Master/texmf-dist/doc/latex/xprintlen/xprintlen.pdf differ diff --git a/Master/texmf-dist/doc/latex/xprintlen/xprintlen.tex b/Master/texmf-dist/doc/latex/xprintlen/xprintlen.tex new file mode 100644 index 00000000000..827fddfe5fb --- /dev/null +++ b/Master/texmf-dist/doc/latex/xprintlen/xprintlen.tex @@ -0,0 +1,77 @@ +%% +%% This is file `xprintlen.tex', +%% part of the package xprintlen. +%% +%% Copyright (C) 2014 by Liam Huang +%% -------------------------------------------------------------------------- +%% 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. +%% +%!TEX option = -shell-escape +%!TEX builder = latexmk +\documentclass{article} +\title{\bfseries The \textsf{xprintlen} package\thanks{This manual corresponds to \textsf{xprintlen.sty} v1.0, dated 2014/12/25}{\hspace{6pt}}\thanks{This work is released under the LaTeX Project Public +License (\url{http://www.latex-project.org/lppl.txt}), v1.3c or later.}} +\author{Liam Huang\thanks{\url{http://liam0205.me/}, \href{mailto:liamhuang0205+xprintlen@gmail.com}{liamhuang0205+xprintlen@gmail.com}}} +\date{2014/12/25} +\usepackage{mathpazo} +\usepackage{minted} +\usepackage{graphicx} +\usepackage{hyperref} +\hypersetup{hidelinks} +\usepackage{geometry} +\geometry{letterpaper, top = 1in, bottom = 1in} + +\begin{document} +\maketitle + +\section{Requirements} + +\textsf{xprintlen} requires the package \textsf{fp} to be available and reasonably up to date on your system. + +\section{Installation} + +Put the \textsf{.sty} file into the folder \texttt{TEXMF/tex/latex/xprintlen}, and put other files into another folder \texttt{TEXMF/doc/latex/xprintlen}. Run \texttt{texhash} to refresh the file name data base. + +\section{Usage} + +This package defines a command, \verb|\printlen|, to print lengths in a variety of units. It supports all the units that \TeX{} supports, and its calculation depends on the package \textsf{fp}. + +\verb|\printlen| recieves three parameters, while the first two parameters are the optionals. The first (optional) parameter sets the length of significant digits, whose default value is $ 2 $, stored in the marco \verb|\defaultsignificant|. The second (optional) parameter sets the unit to be print, and the default value of it is \texttt{mm}, stored in the marco \verb|\defaultunit|. The third parameter of the command, also the only mandatory parameter, is the length that will be calculated. + +You can redefine the two marcos to revise the default length of significant digits and/or the default unit. + +\section{Example} + +\noindent\begin{minipage}[b]{0.55\linewidth} +The following lines will produce: + +\begin{minted}{latex} +\documentclass{article} +\usepackage{xprintlen} +\newlength{\testlen} +\setlength{\testlen}{3.1415926cm} +\begin{document} +\obeylines +\printlen{\testlen} +\printlen[5]{\testlen} +\printlen[5][pt]{\testlen} +\end{document} +\end{minted} +\end{minipage}% +\begin{minipage}[b]{0.45\linewidth} +\includegraphics[scale = 0.6]{ex01} +\end{minipage} + +\section{Change log} + +\subsection*{Version 1.0, 2014/12/25} +\begin{itemize} + \item The first public release. +\end{itemize} +\end{document} diff --git a/Master/texmf-dist/tex/latex/xprintlen/xprintlen.sty b/Master/texmf-dist/tex/latex/xprintlen/xprintlen.sty new file mode 100644 index 00000000000..ec7cccf2df6 --- /dev/null +++ b/Master/texmf-dist/tex/latex/xprintlen/xprintlen.sty @@ -0,0 +1,34 @@ +%% +%% This is file `xprintlen.sty', +%% part of the package xprintlen. +%% +%% Copyright (C) 2014 by Liam Huang +%% -------------------------------------------------------------------------- +%% 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. +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{xprintlen}[2014/12/25 v1.0 print lengths with units] +\RequirePackage{fp} +\newlength{\CMarg} +\newlength{\CMunit} +\newcommand{\CMspace}{\,} +\newcommand{\defaultunit}{mm} +\newcommand{\defaultsignificant}{2} +\newcommand*{\printlen}[1][\defaultsignificant]{% + \providecommand{\printlenFirstParameter}{}% + \renewcommand{\printlenFirstParameter}{#1}% + \printlenCalculate% +} +\newcommand*{\printlenCalculate}[2][\defaultunit]{% + \setlength{\CMunit}{1#1}% + \setlength{\CMarg}{#2}% + \FPdiv\CMres{\strip@pt\CMarg}{\strip@pt\CMunit}% + \FPround\CMres\CMres{\printlenFirstParameter}% + \CMres\CMspace\texttt{#1}% +} diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index de7df415fda..1a0cba766ca 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -556,7 +556,7 @@ my @TLP_working = qw( xetexref xevlna xfor xgreek xhfill xii xifthen xint xits xkeyval xlop xltxtra xmltex xmpincl xnewcommand - xoptarg xpatch xpeek xpicture xpinyin xpunctuate + xoptarg xpatch xpeek xpicture xpinyin xprintlen xpunctuate xq xskak xstring xtab xunicode xwatermark xyling xymtex xypic xypic-tut-pt xytree yafoot yagusylo yannisgr yathesis yax ydoc yfonts yhmath diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc index e3517a093d7..7b542ee6e89 100644 --- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc @@ -964,6 +964,7 @@ depend xnewcommand depend xoptarg depend xpatch depend xpeek +depend xprintlen depend xpunctuate depend xstring depend xwatermark diff --git a/Master/tlpkg/tlpsrc/xprintlen.tlpsrc b/Master/tlpkg/tlpsrc/xprintlen.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d -- cgit v1.2.3