texlive[50984] Master: rulerbox (18apr19)
commits+karl at tug.org
commits+karl at tug.org
Sat May 4 23:12:54 CEST 2019
Revision: 50984
http://tug.org/svn/texlive?view=revision&revision=50984
Author: karl
Date: 2019-05-04 23:12:54 +0200 (Sat, 04 May 2019)
Log Message:
-----------
rulerbox (18apr19)
Modified Paths:
--------------
trunk/Master/tlpkg/bin/tlpkg-ctan-check
trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/rulerbox/
trunk/Master/texmf-dist/doc/latex/rulerbox/README.md
trunk/Master/texmf-dist/doc/latex/rulerbox/rulerbox.pdf
trunk/Master/texmf-dist/doc/latex/rulerbox/rulerbox.tex
trunk/Master/texmf-dist/tex/latex/rulerbox/
trunk/Master/texmf-dist/tex/latex/rulerbox/rulerbox.sty
trunk/Master/tlpkg/tlpsrc/rulerbox.tlpsrc
Added: trunk/Master/texmf-dist/doc/latex/rulerbox/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/rulerbox/README.md (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/rulerbox/README.md 2019-05-04 21:12:54 UTC (rev 50984)
@@ -0,0 +1,36 @@
+rulerbox
+=======
+
+`rulerbox` is a LaTeX package for drawing rulers around a box. This might be useful when showing the absolute size of something in electronic documents, or designating the relative scale in printed materials.
+
+Contributing
+------------
+
+This package is developed and maintained by Yuchang Yang < yang.yc.allium at gmail.com >.
+
+Discussions and questions are welcome.
+
+Copyright and Licence
+---------------------
+
+ Copyright (C) 2019 by Yuchang Yang < yang.yc.allium at gmail.com >
+ ----------------------------------------------------------------------
+
+ This work may be distributed and/or modified under the
+ conditions of the LaTeX Project Public License, either
+ version 1.3c of this license or (at your option) any later
+ version. This version of this license is in
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+ and 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 Yuchang Yang.
+
+ This work consists of the files rulerbox.sty,
+ rulerbox.tex,
+ rulerbox.pdf, and
+ README.md.
Property changes on: trunk/Master/texmf-dist/doc/latex/rulerbox/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/rulerbox/rulerbox.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/rulerbox/rulerbox.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/rulerbox/rulerbox.pdf 2019-05-04 21:12:17 UTC (rev 50983)
+++ trunk/Master/texmf-dist/doc/latex/rulerbox/rulerbox.pdf 2019-05-04 21:12:54 UTC (rev 50984)
Property changes on: trunk/Master/texmf-dist/doc/latex/rulerbox/rulerbox.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/rulerbox/rulerbox.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/rulerbox/rulerbox.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/rulerbox/rulerbox.tex 2019-05-04 21:12:54 UTC (rev 50984)
@@ -0,0 +1,104 @@
+%% rulerbox.tex
+%% Copyright 2019 Yuchang Yang < yang.yc.allium at gmail.com >
+%
+% 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 Yuchang Yang.
+%
+% This work consists of the files rulerbox.sty, rulerbox.tex and
+% the generated manual file rulerbox.pdf.
+
+\documentclass[a4paper,11pt]{article}
+
+\usepackage{rulerbox}
+\usepackage{fontspec}
+\usepackage{color}
+\definecolor{darkmiku}{RGB}{19, 149, 139}
+
+\newdimen\sidelength
+ \sidelength=2cm
+\newdimen\boxkern
+ \boxkern=2mm
+\newdimen\mydimen
+\mydimen=\sidelength
+\advance\mydimen-.8pt
+
+\def\lan{\ensuremath{\langle}}
+\def\ran{\ensuremath{\rangle}}
+\def\param#1{\textrm{\lan\textit{#1}\ran}}
+\def\texttt#1{{\ttfamily\color{darkmiku}#1}}
+\def\cbox#1{\rulerbox[#1]{\ooalign{%
+ \rule{\sidelength}{\sidelength}\cr
+ \hidewidth\raisebox{.4pt}{\color{white}\rule{\mydimen}{\mydimen}}\hidewidth\cr
+ \hidewidth\vbox to \sidelength{\vss\hbox to \sidelength{\hss\texttt{[#1]}\hss}\vss}\hidewidth\cr
+ }}}
+
+\title{\hspace*{1cm}The \textsf{rulerbox} package\footnotemark[1]\hspace*{1cm}}
+\author{Yuchang \textsc{Yang}{\fontspec{SimSun}(杨宇昌)\kern-5pt\footnotemark[2]}}
+\date{April 18\textsuperscript{th}, 2019\qquad ver.~1.01}
+
+\begin{document}
+
+\parskip=1ex
+
+\begin{centering}
+ \vspace*{-2em}
+ \rulersep=5pt
+ \rulerwidth=5mm
+ \let\newpage\relax
+ \rulerbox{\parbox{.7\linewidth}{\vspace*{-2em}\maketitle\vspace*{-1.5em}}}\par
+ \vskip1.5em
+ \def\thefootnote{\fnsymbol{footnote}}
+ \footnotetext[1]{Github repository: \texttt{https://github.com/Mikumikunisiteageru/rulerbox}}
+ \footnotetext[2]{Email address: \texttt{yang.yc.allium at gmail.com}}
+\end{centering}
+
+\section{Introduction}
+ \textsf{rulerbox} is an independent \LaTeX\ package providing macro \texttt{\string\rulerbox}, which draws rulers along edges of an object, in the following style:\par
+ \vskip-1mm
+ \centerline{{\rulersep=-.4pt\rulerwidth=5mm\rulerbox[b]{\rule{10cm}{0pt}}}}
+ \smallskip
+ This might be useful when showing the absolute size of something in electronic documents, or designating the relative scale in printed materials.
+
+\section{Usage}
+
+% \subsection{Basic syntax}
+ \texttt{\string\rulerbox\{\param{content}\}} somewhat resembles the macro \texttt{\string\fbox\{\param{content}\}} defined by \LaTeX. The one mandatory parameter that they receive is the content to be wrapped inside a box. Then \texttt{\string\rulerbox} decorates the box edges with rulers, whereas \texttt{\string\fbox} frames the box by solid lines. Neither of them affects the vertical alignment.\par
+ \medskip
+ \centerline{\fontsize{50}{50}\selectfont ra\rulerbox{g}ge\fbox{d}ri\fbox{g}\rulerbox{h}t}
+
+\subsection{Edge selection}
+ \texttt{\string\rulerbox[\param{edges}]\{\param{content}\}} also accepts an optional parameter, telling \LaTeX{} which edges to be decorated with rulers. \texttt{\param{edges}} is any subset of \texttt{t}, \texttt{b}, \texttt{l}, and \texttt{r}, controlling the top, bottom, left, and right edges respectively. So \texttt{\string\rulerbox[tblr]\{\param{content}\}} behaves identically the same as \texttt{\string\rulerbox\{\param{content}\}} (unless default switches are turned off, see below), while \texttt{\string\rulerbox[]\{\param{content}\}} regresses to \texttt{\string\hbox\{\param{content}\}}.\par
+ \medskip
+ \centerline{\vbox{%
+ \hbox{\cbox{tl}\kern\boxkern\cbox{t}\kern\boxkern\cbox{tr}}%
+ \nointerlineskip\kern\boxkern
+ \hbox{\cbox{l}\kern\boxkern\cbox{}\kern\boxkern\cbox{r}}%
+ \nointerlineskip\kern\boxkern
+ \hbox{\cbox{bl}\kern\boxkern\cbox{b}\kern\boxkern\cbox{br}}%
+ }}
+ \smallskip
+ Default status of each edge can be set separately and globally by switching \texttt{\textbackslash ifrulertop}, \texttt{\textbackslash ifrulerbottom}, \texttt{\textbackslash ifrulerleft}, and \texttt{\textbackslash ifrulerright}. For example, \texttt{\string\rulerleftfalse} suppresses all left rulers (except required explicitly by \texttt{\param{edges}}), until a \texttt{\string\rulerlefttrue} is seen.\par
+
+\subsection{Dimensions}
+ Four dimensions are involved in the \textsf{rulerbox} package. They can be redefined locally by \texttt{\param{dimen name}=\param{dimen express}\string\relax} in \TeX\ style, or globally by \texttt{\string\setlength\{\param{dimen name}\}\{\param{dimen express}\}} in \LaTeX\ style.
+ \begin{itemize}
+ \item \texttt{\string\rulerunit}: The \textsl{least count} of rulers, \textit{i.e.}\ distance between adjacent ticks in rulers. Default is \texttt{1mm}, one millimetre, which produces rulers of metric length system. \texttt{\string\rulerunit} may be redefined to adapt to other \textsl{decimal} length systems, or draw rulers of relative scales.\par
+ For example, if one wants to switch to Chinese length units, he may define \texttt{\string\rulerunit=1cm\string\divide\string\rulerunit3\string\relax}, which makes the least count 10/3 mm, namely one \textit{fen}{\fontspec{SimSun}(分)}\kern-4pt, or one tenth \textit{cun}{\fontspec{SimSun}(寸)}\kern-4pt.\par
+ \vskip-6mm
+ \hbox{}\hfill{\rulerunit=1cm\divide\rulerunit3\relax\rulersep=-6pt\rulerwidth=5mm\rulerbox[b]{\rule{10cm}{0pt}}}\hfill\hbox{}\par
+ \smallskip
+ \item \texttt{\string\rulersep}: Distance between box edges and rulers. Default is \texttt{3pt}.
+ \item \texttt{\string\rulerwidth}: Length of longest ticks in rulers. Default is \texttt{7pt}.
+ \item \texttt{\string\rtickrule}: Width of tick lines in rulers. Default is \texttt{0.4pt}.
+ \end{itemize}
+
+\end{document}
Property changes on: trunk/Master/texmf-dist/doc/latex/rulerbox/rulerbox.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/rulerbox/rulerbox.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/rulerbox/rulerbox.sty (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/rulerbox/rulerbox.sty 2019-05-04 21:12:54 UTC (rev 50984)
@@ -0,0 +1,153 @@
+%% rulerbox.sty
+%% Copyright 2019 Yuchang Yang < yang.yc.allium at gmail.com >
+%
+% 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 Yuchang Yang.
+%
+% This work consists of the files rulerbox.sty, rulerbox.tex and
+% the generated manual file rulerbox.pdf.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{rulerbox}[2019/04/18 v1.01 package rulerbox]
+\makeatletter
+\def\vb at xt@{\vbox to}
+\newdimen\rulerunit
+ \rulerunit=1mm
+\newdimen\rulerwidth
+ \rulerwidth=7pt
+\newdimen\rulersep
+ \rulersep=3pt
+\newdimen\rtickrule
+ \rtickrule=.4pt
+\newdimen\dim at margin
+\newdimen\dim at total@height
+\newdimen\dim at depth
+\def\ruler at vcells#1#2{%
+ \leaders\vb at xt@#1\rulerunit{%
+ \kern-.5\rtickrule
+ \hrule\@height\rtickrule\@width#2\rulerwidth
+ \vss}%
+ \vfill\kern-#1\rulerunit}
+\def\ruler at hcells#1#2{%
+ \leaders\hb at xt@#1\rulerunit{%
+ \kern-.5\rtickrule
+ \vrule\@width\rtickrule\@height#2\rulerwidth
+ \hss}%
+ \hfill\kern-#1\rulerunit}
+\newif\ifrulertop
+ \rulertoptrue
+\newif\ifrulerbottom
+ \rulerbottomtrue
+\newif\ifrulerleft
+ \rulerlefttrue
+\newif\ifrulerright
+ \rulerrighttrue
+\newif\ifruler at t
+\newif\ifruler at b
+\newif\ifruler at l
+\newif\ifruler at r
+\newbox\box at content
+\newbox\box at ruler@left
+\newbox\box at ruler@right
+\newbox\box at ruler@top
+\newbox\box at ruler@bottom
+\def\rulerbox{%
+ \let\ifruler at t\ifrulertop
+ \let\ifruler at b\ifrulerbottom
+ \let\ifruler at l\ifrulerleft
+ \let\ifruler at r\ifrulerright
+ \@ifnextchar[%]
+ {\ruler at box@option}{\ruler at box}}
+\def\ruler at box@option[#1]{%
+ \ruler at tfalse
+ \ruler at bfalse
+ \ruler at lfalse
+ \ruler at rfalse
+ \@tfor\@iterator:=#1\do{\csname ruler@\@iterator true\endcsname}%
+ \ruler at box}
+\long\def\ruler at box#1{%
+ \leavevmode
+ \setbox\box at content=\hbox{#1}%
+ \dim at margin=\rulerwidth
+ \advance\dim at margin\rulersep
+ \dim at total@height=\ht\box at content
+ \advance\dim at total@height\dp\box at content
+ \dim at depth=\dp\box at content
+ \ifruler at b
+ \advance\dim at depth\dim at margin
+ \fi
+ \rulers at prepare
+ \ruler at box@
+}
+\def\rulers at prepare{%
+ \ifruler at l\setbox\box at ruler@left=\hbox{\lower\dp\box at content\hbox{%
+ \ooalign{%
+ \vb at xt@\dim at total@height{\ruler at vcells{10}{1. }}\cr
+ \hidewidth\vb at xt@\dim at total@height{\ruler at vcells{ 5}{ .75}}\cr
+ \hidewidth\vb at xt@\dim at total@height{\ruler at vcells{ 1}{ .5 }}\cr
+ }%
+ }}\fi%
+ \ifruler at r\setbox\box at ruler@right=\hbox{\lower\dp\box at content\hbox{%
+ \ooalign{%
+ \vb at xt@\dim at total@height{\ruler at vcells{10}{1. }}\cr
+ \vb at xt@\dim at total@height{\ruler at vcells{ 5}{ .75}}\hidewidth\cr
+ \vb at xt@\dim at total@height{\ruler at vcells{ 1}{ .5 }}\hidewidth\cr
+ }%
+ }}\fi%
+ \ifruler at t\setbox\box at ruler@top=\hbox{%
+ \ooalign{%
+ \hb at xt@\wd\box at content{\ruler at hcells{10}{1 }}\cr
+ \hb at xt@\wd\box at content{\ruler at hcells{ 5}{ .75}}\cr
+ \hb at xt@\wd\box at content{\ruler at hcells{ 1}{ .5 }}\cr
+ }%
+ }\fi%
+ \ifruler at b\setbox\box at ruler@bottom=\hbox{%
+ \ooalign{%
+ \vb at xt@\rulerwidth{\hb at xt@\wd\box at content{\ruler at hcells{10}{1 }}\vss}\cr
+ \vb at xt@\rulerwidth{\hb at xt@\wd\box at content{\ruler at hcells{ 5}{ .75}}\vss}\cr
+ \vb at xt@\rulerwidth{\hb at xt@\wd\box at content{\ruler at hcells{ 1}{ .5 }}\vss}\cr
+ }%
+ }\fi}
+\def\ruler at box@{%
+ \lower\dim at depth\hbox{%
+ \ifruler at l\kern\dim at margin\fi
+ \vbox{%
+ \ifruler at t
+ \box\box at ruler@top
+ \nointerlineskip
+ \kern\rulersep
+ \fi
+ \hbox{%
+ \ifruler at l
+ \kern-\dim at margin
+ \box\box at ruler@left
+ \kern\rulersep
+ \fi
+ \box\box at content
+ \ifruler at r
+ \kern\rulersep
+ \box\box at ruler@right
+ \kern-\dim at margin
+ \fi
+ }%
+ \ifruler at b
+ \nointerlineskip
+ \kern\rulersep
+ \box\box at ruler@bottom
+ \fi
+ \kern\z@
+ }%
+ \ifruler at r\kern\dim at margin\fi
+ }}
+\makeatother
+%%
+%% End of file `rulerbox.sty'
Property changes on: trunk/Master/texmf-dist/tex/latex/rulerbox/rulerbox.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check 2019-05-04 21:12:17 UTC (rev 50983)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check 2019-05-04 21:12:54 UTC (rev 50984)
@@ -588,7 +588,8 @@
romanbar romanbarpagenumber romande romanneg romannum
rosario rotfloat rotpages roundbox roundrect
rrgtrees rsc rsfs rsfso
- rterface rtkinenc rtklage rubik ruhyphen rulercompass russ rutitlepage
+ rterface rtkinenc rtklage
+ rubik ruhyphen rulerbox rulercompass russ rutitlepage
rviewport rvwrite ryersonsgsthesis ryethesis
sa-tikz sageep sanitize-umlaut
sanskrit sanskrit-t1 sansmath sansmathaccent sansmathfonts
Modified: trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc 2019-05-04 21:12:17 UTC (rev 50983)
+++ trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc 2019-05-04 21:12:54 UTC (rev 50984)
@@ -963,6 +963,7 @@
depend roundbox
depend rterface
depend rtkinenc
+depend rulerbox
depend rulercompass
depend rvwrite
depend sanitize-umlaut
Added: trunk/Master/tlpkg/tlpsrc/rulerbox.tlpsrc
===================================================================
More information about the tex-live-commits
mailing list