texlive[69267] Master: freealign (1jan24)

commits+karl at tug.org commits+karl at tug.org
Mon Jan 1 21:50:34 CET 2024


Revision: 69267
          https://tug.org/svn/texlive?view=revision&revision=69267
Author:   karl
Date:     2024-01-01 21:50:34 +0100 (Mon, 01 Jan 2024)
Log Message:
-----------
freealign (1jan24)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/freealign/
    trunk/Master/texmf-dist/doc/latex/freealign/README
    trunk/Master/texmf-dist/doc/latex/freealign/freealign.pdf
    trunk/Master/texmf-dist/doc/latex/freealign/freealign.tex
    trunk/Master/texmf-dist/tex/latex/freealign/
    trunk/Master/texmf-dist/tex/latex/freealign/freealign.sty
    trunk/Master/tlpkg/tlpsrc/freealign.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/freealign/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/freealign/README	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/freealign/README	2024-01-01 20:50:34 UTC (rev 69267)
@@ -0,0 +1,3 @@
+Package: Align math formulas in different lines
+Author:  Jianrui Lyu <tolvjr at 163.com>
+License: The LaTeX Project Public License 1.3c
\ No newline at end of file


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

Index: trunk/Master/texmf-dist/doc/latex/freealign/freealign.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/freealign/freealign.pdf	2024-01-01 20:49:52 UTC (rev 69266)
+++ trunk/Master/texmf-dist/doc/latex/freealign/freealign.pdf	2024-01-01 20:50:34 UTC (rev 69267)

