texlive[62548] branches/branch2021.final/Master: liftarm (9mar22)

commits+karl at tug.org commits+karl at tug.org
Wed Mar 9 22:09:27 CET 2022


Revision: 62548
          http://tug.org/svn/texlive?view=revision&revision=62548
Author:   karl
Date:     2022-03-09 22:09:27 +0100 (Wed, 09 Mar 2022)
Log Message:
-----------
liftarm (9mar22) (branch)

Modified Paths:
--------------
    branches/branch2021.final/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc

Added Paths:
-----------
    branches/branch2021.final/Master/texmf-dist/doc/latex/liftarm/
    branches/branch2021.final/Master/texmf-dist/doc/latex/liftarm/README.md
    branches/branch2021.final/Master/texmf-dist/doc/latex/liftarm/liftarm.pdf
    branches/branch2021.final/Master/texmf-dist/doc/latex/liftarm/liftarm.tex
    branches/branch2021.final/Master/texmf-dist/tex/latex/liftarm/
    branches/branch2021.final/Master/texmf-dist/tex/latex/liftarm/liftarm.sty
    branches/branch2021.final/Master/tlpkg/tlpsrc/liftarm.tlpsrc

Added: branches/branch2021.final/Master/texmf-dist/doc/latex/liftarm/README.md
===================================================================
--- branches/branch2021.final/Master/texmf-dist/doc/latex/liftarm/README.md	                        (rev 0)
+++ branches/branch2021.final/Master/texmf-dist/doc/latex/liftarm/README.md	2022-03-09 21:09:27 UTC (rev 62548)
@@ -0,0 +1,9 @@
+# liftarm
+
+Draw liftarms with TikZ
+
+(c) Matthias Floré
+
+This package is based on the package TikZ and can be used to draw liftarms with TikZ. It provides several options for the appearance of the liftarms, a command which connects two liftarms and an environment to describe a construction.
+
+This program can be redistributed and/or modified under the terms of the LaTeX Project Public License Distributed from CTAN archives on http://www.latex-project.org/lppl.txt.
\ No newline at end of file


Property changes on: branches/branch2021.final/Master/texmf-dist/doc/latex/liftarm/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: branches/branch2021.final/Master/texmf-dist/doc/latex/liftarm/liftarm.pdf
===================================================================
(Binary files differ)

Index: branches/branch2021.final/Master/texmf-dist/doc/latex/liftarm/liftarm.pdf
===================================================================
--- branches/branch2021.final/Master/texmf-dist/doc/latex/liftarm/liftarm.pdf	2022-03-09 21:08:49 UTC (rev 62547)
+++ branches/branch2021.final/Master/texmf-dist/doc/latex/liftarm/liftarm.pdf	2022-03-09 21:09:27 UTC (rev 62548)

