[latex3-commits] [git/LaTeX3-latex3-mathtools] master: added support (fe80a31)

daleif daleif at math.au.dk
Mon Mar 23 11:38:22 CET 2020


Repository : https://github.com/latex3/mathtools
On branch  : master
Link       : https://github.com/latex3/mathtools/commit/fe80a31bccaf81958c7813dc4daa0d67c4ac21b6

>---------------------------------------------------------------

commit fe80a31bccaf81958c7813dc4daa0d67c4ac21b6
Author: daleif <daleif at math.au.dk>
Date:   Mon Mar 23 11:38:22 2020 +0100

    added support


>---------------------------------------------------------------

fe80a31bccaf81958c7813dc4daa0d67c4ac21b6
 support/README.md       |  15 +++++
 support/make_samples.pl |  42 ++++++++++++
 support/sample.tex      | 171 ++++++++++++++++++++++++++++++++++++++++++++++++
 support/template.tex    | 124 +++++++++++++++++++++++++++++++++++
 4 files changed, 352 insertions(+)

diff --git a/support/README.md b/support/README.md
new file mode 100644
index 0000000..b21bbd1
--- /dev/null
+++ b/support/README.md
@@ -0,0 +1,15 @@
+Support folder
+======================
+
+This is just some support tools for making sample files when testing
+various option combinations and/or classes.
+
+It could probably also be written in Lua (I just don;t know Lua ;-)
+
+/daleif
+
+
+Copyright (C) 2020 Lars Madsen, The LaTeX3 Project  
+<https://latex-project.org/>  
+All rights reserved.
+
diff --git a/support/make_samples.pl b/support/make_samples.pl
new file mode 100644
index 0000000..00d89e4
--- /dev/null
+++ b/support/make_samples.pl
@@ -0,0 +1,42 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use utf8;
+use open qw/:std :utf8/;
+use Template;
+
+# https://metacpan.org/pod/distribution/Template-Toolkit/lib/Template/Manual/Config.pod
+my $templ = 'template.tex';
+
+my $t = Template->new({ ENCODING => 'utf8', });
+
+my @option_combinations = ('reqno', 'leqno', 'fleqn,reqno', 'fleqn,leqno');
+my @classes             = qw(article amsart);
+
+for my $class ( @classes ) {
+  for my $opt ( @option_combinations ) {
+  
+    my $s = '';
+
+    $t -> process($templ, {class => $class, classoptions => $opt},\$s)
+      || die $t -> error();
+    
+    my $o = join ',', $class, $opt;
+    $o =~ s/,/-/g;
+
+    my $file = sprintf 'example-%s.tex', $o;
+   
+    open my $FH, '>', $file or die $!;
+    print $FH $s;
+    close $FH;
+    
+    warn sprintf "Generated %s\n", $file;
+    
+  }
+}
+
+
+
+
+
diff --git a/support/sample.tex b/support/sample.tex
new file mode 100644
index 0000000..b67798c
--- /dev/null
+++ b/support/sample.tex
@@ -0,0 +1,171 @@
+\newcommand\Example{
+\begin{empheq}{equation}
+  equation
+\end{empheq}
+\begin{empheq}{equation*}
+  equation
+\end{empheq}
+\begin{empheq}{gather}
+  gather \\ gather gather
+\end{empheq}
+\begin{empheq}{gather*}
+  gather \\ gather gather
+\end{empheq}
+\begin{empheq}{multline}
+  multline1                                          \\ multline2
+\end{empheq}
+\begin{empheq}{multline*}
+  multline1                                         \\ multline2
+\end{empheq}
+\begin{empheq}{align}
+  align       & = align                              \\
+              & = align
+\end{empheq}
+\begin{empheq}{align*}
+  align      & = align                             \\
+             & = align
+\end{empheq}% hest
+%\tracingmacros=1
+%\tracingonline=1
+\begin{empheq}{align}
+  align     & = align    & align    & = align    \\
+            & = align    &          & = align
+\end{empheq}
+\begin{empheq}{align*}
+  align    & = align   & align   & = align   \\
+           & = align   &         & = align
+\end{empheq}
+%\tracingonline=0 
+%\tracingmacros=0
+\begin{empheq}{alignat=1}
+  alignat    & = alignat                            \\
+             & = alignat
+\end{empheq}
+\begin{empheq}{alignat*=1}
+  alignat   & = alignat                           \\
+            & = alignat
+\end{empheq}
+\begin{empheq}{alignat=2}
+  alignat  & = alignat  & alignat  & = alignat  \\
+           & = alignat  &          & = alignat
+\end{empheq}
+\begin{empheq}{alignat*=2}
+  alignat & = alignat & alignat & = alignat \\
+          & = alignat &         & = alignat
+\end{empheq}
+\begin{empheq}{flalign}
+  flalign     & = flalign                            \\
+              & = flalign
+\end{empheq}
+\begin{empheq}{flalign*}
+  flalign    & = flalign                           \\
+             & = flalign
+\end{empheq}
+\begin{empheq}{flalign}
+  flalign   & = flalign  & flalign  & = flalign  \\
+            & = flalign  &          & = flalign
+\end{empheq}
+\begin{empheq}{flalign*}
+  flalign  & = flalign & flalign & = flalign \\
+           & = flalign &         & = flalign
+\end{empheq}
+}
+
+
+
+\Example
+
+\newpage
+
+\begin{center}
+  \bfseries\Huge
+  Using itemize
+\end{center}
+
+
+\begin{itemize}
+\item \Example
+\end{itemize}
+
+
+\endinput
+
+\newcommand\Example{
+\begin{empheq}{equation}
+  equation
+\end{empheq}
+\begin{empheq}{equation*}
+  equation*
+\end{empheq}
+\begin{empheq}{gather}
+  gather
+\end{empheq}
+\begin{empheq}{gather*}
+  gather*
+\end{empheq}
+\begin{empheq}{multline}
+  multline1                                          \\ multline2
+\end{empheq}
+\begin{empheq}{multline*}
+  multline*1                                         \\ multline*2
+\end{empheq}
+\begin{empheq}{align}
+  align       & = align                              \\
+              & = align
+\end{empheq}
+\begin{empheq}{align*}
+  align*      & = align*                             \\
+              & = align*
+\end{empheq}
+\begin{empheq}{align}
+  2xalign     & = align    & 2xalign    & = align    \\
+              & = align    &            & = align
+\end{empheq}
+\begin{empheq}{align*}
+  2xalign*    & = align*   & 2xalign*   & = align*   \\
+              & = align*   &            & = align*
+\end{empheq}
+\begin{empheq}{alignat=1}
+  alignat1    & = alignat                            \\
+              & = alignat
+\end{empheq}
+\begin{empheq}{alignat*=1}
+  alignat*1   & = alignat*                           \\
+              & = alignat*
+\end{empheq}
+\begin{empheq}{alignat=2}
+  2xalignat2  & = alignat  & 2xalignat  & = alignat  \\
+              & = alignat  &            & = alignat
+\end{empheq}
+\begin{empheq}{alignat*=2}
+  2xalignat*2 & = alignat* & 2xalignat* & = alignat* \\
+              & = alignat* &            & = alignat*
+\end{empheq}
+\begin{empheq}{flalign}
+  flalign     & = flalign                            \\
+              & = flalign
+\end{empheq}
+\begin{empheq}{flalign*}
+  flalign*    & = flalign*                           \\
+              & = flalign*
+\end{empheq}
+\begin{empheq}{flalign}
+  2xflalign   & = flalign  & 2xflalign  & = flalign  \\
+              & = flalign  &            & = flalign
+\end{empheq}
+\begin{empheq}{flalign*}
+  2xflalign*  & = flalign* & 2xflalign* & = flalign* \\
+              & = flalign* &            & = flalign*
+\end{empheq}
+}
+
+
+
+
+
+
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
diff --git a/support/template.tex b/support/template.tex
new file mode 100644
index 0000000..ad98dcd
--- /dev/null
+++ b/support/template.tex
@@ -0,0 +1,124 @@
+[% TAGS <! !> %] 
+\documentclass[a4paper,oneside,
+%twocolumn,
+<! classoptions !>
+]{<! class !>}
+\usepackage[top=2cm,bottom=2cm,left=1cm,right=5cm,marginparwidth=4cm,showframe]{geometry}
+\setlength\overfullrule{5pt} 
+\usepackage{empheq}
+%\usepackage{amsthm}
+\usepackage{xcolor}
+\newcommand*\mybluebox[1]{\colorbox{blue!20}{\hspace{0.5em}#1\hspace{0.5em}}}
+%\empheqset{box=\fbox}
+\empheqset{box=\mybluebox,left=L\Rightarrow,}
+\MHInternalSyntaxOn
+%\def\EQ_use_mathdisplay:{%
+%  \EQ_outerbox:{\fbox{\usebox{\EQ_mathdisplay_box}}}}
+\MHInternalSyntaxOff
+
+
+
+
+
+% \makeatletter
+% \renewcommand*{\Gm at pageframes}{%
+%   \vb at xt@\z@{%
+%    \ifGm at showcrop
+%     \vb at xt@\z@{\vskip-1\Gm at truedimen in\vskip\Gm at layoutvoffset%
+%      \hb at xt@\z@{\hskip-1\Gm at truedimen in\hskip\Gm at layouthoffset%
+%       \vb at xt@\Gm at layoutheight{%
+%        \let\protect\relax
+%    %    \hb at xt@\Gm at layoutwidth{\Gm at cropmark(-1,1,-3,3)\hfil\Gm at cropmark(1,1,3,3)}%
+%        \vfil
+%        \hb at xt@\Gm at layoutwidth{\Gm at cropmark(-1,-1,-3,-3)\hfil\Gm at cropmark(1,-1,3,-3)}}%
+%      \hss}%
+%     \vss}%
+%    \fi%
+%    \ifGm at showframe
+%     \if at twoside
+%      \ifodd\count\z@
+%        \let\@themargin\oddsidemargin
+%      \else
+%        \let\@themargin\evensidemargin
+%      \fi
+%     \fi
+%     \moveright\@themargin%
+%     \vb at xt@\z@{%
+%      \vskip\topmargin\vb at xt@\z@{\vss\Gm at hrule}%
+%      \vskip\headheight\vb at xt@\z@{\vss\Gm at hruled}%
+%      \vskip\headsep\vb at xt@\z@{\vss\Gm at hrule}%
+%      \@tempdima\textwidth
+%      \advance\@tempdima by \marginparsep
+%      \advance\@tempdima by \marginparwidth
+%      \if at mparswitch
+%       \ifodd\count\z@
+%        \Gm at vrules@mpi
+%       \else
+%        \Gm at vrules@mpii
+%       \fi
+%      \else
+%       \Gm at vrules@mpi
+%      \fi
+%      \vb at xt@\z@{\vss\Gm at hrule}%
+%      \vskip\footskip\vb at xt@\z@{\vss\Gm at hruled}%
+%      \vss}%
+%     \fi%
+%   }}%
+
+% \makeatother
+
+
+
+\begin{document}
+
+% just to make sure the settings in each class is the same (besides \displaywidth)
+\leftmargini=25pt
+\makeatletter
+\@mathmargin\leftmargini
+\makeatother
+
+
+
+
+\begin{center}
+  \Huge\bfseries
+  <! class !>, <! classoptions !>
+\end{center}
+\input{sample}
+\end{document}
+
+% some saved  code
+
+\usepackage{tikz}
+\usetikzlibrary{calc}
+
+
+
+\MHInternalSyntaxOn
+
+\newcommand\dlfhook{%
+  \ifdim\l_EQ_displaywidth_dim>\z@
+  \ifnum\l_EQ_equationtype_int=3\else
+  \ifnum\l_EQ_equationtype_int=4\else
+    \rlap{\tikz[remember~picture]\coordinate(A) at (0,0);
+  \begin{tikzpicture}[overlay,remember~picture]
+    \node[text~width=4cm,anchor=west] at
+    ($(A~-|~current~page.north~east)-(4.5cm,0)$) {%
+      \footnotesize
+      dispw:~\the\l_EQ_displaywidth_dim\\
+      alignsep:~\the\alignsep@\\
+      %\settowidth\@tempdimc{\widthof{\EQ_outerbox:{}}}
+      %\the\@tempdimc%
+      %eqnshift:~\the\eqnshift@
+      tagshift:~\the\tagshift@\\
+      % mathmargin:~\the\@mathmargin\\
+      %\the\leftmargini
+      %\the\l_EQ_equationtype_int
+      \par
+    };
+  \end{tikzpicture}}
+  \fi\fi
+ \fi
+}
+
+





More information about the latex3-commits mailing list.