diff options
author | Karl Berry <karl@freefriends.org> | 2024-10-26 20:16:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-10-26 20:16:18 +0000 |
commit | 585ea6e231247ee27846862c9ffee4a496e9a4ab (patch) | |
tree | 9045b8fa2975862d905d346f7502e38014cd4ff6 /Master/texmf-dist/tex/latex | |
parent | 4fb2af0d3bad596d07b0f54a7eeec7c2f9085de2 (diff) |
prooftrees (26oct24)
git-svn-id: svn://tug.org/texlive/trunk@72665 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/prooftrees/prooftrees.sty | 73 |
1 files changed, 50 insertions, 23 deletions
diff --git a/Master/texmf-dist/tex/latex/prooftrees/prooftrees.sty b/Master/texmf-dist/tex/latex/prooftrees/prooftrees.sty index c28a6c96881..ea15ae27482 100644 --- a/Master/texmf-dist/tex/latex/prooftrees/prooftrees.sty +++ b/Master/texmf-dist/tex/latex/prooftrees/prooftrees.sty @@ -1,23 +1,26 @@ -%% Copyright 2020 Clea F. Rees -% -% 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 Clea F. Rees. -% -% This work consists of all files listed in manifest.txt. +%% Copyright 2016-2024 Clea F. Rees %% +%% 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. +%% The latest version of this license is in +%% https://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008-05-04 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Clea F. Rees. +%% +%% This file may only be distributed together with a copy of the package +%% prooftrees. +%% +%% This work consists of all files listed in manifest.txt. +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e} \RequirePackage{svn-prov} -\ProvidesPackageSVN{$Id: prooftrees.sty 9103 2022-04-02 04:28:09Z cfrees $}[v0.8 \revinfo] -\RequirePackage{etoolbox} +\ProvidesPackageSVN{$Id: prooftrees.sty 10522 2024-10-23 16:31:08Z cfrees $}[v0.9 \revinfo] % define \prooftrees@enw to hold the name of the environment % default is to name the environment prooftree, this ensures backwards compatibility \newcommand*\prooftrees@enw{prooftree} @@ -27,7 +30,12 @@ \DeclareOption{tableau}{\renewcommand*\prooftrees@enw{tableau}} \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{forest}} % if \prooftree is not yet defined, set the name to prooftree; otherwise, use tableau to avoid conflict with bussproofs (which uses 'prooftree' rather than 'bussproof' as one might expect) -\ifundef\prooftree{\renewcommand*\prooftrees@enw{prooftree}}{\renewcommand*\prooftrees@enw{tableau}} +\ifcsname prooftree\endcsname + \renewcommand*\prooftrees@enw{tableau}% +\else + \renewcommand*\prooftrees@enw{prooftree}% +\fi +% \ifundef\prooftree{\renewcommand*\prooftrees@enw{prooftree}}{\renewcommand*\prooftrees@enw{tableau}} % let users override the default prooftree in case they need to load bussproofs later \ProcessOptions \RequirePackage{forest}[2016/12/04] @@ -457,7 +465,7 @@ }{}, where={% >{O _O< O &&}{grouped}{1}{level}{proof tree rhifo}% - }{% this searches for certain kinds of structural asymmetry in the tree and attempts to move lines appropriately in such cases - the algorithm is intended to be relatively conservative (not in the sense of 'cautious' or 'safe' but in the sense of 'reflection of the overlapping consensus of reasonable users' / 'what would be rationally agreed behind the prooftrees veil of ignorance'; apologies for the inconvenience if you are an unreasonable user) + }{% this searches for certain kinds of structural asymmetry in the tree and attempts to move lines appropriately in such cases - the algorithm is intended to be relatively conservative (not in the sense of 'cautious' or 'safe' but in the sense of 'reflection of the overlapping consensus of reasonable users' / 'what would be rationally agreed behind the prooftrees veil of ignorance'; however, I should have realised I actually had 'the overlapping concensus of reasonable Beamer users' in mind rather than 'the overlapping consensus of reasonable users', so there is now an option to turn it off;apologies if this comment previously misclassified you as 'unreasonable'; apologies for the inconvenience if you are an unreasonable user) not tempboola, for root/.process={Ow1}{level}{% for level={##1}{% @@ -867,9 +875,9 @@ }, }, } -\environbodyname\prooftreebody +% \environbodyname\prooftreebody \bracketset{action character=@} -\NewEnviron{\prooftrees@enw}[1]{% \forest/\endforest from egreg's answer at http://tex.stackexchange.com/a/229608/ +\NewDocumentEnvironment{\prooftrees@enw}{ m +b }{% \forest/\endforest from egreg's answer at http://tex.stackexchange.com/a/229608/ \forest (% stages={% customised definition of stages - we don't use any custom stages, but we do use several custom keylists, where the processing order of these is critical @@ -896,7 +904,26 @@ )% proof tree,% apply the proof tree style, which sets keylists from both forest's defaults and our custom additions #1,% insert user's preamble, empty or otherwise - this allows the user both to override our defaults (e.g. by setting a non-empty proof statement or a custom format for line numbers) and to customise the tree using forest's facilities in the usual way - BUT customisations of the latter kind may or may not be effective, may or may not have undesirable - not to say chaotic - consequences, and may or may not cause compilation failures (structural changes, in particular, should be avoided completely) - [, name=proof statement @\prooftreebody]% - \endforest} + [, name=proof statement @#2]% + \endforest +}{} + +\ExplSyntaxOn +\cs_new_protected_nopar:Npn \__prooftrees_memoize:n #1 +{ + \mmzset{ + auto = { #1 } { memoize }, + } +} +\cs_generate_variant:Nn \__prooftrees_memoize:n { V } +\hook_gput_code:nnn { begindocument / before } { . } +{% paid รข memoize bussproofs prooftree ... + \@ifpackageloaded{memoize}{ + \__prooftrees_memoize:V \prooftrees@enw + }{} +} +\ExplSyntaxOff + \endinput %% end prooftrees.sty + |