Property changes on: trunk/Master/texmf-dist/doc/latex/freealign/freealign.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/freealign/freealign.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/freealign/freealign.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/freealign/freealign.tex	2024-01-01 20:50:34 UTC (rev 69267)
@@ -0,0 +1,62 @@
+%  -*- coding: utf-8 -*-
+\documentclass[oneside,12pt]{article}
+\usepackage[a4paper,margin=2cm]{geometry}
+
+\newcommand*{\myversion}{2024A}
+\newcommand*{\mydate}{Version \myversion\ (\the\year-\mylpad\month-\mylpad\day)}
+\newcommand*{\mylpad}[1]{\ifnum#1<10 0\the#1\else\the#1\fi}
+
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{4pt plus 1pt minus 1pt}
+
+\usepackage{freealign}
+\usepackage{codehigh}
+\usepackage{hyperref}
+\hypersetup{
+  colorlinks=true,
+  urlcolor=blue3,
+  linkcolor=green3,
+}
+
+
+\begin{document}
+
+\title{\textsf{\color{green3}FreeAlign: Align math formulas in different lines}}
+\author{Jianrui Lyu (tolvjr at 163.com)}
+\date{\mydate}
+\maketitle
+
+This package provides several commands for aligning math formulas in different lines.
+Here is the first example:
+
+\vskip1em\hrule
+We have $(a+b)^2 \? = (a+b)(a+b)$ \\
+                 \+$= a^2+2ab+b^2$\hfill$\cdots\cdots$2 points
+\vskip0.6em\hrule\vskip0.5em
+\begin{codehigh}
+We have $(a+b)^2 \? = (a+b)(a+b)$ \\
+                 \+$= a^2+2ab+b^2$\hfill$\cdots\cdots$2 points
+\end{codehigh}
+
+The \verb!\?! command \underline{inside} the first formula saves current horizontal position,
+and the \verb!\+! command \underline{before} the second formula jumps to previously saved position.
+
+Here is another example:
+
+\vskip1em\hrule
+We have \? $(a+b)^2 = (a+b)(a+b)$ \\
+        \< $= a^2+2ab+b^2$ \hfill$\cdots\cdots$2 points
+\vskip0.6em\hrule\vskip0.5em
+\begin{codehigh}
+We have \? $(a+b)^2 = (a+b)(a+b)$ \\
+        \< $= a^2+2ab+b^2$ \hfill$\cdots\cdots$2 points
+\end{codehigh}
+
+The \verb!\?! command \underline{before} the first formula saves current horizontal position,
+and the \verb!\<! command \underline{before} the second formula jumps to the left
+of previously saved position by the width of $=$.
+
+Because this package uses \verb!zref! package to save positions,
+you need two compilations to get correct results.
+
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/freealign/freealign.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/freealign/freealign.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/freealign/freealign.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/freealign/freealign.sty	2024-01-01 20:50:34 UTC (rev 69267)
@@ -0,0 +1,70 @@
+% -*- coding: utf-8 -*-
+% ----------------------------------------------------------------------------
+% Author:  Jianrui Lyu <tolvjr at 163.com>
+% License: The LaTeX Project Public License 1.3c
+% ----------------------------------------------------------------------------
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{freealign}[2024-01-01 v2024A Align math formulas in different lines]
+
+\RequirePackage{etoolbox,zref-savepos}
+
+\@ifundefined{zsaveposx}{\let\zsaveposx\zsavepos}{} % 旧版本无 \zsaveposx 命令
+
+\newcounter{saveposcnt}
+\newcounter{useposcnt}
+\renewcommand*{\thesaveposcnt}{savepos\number\value{saveposcnt}}
+\renewcommand*{\theuseposcnt}{usepos\number\value{useposcnt}}
+
+\def\my at alignment@offset{}
+
+\def\my at alignment@list{}
+\forcsvlist{\listadd\my at alignment@list}{=,<,>,\le,\ge,\leq,\geq,\approx}
+
+\newlength{\my at alignment@kern}
+
+\newcommand*{\my at alignment@check}[1]{%
+  \ifx\my at let@token #1%
+    \def\my at alignment@offset{5}%
+    \expandafter\listbreak
+  \fi
+}
+
+\newcommand{\my at alignment@next}{%
+  \ifdefempty{\my at alignment@offset}{%
+    \def\my at alignment@offset{0}%
+    \forlistloop{\my at alignment@check}{\my at alignment@list}%
+  }{}%
+  \settowidth{\my at alignment@kern}{$\mkern\my at alignment@offset mu$}%
+  \stepcounter{saveposcnt}%
+  \rlap{\kern\my at alignment@kern\zsaveposx{\thesaveposcnt}}%
+}
+
+\newcommand*{\tabpoint}[1][]{%
+  \leavevmode
+  \def\my at alignment@offset{#1}%
+  \futurelet\my at let@token\my at alignment@next
+}
+\let \? = \tabpoint
+
+\newcommand*{\tabto}{%
+  \stepcounter{useposcnt}%
+  \zsaveposx{\theuseposcnt}%
+  \noindent
+  \hskip\zposx{\thesaveposcnt}sp\relax
+  \hskip-\zposx{\theuseposcnt}sp\relax
+  \ignorespaces
+}
+\let \+ = \tabto
+
+\newcommand*{\tableft}{%
+  \settowidth{\my at alignment@kern}{$=\mkern5mu$}%
+  \stepcounter{useposcnt}%
+  \zsaveposx{\theuseposcnt}%
+  \noindent
+  \hskip\zposx{\thesaveposcnt}sp\relax
+  \hskip-\zposx{\theuseposcnt}sp\relax
+  \hskip-\my at alignment@kern
+  \ignorespaces
+}
+\let \< = \tableft


Property changes on: trunk/Master/texmf-dist/tex/latex/freealign/freealign.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	2024-01-01 20:49:52 UTC (rev 69266)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2024-01-01 20:50:34 UTC (rev 69267)
@@ -357,7 +357,7 @@
     fouridx fourier fouriernc
     fp fpl
     fragmaster fragments frame framed francais-bst frankenstein frcursive
-    frederika2016 frege frenchmath frimurer frletter frontespizio
+    frederika2016 freealign frege frenchmath frimurer frletter frontespizio
     froufrou frpseudocode
     ftc-notebook ftcap ftnxtra
     fullblck fullminipage fullwidth

Modified: trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc	2024-01-01 20:49:52 UTC (rev 69266)
+++ trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc	2024-01-01 20:50:34 UTC (rev 69267)
@@ -100,6 +100,7 @@
 depend fnspe
 depend formal-grammar
 depend fouridx
+depend freealign
 depend functan
 depend galois
 depend gastex

Added: trunk/Master/tlpkg/tlpsrc/freealign.tlpsrc
===================================================================


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