Property changes on: branches/branch2021.final/Master/texmf-dist/doc/latex/liftarm/liftarm.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: branches/branch2021.final/Master/texmf-dist/doc/latex/liftarm/liftarm.tex
===================================================================
--- branches/branch2021.final/Master/texmf-dist/doc/latex/liftarm/liftarm.tex	                        (rev 0)
+++ branches/branch2021.final/Master/texmf-dist/doc/latex/liftarm/liftarm.tex	2022-03-09 21:09:27 UTC (rev 62548)
@@ -0,0 +1,559 @@
+%Documentation for the liftarm package
+%Draw liftarms with TikZ
+%(c) Matthias Floré
+%This program can be redistributed and/or modified under the terms of the LaTeX Project Public License Distributed from CTAN archives on http://www.latex-project.org/lppl.txt.
+\documentclass[a4paper,english,dvipsnames]{ltxdoc}
+\usepackage[english]{babel}
+\usepackage{graphicx}
+\usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead]{geometry}
+\usepackage{parskip}
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage{mathtools}
+\usepackage{amssymb}
+\allowdisplaybreaks
+\usepackage{multicol}
+\usepackage{animate}
+\usepackage{liftarm}
+\input{pgfmanual-en-macros.tex}
+\usepackage[page]{totalcount}
+\usepackage{fancyhdr}
+\pagestyle{fancy}
+\renewcommand{\headrulewidth}{0pt}
+\cfoot{\iftotalpages\begin{tikzpicture}\liftarm[mark holes=\thepage-1]{0,0}{\totalpages-2}{0}\end{tikzpicture}\fi}%\liftarm{0,0}{\thepage}{0}
+\fancyhead{}
+\usepackage{imakeidx}
+\makeindex[program=makeindex,columns=2,intoc=true]
+\indexsetup{othercode={\thispagestyle{fancy}}}
+\usepackage[linktoc=all,pdfstartview=FitH,colorlinks=true,linkcolor=Mahogany,citecolor=ForestGreen,urlcolor=MidnightBlue,bookmarksnumbered=true]{hyperref}
+\hypersetup{pdftitle={The liftarm package},pdfauthor={Matthias Flor\'e},pdfsubject={Manual},pdfkeywords={liftarm}}
+\setcounter{tocdepth}{2}
+\setcounter{secnumdepth}{2}
+\DeclareMathOperator{\atan}{atan}
+\title{The \texttt{liftarm} package\\[12pt]\large Draw liftarms with \tikzname}
+\author{Matthias Flor\'e}
+\date{2022-03-08}
+\begin{document}
+\maketitle
+\thispagestyle{fancy}
+\begin{abstract}
+\noindent This package is based on the package |tikz| (see \cite{TtTaPGFp}) and can be used to draw liftarms with \tikzname. It provides several options for the appearance of the liftarms, a command which connects two liftarms and an environment to describe a construction. This is the manual for version 1.0.
+\end{abstract}
+\tableofcontents
+\section{Usage}
+The package |liftarm| can be used by putting
+
+|\usepackage{liftarm}|
+
+in the preamble.
+
+The package |liftarm| loads the packages |etoolbox|, |xcolor| with the option |dvipsnames|, |tikz| and the \tikzname{} library |calc|. Since |xcolor| is loaded with the option |dvipsnames|, packages such as |pgfplots| and |tcolorbox| must be loaded \emph{after} |liftarm|.
+\section{Drawing liftarms}
+\begin{command}{\liftarm\opt{\oarg{options}}\marg{point}\marg{length}\marg{angle}}
+This command can be placed inside a |tikzpicture| environment. It draws a liftarm of \meta{length} starting at \meta{point}. The angle between the liftarm and the $x$-axis can be specified by \meta{angle} in degrees. The distance between the holes is $1$.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}
+\liftarm{1,2}{3}{20}
+\end{tikzpicture}
+\end{codeexample}
+Note that the number of holes is $\meta{length}+1$. The \meta{options} can be given with the following keys.
+\begin{key}{/liftarm/axle holes=\marg{values}}
+This key defines the holes in the liftarm where axle holes will be drawn.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}
+\liftarm[axle holes={0,4}]{0,1}{4}{0}
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+\begin{key}{/liftarm/brick=\opt{\meta{boolean}} (default true, initially false)}
+If true, a brick will be drawn instead of a liftarm.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}
+\liftarm[brick]{0,1}{2}{0}
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+\begin{key}{/liftarm/color=\marg{name}}
+This key defines the color of the liftarm. The color can also be specified without key.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}
+\liftarm[color=Green]{0,1}{4}{0}
+\liftarm[Blue]{0,2}{3}{0}
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+\begin{key}{/liftarm/color 0=\marg{name} (initially Gray)}
+\end{key}
+\begin{key}{/liftarm/color 1=\marg{name} (initially darkgray)}
+\end{key}
+\begin{key}{/liftarm/color 2=\marg{name} (initially Yellow)}
+\end{key}
+\begin{key}{/liftarm/color 3=\marg{name} (initially Orange)}
+\end{key}
+\begin{key}{/liftarm/color 4=\marg{name} (initially Red)}
+\end{key}
+\begin{key}{/liftarm/color 5=\marg{name} (initially Green)}
+\end{key}
+\begin{key}{/liftarm/color 6=\marg{name} (initially Blue)}
+\end{key}
+\begin{key}{/liftarm/color 7=\marg{name} (initially Brown)}
+These keys define the colors of the liftarms which have as their length the number following |color|.
+\end{key}
+\begin{key}{/liftarm/color modulo=\marg{number} (initially 8)}
+The default colors of the liftarms are determined by computing the length of the liftarm modulo the value of this key and selecting the color from the previous keys.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}[scale=0.5]
+\foreach\n in {0,...,16}{
+    \liftarm{0,-\n}{\n}{0}
+}
+\end{tikzpicture}
+\end{codeexample}
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}[scale=0.5]
+\pgfkeys{
+    /liftarm,
+    color 0=Yellow,
+    color 1=Red,
+    color 2=Green,
+    color 3=Blue,
+    color modulo=4
+}
+\foreach\n in {0,...,8}{
+    \liftarm{0,-\n}{\n}{0}
+}
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+\begin{key}{/liftarm/contour=\opt{\meta{boolean}} (default true, initially false)}
+If true, a contour will be drawn around the liftarm.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}
+\liftarm[contour]{0,1}{4}{0}
+\liftarm[brick,contour]{1,2}{2}{0}
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+\begin{key}{/liftarm/coordinate=\marg{number 1/name 1}\dots}
+This key defines coordinates with name \meta{name i} at hole \meta{number i} of the liftarm.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}
+\liftarm[
+    coordinate={1/A,3/B}
+]{0,1}{6}{40}
+\liftarm{A}{3}{0}
+\liftarm{B}{2}{180}
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+\begin{key}{/liftarm/hole radius=\marg{value} (initially 0.3)}
+The \meta{value} of this key, multiplied with the \meta{value} of the key |scalefactor| defines the radius of the holes.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}
+\liftarm[hole radius=0.1]{0,0}{5}{0}
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+\begin{key}{/liftarm/liftarm thickness=\marg{value} (initially 0.92)}
+The \meta{value} of this key, multiplied with the \meta{value} of the key |scalefactor| defines the thickness of the liftarm.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}
+\liftarm[
+    hole radius=0.1,
+    liftarm thickness=0.3
+]{0,0}{5}{0}
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+\begin{key}{/liftarm/mark color=\marg{name} (initially Black)}
+\end{key}
+\begin{key}{/liftarm/mark holes=\marg{values}}
+The key |mark holes| defines the holes in the liftarm which will be marked. The key |mark color| defines the color of these marks.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}
+\liftarm[
+    mark holes={0,1,3}
+]{0,0}{5}{0}
+\liftarm[
+    mark holes={1,2,4},
+    mark color=Blue
+]{0,1}{4}{0}
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+\begin{key}{/liftarm/origin=\marg{number} (initially 0)}
+This key defines the number of the hole which will be placed at the coordinate given as argument to the liftarm.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}
+\liftarm{-2,0}{4}{0}
+\liftarm[origin=1]{0,0}{6}{30}
+\liftarm[origin=2]{0,0}{5}{60}
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+\begin{key}{/liftarm/scalefactor=\marg{value} (initially 0.5)}
+The \meta{value} of this key defines the factor which scales the thickness of the liftarm and the radius of the holes.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}
+\liftarm[scalefactor=1]{0,0}{4}{0}
+\liftarm[brick,scalefactor=1]{1,2}{2}{0}
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+\begin{key}{/liftarm/screw color=\marg{name} (initially Black)}
+\end{key}
+\begin{key}{/liftarm/screw holes=\marg{values}}
+\end{key}
+\begin{key}{/liftarm/screw holes angle=\marg{angle} (initially 45)}
+The key |screw holes| defines the holes in the liftarm where a screw will be drawn. The key |screw color| defines the color of these screws. The key |screw holes angle| defines the angle in degrees around which the screws are drawn.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}
+\liftarm[
+    screw holes={0,1,3}
+]{0,0}{5}{0}
+\liftarm[
+    screw holes={1,2,4},
+    screw color=Blue,
+    screw holes angle=0
+]{0,1}{4}{0}
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+\end{command}
+\section{Connecting liftarms}
+\begin{command}{\liftarmconnect\opt{\oarg{options}}\marg{point1}\marg{length1}\marg{point2}\marg{length2}}
+This command can be placed inside a |tikzpicture| environment. It draws a liftarm of \meta{length1} starting at \meta{point1} and a liftarm of \meta{length2} starting at \meta{point2} in such a way that their last holes have the same coordinate in case that such a point exists. If such a point does not exist then nothing is drawn. In case that there exist 2 such points then this point is chosen counterclockwise. In that case, the other configuration of the 2 liftarms can be obtained by simply swapping \marg{point1}\marg{length1} and \marg{point2}\marg{length2}. The keys for the command |\liftarm| can be given to the \meta{options}. In this case these keys will be passed to both liftarms.
+\begin{codeexample}[width=9cm]
+\begin{tikzpicture}
+\coordinate (A) at (0,0);
+\coordinate (B) at (4,2);
+\coordinate (C) at (1,-3);
+\coordinate (D) at (5,-1);
+\liftarmconnect[Yellow]{A}{2}{B}{3}
+\liftarmconnect[Red]{B}{3}{A}{2}
+\liftarmconnect[Green]{C}{3}{D}{2}
+\liftarmconnect[Blue]{D}{2}{C}{3}
+\foreach\coord in {A,B,C,D}{
+    \node at (\coord) {{\small $\coord$}};
+}
+\end{tikzpicture}
+\end{codeexample}
+Additionally, the \meta{options} can be given with the following keys.
+\begin{key}{/liftarm/connect coordinate=\marg{name}}
+This key defines a coordinate with name \meta{name} at the connection point of both liftarms.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}
+\liftarm{-3,0}{5}{0}
+\liftarmconnect[
+    connect coordinate=A
+]{2,0}{2}{-2,0}{3}
+\liftarm{A}{4}{180}
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+\begin{key}{/liftarm/connect reverse=\opt{\meta{boolean}} (default true, initially false)}
+If true, the first liftarm of |\liftarmconnect| will be drawn second and the second liftarm will be drawn first. This option can be used to change the appearance at the connection point of both liftarms.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}
+\liftarmconnect{2,0}{1}{0,0}{2}
+\liftarmconnect[
+    connect reverse
+]{5,0}{1}{3,0}{2}
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+\begin{stylekey}{/liftarm/liftarm 1=\marg{options} (initially \normalfont empty)}
+\end{stylekey}
+\begin{stylekey}{/liftarm/liftarm 2=\marg{options} (initially \normalfont empty)}
+These keys accept a list of keys which will be applied to the first respectively second liftarm. These lists of keys accept the same options as the command |\liftarm|. Additionally, the key |connect| below can be given.
+\begin{key}{/liftarm/connect=\marg{number}}
+This key defines the number of the hole which will be connected to the matching liftarm. If this key is not given then the last hole of the liftarm is taken as the connecting point.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}
+\liftarm{0,-7}{10}{90}
+\liftarmconnect[
+    connect coordinate=A,
+    liftarm 1={
+        origin=1,
+        connect=5
+    },
+    liftarm 2={
+        origin=2,
+        connect=6
+    }
+]{0,2}{6}{0,0}{7}
+\liftarmconnect[
+    liftarm 1={
+        origin=2,
+        connect=8
+    },
+    liftarm 2={
+        origin=1,
+        connect=5,
+        coordinate=4/B
+    }
+]{A}{9}{0,-6}{6}
+\liftarm[origin=1]{B}{4}{70}
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+\end{stylekey}
+\end{command}
+\section{Describing a construction}
+If a construction involves many liftarms then it is convenient to describe this construction in separate steps and |tikzpicture|s. Then the content of previous |tikzpicture|s would need to be copied in each new |tikzpicture|. This process can be automated by using the |liftarmconstruction| environment and the command |\liftarmconstruct| below.
+\begin{environment}{{liftarmconstruction}\opt{\oarg{options}}}
+This environment is in fact an |enumerate| environment with the addition that it resets the content of the |tikzpicture| which is displayed by the command |\liftarmconstruct| below. Thus in particular, |\item| can be used inside the |liftarmconstruction| environment. The \meta{options} will be passed to each |tikzpicture| drawn by the command |\liftarmconstruct| inside this environment. The following command can be used inside this environment.
+\begin{command}{\liftarmconstruct\opt{\oarg{options}}\marg{text}\marg{commands}}
+This command starts an |\item| and shows \meta{text}. Then it displays a |tikzpicture| containing \meta{commands} and also the \meta{commands} of previous |\liftarmconstruct| commands inside the same |liftarmconstruction| environment. The \meta{options} will be added to this |tikzpicture| but \emph{only} in the current step.
+
+As an example, we describe below the construction of a regular pentagon from \cite{Tmm1}.
+\begin{codeexample}[width=10cm]
+\begin{minipage}{0.5\linewidth}%only for
+%usage in this manual%\linewidth-6pt
+%\begin{multicols}{2}%only for
+%usage in this manual
+\begin{liftarmconstruction}[scale=0.75]
+\liftarmconstruct[
+    {\node[left,align=left]
+        at (-0.5,-1.3)
+        {Rectangular triangle.\\
+        This text is only\\
+        visible in this step.};}
+]{
+    We start with 3 liftarms to form
+    a rectangular triangle.
+}{
+\liftarm{-3,0}{4}{0}
+\liftarmconnect[
+    liftarm 1={
+        origin=2,
+        mark holes={2,6}
+    },
+    liftarm 2={
+        mark holes=0
+    }
+]{0,0}{6}{-3,0}{5}}
+\item An |\item| can be added since this
+    is an |enumerate| environment.
+\liftarmconstruct{
+    Now we add 2 liftarms of length $3$.
+}{\liftarmconnect[
+    connect coordinate=A,
+    liftarm 1={
+        mark holes={0,3}
+    },
+    liftarm 2={
+        mark holes=0
+    }
+]{0,-2}{3}{0,2}{3}}
+\liftarmconstruct{
+    In this step we construct the first
+    side of the regular pentagon.
+}{\liftarmconnect[
+    connect coordinate=B,
+    liftarm 2={
+        mark holes={0,2}
+    }
+]{A}{2}{1,0}{2}}
+\liftarmconstruct{
+    Now we finish the construction
+    of the regular pentagon.
+}{\liftarmconnect[
+    liftarm 2={
+        mark holes={0,2}
+    }
+]{B}{2}{-1,0}{2}
+\liftarmconnect[
+    liftarm 1={
+        mark holes=2
+    }
+]{-1,0}{2}{A}{2}}
+\end{liftarmconstruction}
+%\end{multicols}
+\end{minipage}
+\end{codeexample}
+\end{command}
+\end{environment}
+\section{Additional examples}
+The following example shows a regular hexagon.
+\begin{codeexample}[width=9cm]
+\begin{tikzpicture}
+\def\r{3}
+\foreach\n in {1,...,6}{
+    \liftarmconnect{0,0}{\r}{\n*60:\r}{\r}
+}
+\end{tikzpicture}
+\end{codeexample}
+The following example illustrates that $2\atan(\frac{1}{2})=\atan(\frac{4}{3})$.
+\begin{codeexample}[width=9cm]
+\begin{tikzpicture}
+\liftarm{0,0}{3}{0}
+\liftarm{0,0}{5}{atan(4/3)}
+\liftarm{3,0}{4}{90}
+\liftarm{2,0}{1}{90}
+\liftarm{2,1}{1}{0}
+\liftarm{2,1}{1}{90+atan(4/3)}
+\end{tikzpicture}
+\end{codeexample}
+Below is an example of an angled liftarm.
+\begin{codeexample}[width=9cm]
+\begin{tikzpicture}
+\pgfkeys{
+    /liftarm,
+    scalefactor=1,
+    Blue
+}
+\liftarm[axle holes=0]{0,0}{3}{0}
+\liftarm[axle holes=5]{3,0}{5}{atan(4/3)}
+\end{tikzpicture}
+\end{codeexample}
+The following example illustrates an angle bisection.
+\begin{codeexample}[width=9cm]
+\begin{tikzpicture}
+\def\ang{40}
+\def\r{3}
+\liftarm[mark holes={0,\r}]{0,0}{2*\r}{0}
+\liftarm[mark holes=\r]{0,0}{2*\r}{\ang}
+\liftarm[
+    mark holes=\r,
+    mark color=Red
+]{\r,0}{\r}{\ang}
+\liftarm{\ang:\r}{\r}{0}
+\end{tikzpicture}
+\end{codeexample}
+The following example illustrates that $7^{2}+4^{2}=8^{2}+1^{2}$.
+\begin{codeexample}[width=9cm]
+\begin{tikzpicture}[scale=0.75]
+\def\a{4}
+\def\b{7}
+\def\c{1}
+\def\d{8}
+%\liftarm{0,0}{\b}{0}
+%\liftarm{\b,0}{\a}{90}
+\liftarmconnect{0,0}{\b}{\b,\a}{\a}
+%\liftarm{\b,\a}{1}{atan(\a/\b)+atan(\c/\d)+90}
+%\liftarm{0,0}{\d}{atan(\a/\b)+atan(\c/\d)}
+\liftarmconnect{\b,\a}{\c}{0,0}{\d}
+\end{tikzpicture}
+\end{codeexample}
+Below is an animation of the Peaucellier-Lipkin linkage, see e.g.~\cite{Koagmopermbl}.
+\begin{codeexample}[width=9cm]
+\newcommand{\PLlinkage}[1]{
+\begin{tikzpicture}[scale=0.75]
+\def\a{3}
+\def\b{4}
+\def\c{9}
+\pgfmathsetmacro{\x}{
+    2*\a+((\c^2-\b^2-(2*\a)^2)/(2*\a))
+}
+\useasboundingbox (-0.23,-6) rectangle
+    ({\x+0.23},6);
+\draw (\x,-5)--(\x,5);
+\liftarm{0,0}{\a}{0}
+\liftarm[coordinate=\a/A]{\a,0}{\a}{#1}
+\liftarmconnect[
+    connect coordinate=B,
+    connect reverse
+]{A}{\b}{0,0}{\c}
+\liftarmconnect[
+    connect coordinate=C
+]{0,0}{\c}{A}{\b}
+\liftarmconnect{C}{\b}{B}{\b}
+\end{tikzpicture}
+}
+\begin{animateinline}[
+    autoplay,
+    controls,
+    loop
+]{30}
+\multiframe{80}{rXmax=-40+1}{
+    \PLlinkage{\rXmax}
+}
+\newframe
+\multiframe{80}{rXmax=-40+1}{
+    \PLlinkage{-\rXmax}
+}
+\end{animateinline}
+\end{codeexample}
+Below is an animation of Kempe's trisector, as shown in \cite{Tmm3}.
+\begin{codeexample}[]
+\newcommand{\trisector}[1]{
+\begin{tikzpicture}[scale=0.33]
+\useasboundingbox (-27.3,-0.5) rectangle (21.2,37);
+\liftarm[coordinate=8/A]{0,0}{27}{180}
+\liftarm[coordinate=12/B]{0,0}{27}{180-(#1)}
+\liftarm[coordinate=18/C]{0,0}{27}{180-2*(#1)}
+\liftarm[coordinate=27/D]{0,0}{27}{180-3*(#1)}
+\liftarmconnect{C}{27}{D}{18}
+\liftarmconnect[liftarm 2={connect=8}]{A}{12}{B}{18}
+\end{tikzpicture}
+}
+\begin{animateinline}[autoplay,controls,loop]{5}
+\multiframe{20}{rXmax=0+1}{
+\trisector{15+\rXmax}
+}
+\newframe
+\multiframe{20}{rXmax=0+1}{
+\trisector{35-\rXmax}
+}
+\end{animateinline}
+\end{codeexample}
+Below is an animation of Chebyshev's Lambda Mechanism.
+\begin{codeexample}[width=10cm]
+\newcommand{\CL}[1]{
+\begin{tikzpicture}[scale=0.8]
+\def\r{1}
+\useasboundingbox (-2*\r-0.5,-2*\r-0.5)
+    rectangle (10*\r-0.5,10*\r+0.5);
+\liftarm{0,0}{4*\r}{0}
+\liftarm[
+    mark holes={0,2*\r}
+]{0,0}{2*\r}{#1}
+\liftarmconnect[
+    liftarm 1={mark holes={0,5*\r}},
+    liftarm 2={
+        connect=5*\r,
+        mark holes=10*\r,
+        mark color=Red
+    }
+]{4*\r,0}{5*\r}{#1:2*\r}{10*\r}
+\end{tikzpicture}
+}
+\begin{animateinline}[
+    autoplay,
+    controls,
+    loop
+]{60}
+\multiframe{360}{rXmax=0+1}{
+    \CL{\rXmax}
+}
+\end{animateinline}
+\end{codeexample}
+\begin{thebibliography}{9}
+\bibitem{Tmm1}
+Gerard 't Hooft,
+\emph{Meccano Math I},\\
+\url{https://webspace.science.uu.nl/~hooft101/lectures/meccano.pdf},
+2006.
+\bibitem{Tmm2}
+Gerard 't Hooft,
+\emph{Meccano Math II},\\
+\url{https://webspace.science.uu.nl/~hooft101/lectures/meccano2.pdf},
+2008.
+\bibitem{Tmm3}
+Gerard 't Hooft,
+\emph{Meccano Math III},\\
+\url{https://webspace.science.uu.nl/~hooft101/lectures/meccano3.pdf},
+2014.
+\bibitem{Koagmopermbl}
+Alfred Bray Kempe,
+\emph{On a general method of producing exact rectilinear motion by linkwork},
+1875.
+\bibitem{TtTaPGFp}
+Till Tantau,
+\emph{The \tikzname{} and {\upshape\pgfname} Packages},
+Manual for version 3.1.9a,
+\url{https://www.ctan.org/pkg/pgf},
+2021.
+\end{thebibliography}
+\printindex
+\end{document}
\ No newline at end of file


Property changes on: branches/branch2021.final/Master/texmf-dist/doc/latex/liftarm/liftarm.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: branches/branch2021.final/Master/texmf-dist/tex/latex/liftarm/liftarm.sty
===================================================================
--- branches/branch2021.final/Master/texmf-dist/tex/latex/liftarm/liftarm.sty	                        (rev 0)
+++ branches/branch2021.final/Master/texmf-dist/tex/latex/liftarm/liftarm.sty	2022-03-09 21:09:27 UTC (rev 62548)
@@ -0,0 +1,256 @@
+%liftarm package
+%Draw liftarms with TikZ
+%(c) Matthias Floré
+%This program can be redistributed and/or modified under the terms of the LaTeX Project Public License Distributed from CTAN archives on http://www.latex-project.org/lppl.txt.
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{liftarm}[2022/03/06 v1.0 Draw liftarms with TikZ]
+\RequirePackage{etoolbox}
+\RequirePackage[dvipsnames]{xcolor}
+\RequirePackage{tikz}
+\usetikzlibrary{calc}
+\newif\ifliftarm at brick
+\newif\ifliftarm at contour
+\newif\ifliftarm at connectreverse
+\pgfkeys{
+/liftarm/.is family,
+/liftarm/.unknown/.code={\edef\liftarm at colorkey{\pgfkeyscurrentname}},
+/liftarm,
+color/.store in=\liftarm at colorkey,
+color 0/.initial=Gray,
+color 1/.initial=darkgray,
+color 2/.initial=Yellow,
+color 3/.initial=Orange,
+color 4/.initial=Red,
+color 5/.initial=Green,
+color 6/.initial=Blue,
+color 7/.initial=Brown,
+color modulo/.initial=8,
+brick/.is if=liftarm at brick,
+axle holes/.store in=\liftarm at axleholes,
+mark holes/.store in=\liftarm at markholes,
+mark color/.initial=Black,
+screw holes/.store in=\liftarm at screwholes,
+screw holes angle/.initial=45,
+screw color/.initial=Black,
+scalefactor/.initial=0.5,
+contour/.is if=liftarm at contour,
+coordinate/.store in=\liftarm at coordinate,
+connect coordinate/.store in=\liftarm at connectcoordinate,
+connect/.store in=\liftarm at connect,
+globalize/.code n args={2}{\xdef#1{#2}},
+liftarm 1 options/.style={},
+liftarm 1/.style={liftarm 1 options/.style={#1}},
+liftarm 2 options/.style={},
+liftarm 2/.style={liftarm 2 options/.style={#1}},
+origin/.initial=0,
+connect reverse/.is if=liftarm at connectreverse,
+hole radius/.initial=0.3,
+liftarm thickness/.initial=0.92,
+}
+\pgfmathsetmacro{\liftarm at axleholeangle}{14}%2*\liftarm at axleholeradius*sin(\liftarm at axleholeangle)=1.78/8
+\pgfmathsetmacro{\liftarm at screwholestartangle}{10}
+\newcommand{\liftarm}[4][]{
+\pgfmathsetmacro{\liftarm at length}{#3}
+\ifdim \liftarm at length pt<0 pt
+\PackageWarning{liftarm}{The length (\liftarm at length) of the liftarm is smaller than 0.}
+\else
+\pgfmathsetmacro{\liftarm at ang}{#4}
+\begin{scope}[shift={(#2)},rotate=\liftarm at ang]
+\pgfkeys{/liftarm,#1}
+\pgfmathsetmacro{\liftarm at origin}{\pgfkeysvalueof{/liftarm/origin}}
+\begin{scope}[shift={(-\liftarm at origin,0)}]
+\pgfmathsetmacro{\liftarm at halfthickness}{0.5*\pgfkeysvalueof{/liftarm/scalefactor}*\pgfkeysvalueof{/liftarm/liftarm thickness}}
+\pgfmathsetmacro{\liftarm at holeradius}{\pgfkeysvalueof{/liftarm/scalefactor}*\pgfkeysvalueof{/liftarm/hole radius}}
+\pgfmathsetmacro{\liftarm at halfstudwidth}{\pgfkeysvalueof{/liftarm/scalefactor}*0.3}
+\pgfmathsetmacro{\liftarm at studheight}{\pgfkeysvalueof{/liftarm/scalefactor}*0.2}
+\pgfmathsetmacro{\liftarm at halfplateheight}{\pgfkeysvalueof{/liftarm/scalefactor}*0.2}
+\pgfmathsetmacro{\liftarm at halfplatewidth}{\pgfkeysvalueof{/liftarm/scalefactor}*0.5}
+\pgfmathsetmacro{\liftarm at axleholeradius}{\liftarm at halfthickness}
+\pgfmathsetmacro{\liftarm at screwholeradius}{0.8*\liftarm at holeradius}
+\colorlet{liftarm at markcolor}{\pgfkeysvalueof{/liftarm/mark color}}
+\colorlet{liftarm at screwcolor}{\pgfkeysvalueof{/liftarm/screw color}}
+\pgfmathsetmacro{\liftarm at screwholesangle}{\pgfkeysvalueof{/liftarm/screw holes angle}}
+\ifcsname liftarm at colorkey\endcsname
+\colorlet{liftarm at color}{\liftarm at colorkey}
+\else
+\pgfmathsetmacro{\liftarm at colornumber}{int(mod(\liftarm at length,\pgfkeysvalueof{/liftarm/color modulo}))}
+\colorlet{liftarm at color}{\pgfkeysvalueof{/liftarm/color \liftarm at colornumber}}
+\fi
+\ifliftarm at brick
+\def\liftarm at shape{(-1,{-\liftarm at halfplatewidth-\liftarm at halfplateheight})--(-1,\liftarm at halfplatewidth)
+\foreach\liftarm at n in {-1,...,\liftarm at length}{
+--({\liftarm at n+0.5-\liftarm at halfstudwidth},\liftarm at halfplatewidth)--({\liftarm at n+0.5-\liftarm at halfstudwidth},{\liftarm at halfplatewidth+\liftarm at studheight})--({\liftarm at n+0.5+\liftarm at halfstudwidth},{\liftarm at halfplatewidth+\liftarm at studheight})--({\liftarm at n+0.5+\liftarm at halfstudwidth},\liftarm at halfplatewidth)--({\liftarm at n+1},\liftarm at halfplatewidth)
+}
+--({\liftarm at length+1},{-\liftarm at halfplatewidth-\liftarm at halfplateheight})--cycle}
+\else
+\def\liftarm at shape{(0,\liftarm at halfthickness) arc (90:270:\liftarm at halfthickness)--(\liftarm at length,-\liftarm at halfthickness) arc (-90:90:\liftarm at halfthickness)--cycle}
+\fi
+\fill[liftarm at color,even odd rule] \liftarm at shape
+\foreach\liftarm at n in {0,...,\liftarm at length}{
+(\liftarm at n,0) circle[radius=\liftarm at holeradius]
+};
+\ifliftarm at contour
+%\ifliftarm at brick
+%\else
+\draw[liftarm at color!75!Black,ultra thick] \liftarm at shape;
+%\fi
+\fi
+\ifcsname liftarm at axleholes\endcsname
+\foreach\liftarm at n in \liftarm at axleholes{
+\pgfmathsetmacro{\liftarm at axlehole}{\liftarm at n}
+\ifdim \liftarm at axlehole pt<0 pt
+\else
+\ifdim \liftarm at axlehole pt>\liftarm at length pt
+\else
+\foreach\liftarm at angle in {0,90,180,270}{
+\begin{scope}[shift={(\liftarm at axlehole,0)},rotate=\liftarm at angle]
+\fill[liftarm at color] (\liftarm at axleholeangle:\liftarm at axleholeradius) arc (\liftarm at axleholeangle:{90-\liftarm at axleholeangle}:\liftarm at axleholeradius)--({\liftarm at axleholeradius*sin(\liftarm at axleholeangle)},{\liftarm at axleholeradius*sin(\liftarm at axleholeangle)})--cycle;
+\end{scope}
+}
+\fi
+\fi
+}
+\fi
+\ifcsname liftarm at markholes\endcsname
+\foreach\liftarm at n in \liftarm at markholes{
+\pgfmathsetmacro{\liftarm at markhole}{\liftarm at n}
+\ifdim \liftarm at markhole pt<0 pt
+\else
+\ifdim \liftarm at markhole pt>\liftarm at length pt
+\else
+\fill[liftarm at markcolor] (\liftarm at markhole,0) circle[radius=\liftarm at holeradius];
+\fi
+\fi
+}
+\fi
+\ifcsname liftarm at screwholes\endcsname
+\foreach\liftarm at n in \liftarm at screwholes{
+\pgfmathsetmacro{\liftarm at screwhole}{\liftarm at n}
+\ifdim \liftarm at screwhole pt<0 pt
+\else
+\ifdim \liftarm at screwhole pt>\liftarm at length pt
+\else
+\begin{scope}[shift={(\liftarm at screwhole,0)},rotate=\liftarm at screwholesangle]
+\foreach\liftarm at n in {-1,1}{
+\fill[liftarm at screwcolor] ({\liftarm at screwholeradius*cos(\liftarm at screwholestartangle)},{\liftarm at n*\liftarm at screwholeradius*sin(\liftarm at screwholestartangle)}) arc ({\liftarm at n*\liftarm at screwholestartangle}:{\liftarm at n*(180-\liftarm at screwholestartangle)}:\liftarm at screwholeradius);
+}
+\end{scope}
+\fi
+\fi
+}
+\fi
+\ifcsname liftarm at coordinate\endcsname
+\foreach\liftarm at n/\liftarm at name in \liftarm at coordinate{
+\pgfmathsetmacro{\liftarm at value}{\liftarm at n}
+\coordinate (\liftarm at name) at (\liftarm at value,0);
+}
+\fi
+\end{scope}
+\end{scope}
+\fi
+}
+\newcommand{\liftarmconnect}[5][]{
+\begin{scope}
+\pgfkeys{/liftarm,#1}
+\coordinate (liftarm at A) at (#2);
+\coordinate (liftarm at B) at (#4);
+\begin{scope}
+\pgfkeys{/liftarm,liftarm 1 options}
+\ifcsname liftarm at connect\endcsname
+\pgfmathsetmacro{\liftarm at connectlengthAtemp}{\liftarm at connect-\pgfkeysvalueof{/liftarm/origin}}
+\else
+\pgfmathsetmacro{\liftarm at connectlengthAtemp}{#3-\pgfkeysvalueof{/liftarm/origin}}
+\fi
+\xdef\liftarm at connectlengthA{\liftarm at connectlengthAtemp}
+\ifdim \liftarm at connectlengthA pt=0 pt
+\PackageWarning{liftarm}{The length of the first liftarm is 0.}
+\fi
+\end{scope}
+\begin{scope}
+\pgfkeys{/liftarm,liftarm 2 options}
+\ifcsname liftarm at connect\endcsname
+\pgfmathsetmacro{\liftarm at connectlengthBtemp}{\liftarm at connect-\pgfkeysvalueof{/liftarm/origin}}
+\else
+\pgfmathsetmacro{\liftarm at connectlengthBtemp}{#5-\pgfkeysvalueof{/liftarm/origin}}
+\fi
+\xdef\liftarm at connectlengthB{\liftarm at connectlengthBtemp}
+\ifdim \liftarm at connectlengthB pt=0 pt
+\PackageWarning{liftarm}{The length of the second liftarm is 0.}
+\fi
+\end{scope}
+\path
+let
+\p1=(liftarm at A),
+\p2=(liftarm at B),
+\n1={\x1/\pgf at xx},
+\n2={\y1/\pgf at yy},
+\n3={\x2/\pgf at xx},
+\n4={\y2/\pgf at yy}
+in
+[
+/liftarm/globalize={\liftarm at connectxalet}{\n3},
+/liftarm/globalize={\liftarm at connectyalet}{\n4},
+/liftarm/globalize={\liftarm at connectxblet}{\n1},
+/liftarm/globalize={\liftarm at connectyblet}{\n2}
+]
+;
+\pgfmathsetmacro{\liftarm at connectxa}{\liftarm at connectxalet};
+\pgfmathsetmacro{\liftarm at connectya}{\liftarm at connectyalet};
+\pgfmathsetmacro{\liftarm at connectxb}{\liftarm at connectxblet};
+\pgfmathsetmacro{\liftarm at connectyb}{\liftarm at connectyblet};
+\pgfmathsetmacro{\liftarm at absdiff}{abs(\liftarm at connectxa-\liftarm at connectxb)};
+\ifdim \liftarm at absdiff pt<0.001 pt
+\pgfmathsetmacro{\liftarm at connectanglegamma}{90}
+\ifdim \liftarm at connectya pt<\liftarm at connectyb pt
+\pgfmathsetmacro{\liftarm at connectangleshift}{0}
+\else
+\pgfmathsetmacro{\liftarm at connectangleshift}{180}
+\fi
+\else
+\pgfmathsetmacro{\liftarm at connectanglegamma}{atan((\liftarm at connectyb-\liftarm at connectya)/(\liftarm at connectxb-\liftarm at connectxa))}
+\ifdim \liftarm at connectxa pt<\liftarm at connectxb pt
+\pgfmathsetmacro{\liftarm at connectangleshift}{0}
+\else
+\pgfmathsetmacro{\liftarm at connectangleshift}{180}
+\fi
+\fi
+\pgfmathsetmacro{\liftarm at connectlength}{sqrt((\liftarm at connectyb-\liftarm at connectya)^2+(\liftarm at connectxb-\liftarm at connectxa)^2)}
+\ifdim \liftarm at connectlength pt=0 pt
+\PackageWarning{liftarm}{The length between the origins of the liftarms is 0.}
+\fi
+\pgfmathsetmacro{\liftarm at connectabsconnectlengthAminusconnectlengthB}{abs(\liftarm at connectlengthA-\liftarm at connectlengthB)}
+\ifdim \liftarm at connectabsconnectlengthAminusconnectlengthB pt>\liftarm at connectlength pt
+\PackageWarning{liftarm}{The liftarms can not be connected.}
+\fi
+\pgfmathsetmacro{\liftarm at connectconnectlengthAplusconnectlengthB}{\liftarm at connectlengthA+\liftarm at connectlengthB}
+\ifdim \liftarm at connectconnectlengthAplusconnectlengthB pt<\liftarm at connectlength pt
+\PackageWarning{liftarm}{The liftarms can not be connected.}
+\fi
+\pgfmathsetmacro{\liftarm at connectanglealpha}{acos(((\liftarm at connectlengthB)^2+(\liftarm at connectlength)^2-(\liftarm at connectlengthA)^2)/(2*(\liftarm at connectlength)*(\liftarm at connectlengthB)))}
+\pgfmathsetmacro{\liftarm at connectanglebeta}{acos(((\liftarm at connectlength)^2+(\liftarm at connectlengthA)^2-(\liftarm at connectlengthB)^2)/(2*\liftarm at connectlength*(\liftarm at connectlengthA)))}
+\pgfmathsetmacro{\liftarm at connectangledelta}{\liftarm at connectangleshift+180+\liftarm at connectanglegamma-\liftarm at connectanglebeta}
+\def\liftarm at liftarmA{\liftarm[liftarm 1 options]{#2}{#3}{\liftarm at connectangledelta}}
+\def\liftarm at liftarmB{\liftarm[liftarm 2 options]{#4}{#5}{\liftarm at connectangleshift+\liftarm at connectanglegamma+\liftarm at connectanglealpha}}
+\ifliftarm at connectreverse
+\liftarm at liftarmB
+\liftarm at liftarmA
+\else
+\liftarm at liftarmA
+\liftarm at liftarmB
+\fi
+\ifcsname liftarm at connectcoordinate\endcsname
+\coordinate (\liftarm at connectcoordinate) at ($(#2)+(\liftarm at connectangledelta:\liftarm at connectlengthA)$);
+\fi
+\end{scope}
+}
+\newcommand{\liftarm at construction}[2][]{\begin{tikzpicture}[#1]
+\liftarm at constructfigure
+#2
+\end{tikzpicture}}
+\newcommand{\liftarmconstruct}[3][]{\item #2\nopagebreak
+
+\gappto\liftarm at constructfigure{#3}
+\expandafter\liftarm at construction\expandafter[\liftarm at constructoptions]{#1}
+}
+\newenvironment{liftarmconstruction}[1][]{\def\liftarm at constructoptions{#1}\def\liftarm at constructfigure{}\begin{enumerate}}{\end{enumerate}}
+\endinput
\ No newline at end of file


Property changes on: branches/branch2021.final/Master/texmf-dist/tex/latex/liftarm/liftarm.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: branches/branch2021.final/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
===================================================================
--- branches/branch2021.final/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc	2022-03-09 21:08:49 UTC (rev 62547)
+++ branches/branch2021.final/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc	2022-03-09 21:09:27 UTC (rev 62548)
@@ -82,6 +82,7 @@
 depend ladder
 depend lapdf
 depend latex-make
+depend liftarm
 depend lpic
 depend lroundrect
 depend luamesh

Added: branches/branch2021.final/Master/tlpkg/tlpsrc/liftarm.tlpsrc
===================================================================


More information about the tex-live-commits mailing list.