texlive[60735] Master/texmf-dist: phfthm (11oct21)

commits+karl at tug.org commits+karl at tug.org
Mon Oct 11 22:25:04 CEST 2021


Revision: 60735
          http://tug.org/svn/texlive?view=revision&revision=60735
Author:   karl
Date:     2021-10-11 22:25:04 +0200 (Mon, 11 Oct 2021)
Log Message:
-----------
phfthm (11oct21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/phfthm/README.md
    trunk/Master/texmf-dist/doc/latex/phfthm/phfthm.pdf
    trunk/Master/texmf-dist/source/latex/phfthm/phfthm.dtx
    trunk/Master/texmf-dist/source/latex/phfthm/phfthm.ins
    trunk/Master/texmf-dist/tex/latex/phfthm/phfthm.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/source/latex/phfthm/Makefile
    trunk/Master/texmf-dist/source/latex/phfthm/pkg.mk

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/latex/phfthm/Makefile
    trunk/Master/texmf-dist/doc/latex/phfthm/pkg.mk

Deleted: trunk/Master/texmf-dist/doc/latex/phfthm/Makefile
===================================================================
--- trunk/Master/texmf-dist/doc/latex/phfthm/Makefile	2021-10-11 20:24:49 UTC (rev 60734)
+++ trunk/Master/texmf-dist/doc/latex/phfthm/Makefile	2021-10-11 20:25:04 UTC (rev 60735)
@@ -1,10 +0,0 @@
-
-PKG = phfthm
-
--include pkg.mk
-
-pkg.mk:
-	ln -sf ../mkcommon/pkg.mk pkg.mk
-
-install:  install_sty install_doc
-

Modified: trunk/Master/texmf-dist/doc/latex/phfthm/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/phfthm/README.md	2021-10-11 20:24:49 UTC (rev 60734)
+++ trunk/Master/texmf-dist/doc/latex/phfthm/README.md	2021-10-11 20:25:04 UTC (rev 60735)
@@ -11,5 +11,14 @@
 
 # Documentation
 
-Run 'make sty' to generate the style file and 'make pdf' to generate the package
-documentation. Run 'make' or 'make help' for more info.
+Run `make sty` to generate the style file, `make pdf` to generate the package
+documentation, and `make install` to install the package in your local texmf
+tree. Run 'make' or 'make help' for more info.
+
+
+# Author and License
+
+(C) 2016 Philippe Faist, philippe.faist at bluewin.ch
+
+License: [LaTeX project public license](http://www.ctan.org/license/lppl1.3),
+version 1.3 or above

Modified: trunk/Master/texmf-dist/doc/latex/phfthm/phfthm.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/phfthm/pkg.mk
===================================================================
--- trunk/Master/texmf-dist/doc/latex/phfthm/pkg.mk	2021-10-11 20:24:49 UTC (rev 60734)
+++ trunk/Master/texmf-dist/doc/latex/phfthm/pkg.mk	2021-10-11 20:25:04 UTC (rev 60735)
@@ -1,167 +0,0 @@
-
-#
-# Common useful definitions
-#
-LATEX = latex
-
-PDFLATEX = TEXINPUTS="$$TEXINPUTS:../phfnote" pdflatex
-PDFLATEXOPTS = -interaction=batchmode
-PDFLATEXOPTSLAST = -interaction=batchmode --synctex=1
-
-MAKEINDEX = makeindex
-
-
-#
-# Set default PREFIX. This can be overridden with 'make install PREFIX=/installation/directory'
-#
-DEFAULT_PREFIX := $(shell kpsewhich -var-value TEXMFHOME)
-PREFIX ?= $(DEFAULT_PREFIX)
-
-
-#
-# package should be set in variable PKG
-#
-PKGREADME = README.md
-
-#
-# packages may specify additional files in the distribution with this variable
-# (by default empty)
-#
-DIST_ADDITIONAL_FILES ?= 
-
-
-PKGDTX = $(PKG).dtx
-PKGINS = $(PKG).ins
-PKGSTY = $(PKG).sty
-PKGPDF = $(PKG).pdf
-PKGTDSZIP = $(PKG).tds.zip
-PKGZIP = $(PKG).zip
-
-
-
-.PHONY: help sty pdf install install_sty install_doc tdszip dist clean cleanall cleansty cleanaux cleanpdf cleantdszip cleandist
-
-
-help:
-	@echo "Targets for $(PKG):"
-	@echo "make sty             -- generate LaTeX package file $(PKG).sty"
-	@echo "make pdf             -- generate pdf documentation"
-	@echo "make install         -- install style and documentation files to TEXMF tree"
-	@echo "make install PREFIX=[specify texmf directory]"
-	@echo "make $(PKG).tds.zip  -- create TDS.ZIP to include in CTAN upload"
-	@echo "make dist            -- create distribution ZIP, ready for upload to CTAN"
-	@echo "make clean           -- remove LaTeX auxiliary files"
-	@echo "make cleansty        -- remove generated style file"
-	@echo "make cleanpdf        -- remove generated pdf documentation"
-	@echo "make cleanall        -- remove all generated files, incl. distribution zip"
-
-
-clean: cleanaux
-
-cleanall: cleansty cleanaux cleanpdf cleantdszip cleandist
-
-# ------------------------------------------------
-# make sty
-# ------------------------------------------------
-
-sty: $(PKGSTY)
-
-$(PKGSTY): $(PKGINS) $(PKGDTX)
-	$(LATEX) $<
-
-cleansty:
-	@rm -f $(PKGSTY)
-
-# ------------------------------------------------
-# make pdf
-# ------------------------------------------------
-
-pdf: $(PKG).pdf
-
-#
-# fake index & glossary so they get a TOC entry from the beginning, and so the page
-# numbers in the index are correct.
-#
-$(PKG).aux $(PKG).idx $(PKG).glo: $(PKGDTX) $(PKGSTY)
-	DTX=$< ; echo '\\begin{theindex}\\item index here \\end{theindex}' >$${DTX%.dtx}.ind
-	DTX=$< ; echo '\\begin{theglossary}\\item changes here\\end{theglossary}' >$${DTX%.dtx}.gls
-	$(PDFLATEX) $(PDFLATEXOPTS) $<
-	$(PDFLATEX) $(PDFLATEXOPTS) $<
-	$(PDFLATEX) $(PDFLATEXOPTS) $<
-
-$(PKG).ind: $(PKG).idx
-	$(MAKEINDEX) -s gind.ist -o $@ $<
-
-$(PKG).gls: $(PKG).glo
-	$(MAKEINDEX) -s gglo.ist -o $@ $<
-
-# final steps of making the PKG.pdf doc file.  At the end, touch the ind and gls files so
-# that they don't look out-of-date (because the idx and glo files were overwritten again)
-$(PKGPDF): $(PKGDTX) $(PKG).aux $(PKG).ind $(PKG).gls
-	$(PDFLATEX) $(PDFLATEXOPTS) $<
-	$(PDFLATEX) $(PDFLATEXOPTS) $<
-	$(PDFLATEX) $(PDFLATEXOPTSLAST) $<
-	touch $(PKG).ind $(PKG).gls $(PKG).pdf
-
-
-cleanaux:
-	@rm -f *.aux *.log *.toc *.glo *.gls *.ind *.idx *.ilg *.out *.bbl *.blg *.synctex.gz *.hd
-
-cleanpdf:
-	@rm -f $(PKGPDF)
-
-# ------------------------------------------------
-# 'make install' partial installation targets
-# ------------------------------------------------
-
-#
-# The install target itself is defined per-package, in case packages want to install more
-# files (such as bibtex styles)
-#
-
-install_sty: $(PKGSTY)
-	mkdir -p $(DESTDIR)$(PREFIX)/tex/latex/$(PKG)
-	cp $(PKGSTY)  $(DESTDIR)$(PREFIX)/tex/latex/$(PKG)
-
-install_doc: $(PKGPDF)
-	mkdir -p $(DESTDIR)$(PREFIX)/doc/latex/$(PKG)
-	cp $(PKGPDF) $(PKGREADME)  $(DESTDIR)$(PREFIX)/doc/latex/$(PKG)
-
-
-
-# ------------------------------------------------
-# make tdszip
-# ------------------------------------------------
-
-TDSTMPDIR = $(CURDIR)/_install_tds_zip.make.tmp
-
-tdszip: $(PKGTDSZIP)
-
-$(PKGTDSZIP): $(PKGSTY) $(PKGPDF)
-	mkdir $(TDSTMPDIR)
-	$(MAKE) install PREFIX=$(TDSTMPDIR)
-	cd $(TDSTMPDIR) && zip -r $(CURDIR)/$(PKGTDSZIP) *
-	rm -rf $(TDSTMPDIR)
-
-cleantdszip:
-	@rm -f $(PKGTDSZIP)
-
-
-# ------------------------------------------------
-# make dist
-# ------------------------------------------------
-
-DISTTMPDIR = $(CURDIR)/_install_dist_zip.make.tmp
-
-dist: $(PKGZIP)
-
-$(PKGZIP): $(PKGTDSZIP)
-	rm -rf $(DISTTMPDIR)
-	mkdir -p $(DISTTMPDIR)/$(PKG)
-	cp $(PKGTDSZIP) $(DISTTMPDIR)
-	cp $(PKGDTX) $(PKGINS) $(PKGPDF) $(PKGREADME) Makefile pkg.mk $(DIST_ADDITIONAL_FILES) $(DISTTMPDIR)/$(PKG)
-	cd $(DISTTMPDIR) && zip -r $(CURDIR)/$(PKGZIP) $(PKGTDSZIP) $(PKG)
-	rm -rf $(DISTTMPDIR)
-
-cleandist:
-	@rm -f $(PKGZIP)

Added: trunk/Master/texmf-dist/source/latex/phfthm/Makefile
===================================================================
--- trunk/Master/texmf-dist/source/latex/phfthm/Makefile	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/phfthm/Makefile	2021-10-11 20:25:04 UTC (rev 60735)
@@ -0,0 +1,10 @@
+
+PKG = phfthm
+
+-include pkg.mk
+
+pkg.mk:
+	ln -sf ../mkcommon/pkg.mk pkg.mk
+
+install:  install_sty install_doc
+


Property changes on: trunk/Master/texmf-dist/source/latex/phfthm/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/source/latex/phfthm/phfthm.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/phfthm/phfthm.dtx	2021-10-11 20:24:49 UTC (rev 60734)
+++ trunk/Master/texmf-dist/source/latex/phfthm/phfthm.dtx	2021-10-11 20:25:04 UTC (rev 60735)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright (C) 2016 by Philippe Faist <philippe.faist at bluewin.ch>
+% Copyright (C) 2016 by Philippe Faist, philippe.faist at bluewin.ch
 % -------------------------------------------------------
 % 
 % This file may be distributed and/or modified under the
@@ -22,7 +22,7 @@
 %<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
 %<package>\ProvidesPackage{phfthm}
 %<*package>
-    [2016/08/15 v1.0 phfthm package]
+    [2021/03/01 v1.2 phfthm package]
 %</package>
 %
 %<*driver>
@@ -31,6 +31,9 @@
 \usepackage{phfthm}
 \usepackage[preset=xpkgdoc]{phfnote}
 \usepackage{needspace}
+\expandafter\def\csname eqsign@\endcsname{=}
+\def\eqsign{\expandafter\protect\csname eqsign@\endcsname}
+\robustify\eqsign
 \EnableCrossrefs         
 \CodelineIndex
 \RecordChanges
@@ -150,7 +153,7 @@
 % style adjustments; this allows you to enable features individually and
 % selectively:
 % \begin{verbatim}
-% \usepackage[resetstyle,prooftitleitbf=true]{../phfthm}
+% \usepackage[resetstyle,prooftitleitbf=true]{phfthm}
 % \end{verbatim}
 % 
 %
@@ -168,10 +171,9 @@
 %
 % Possible theorem sets are:
 % \begin{pkgoptions}
-% \item[thmset=]\pkgoptionscombineitem
-% \item[thmset=empty] Do not define any environment at package loading.  You may
-%   of course invoke |\phfLoadThmSet| or |\phfMakeTheorem| manually at any
-%   later point.
+% \item[thmset=,thmset=empty] Do not define any environment at package loading.
+%   You may of course invoke |\phfLoadThmSet| or |\phfMakeTheorem| manually at
+%   any later point.
 % \item[thmset=simple]
 %   \DescribeEnv{theorem} \DescribeEnv{proposition}
 %   \DescribeEnv{lemma} \DescribeEnv{corollary} \DescribeEnv{definition}
@@ -182,14 +184,17 @@
 %   environments |theorem|, |proposition|, |lemma|, |corollary|, |conjecture|,
 %   |remark| as theorem-like environments, and |definition| as a definition-like
 %   environment.
-% \item[thmset=shortnames] For if you like typing less: the same environments
+% \item[thmset=shortnames] \iffalse\DescribeEnv{thm}\DescribeEnv{prop}
+%   \DescribeEnv{lem}\DescribeEnv{cor}\DescribeEnv{conj}\DescribeEnv{rem}
+%   \DescribeEnv{defn}\fi In case you prefer to type less: the same environments
 %   are defined as the default set, but with shorter names.  Define the
 %   environments |thm|, |prop|, |lem|, |cor|, |conj|, |rem| as theorem-like
 %   environments, and |defn| as a definition-like environment.
 % \item[thmset=rich] \DescribeEnv{idea} \DescribeEnv{question}
-%   \DescribeEnv{problem} Provides the same environments as the |default|
-%   theorem set, as well as in addition: |idea|, |question| and |problem| as
-%   theorem-like environments.
+%   \DescribeEnv{claim} \DescribeEnv{observation} \DescribeEnv{problem} Provides
+%   the same environments as the |default| theorem set, as well as in addition:
+%   |idea|, |question|, |claim|, |observation|, and |problem| as theorem-like
+%   environments.
 % \end{pkgoptions}
 %
 % You may also load a theorem set at a later
@@ -222,6 +227,11 @@
 %   \pkgoptionfmt{thmset} package option will use a separate counter if this
 %   option is set; otherwise (the default), there is a single counter which is
 %   shared by all those theorem environments.
+% \item[parentcounter=\meta{counter name}] Theorem counters will reset each time
+%   the parent counter is increased.  Use this option for per-chapter or
+%   per-section numbering (use parent counter |parentcounter=chapter| or
+%   |parentcounter=section|).  See also the \pkgoptionfmt{countpersection}
+%   package option.
 % \end{pkgoptions}
 %
 % The \pkgoptionfmt{proofref} package option allows to specify a comma-separated
@@ -228,9 +238,8 @@
 % list of attributes to apply to the proof reference (``proof on page XYZ'')
 % displayed along with the theorem.  The following attributes may be specified:
 % \begin{pkgoptions}
-% \item[proofref=\pkgoptattribempty{}]\pkgoptionscombineitem
-% \item[proofref=\pkgoptattribnodots{default}] Do not change the default
-%   proof reference appearance.
+% \item[proofref=\pkgoptattribempty{},proofref=\pkgoptattribnodots{default}] Do
+%   not change the default proof reference appearance.
 %
 % \item[proofref=false] Deactivate the proof-ref mechanism.
 %
@@ -237,6 +246,9 @@
 % \item[proofref=\pkgoptattrib{margin}] The proof reference is displayed in
 %   the margin, instead of after the theorem.
 %
+% \item[proofref=\pkgoptattrib{marginbottom}] The proof reference is displayed
+%   in the margin, but aligned with the bottom of the theorem statement.
+%
 % \item[proofref=\pkgoptattrib{longref}] The proof reference is displayed as
 %   a full sentence (``The proof of this \meta{Theorem Name} can be found on
 %   page \meta{XYZ}.'').
@@ -430,8 +442,10 @@
 %   the margin, long sentence, ...).  Possible styles are
 %   \cmdoptionfmt{proofrefstyle=default} (the default),
 %   \cmdoptionfmt{proofrefstyle=margin} (display the proof ref in the margin of
-%   the page) and \cmdoptionfmt{proofrefstyle=longref} (as by default but with a
-%   full sentence).  See \autoref{sec:proof-ref-customize-appearance} for how to
+%   the page), \cmdoptionfmt{proofrefstyle=marginbottom} (display the proof ref
+%   in the margin of the page aligned with the bottom of the theorem statement)
+%   and \cmdoptionfmt{proofrefstyle=longref} (as by default but with a full
+%   sentence).  See \autoref{sec:proof-ref-customize-appearance} for how to
 %   further customize the appearance of the proof reference.
 %
 % \end{cmdoptions}
@@ -456,8 +470,8 @@
 % |\phfLoadThmSet| is:
 %
 % \noindent |\phfLoadThmSet|\hspace{0pt}\marg{options to
-% \phfverb{\phfLoadThmSet} for theorem-like
-% environments}\hspace{0pt}\marg{options to \phfverb{\phfLoadThmSet} for
+% \phfverb{\phfMakeTheorem} for theorem-like
+% environments}\hspace{0pt}\marg{options to \phfverb{\phfMakeTheorem} for
 % definition-like environments}\hspace{0pt}\marg{name of theorem set to load}
 %
 % The first and second argument to this macro are tokens to expand in front of
@@ -490,6 +504,7 @@
 % \DescribeMacro{\definitionname}
 % \DescribeMacro{\ideaname}
 % \DescribeMacro{\questionname}
+% \DescribeMacro{\claimname}
 % \DescribeMacro{\problemname}
 %
 % This package is language agnostic (with titles defined by default in English),
@@ -498,9 +513,9 @@
 % the relevant names to the corresponding |\captions|\meta{language name} macro,
 % for example:
 % \begin{verbatim}
-% \usepackage[francais,...]{babel}
+% \usepackage[french,...]{babel}
 % ...
-% \addto\captionsfrancais{%
+% \addto\captionsfrench{%
 %   \def\theoremname{Th\'eor\`eme}%
 %   \def\propositionname{Proposition}%
 %   \def\lemmaname{Lemme}%
@@ -510,9 +525,10 @@
 %   \def\definitionname{D\'efinition}%
 %   \def\ideaname{Id\'ee}%
 %   \def\questionname{Question}%
+%   \def\claimname{Affirmation}%
 %   \def\problemname{Probl\`eme}%
 % }
-% ... \selectlanguage{francais} ...
+% ... \selectlanguage{french} ...
 % \end{verbatim}
 %
 % 
@@ -690,12 +706,16 @@
 % \newcommand\proofofname[1]{\proofname{} of #1}
 % \end{verbatim}
 % You may override this to obtain something fancier, of you wish to display the
-% document in a different language:
+% document in a different language.  For instance, you might want to display
+% (``D\'emonstration (Th\'eor\`eme 5)'' in french:
 % \begin{verbatim}
-% \def\proofofnamefrancais#1{\proofname{} (#1)}
-% \addto\captionsfrancais{\let\proofofname\proofofnamefrancais}
+% \def\proofofnameinparentheses#1{\proofname\ (#1)}
+% \addto\captionsfrench{%
+%   \def\proofname{D\'emonstration}%
+%   \let\proofofname\proofofnameinparentheses%
+% }
 % ...
-% \selectlanguage{francais} ...
+% \selectlanguage{french} ...
 % \end{verbatim}
 %
 %
@@ -799,9 +819,9 @@
 %   \begin{minipage}{\dimexpr\textwidth-2\fboxsep-2\fboxrule\relax}
 %     \textbf{Theorem 17} (Gauss). For a closed surface $S$ enclosing a
 %     volume $V$, we have
-%     \setcounter{equation}{41}
 %     \begin{equation}
 %       \oint_S\vec u\cdot d\vec S = \int_V(\vec\nabla\cdot\vec u)\,dV\ .
+%       \tag*{(41)}
 %     \end{equation}
 %     \hfill{\small\itshape (Proof on page XXX.)}\hfilneg
 %     {\par\vspace{1ex}\relax
@@ -810,6 +830,41 @@
 %   \end{minipage}
 % }\endgroup
 %
+% A positive side-effect is that in your LaTeX source, if you consistently
+% label your proofs then you always know what theorem a proof refers to.  If
+% you would like to simply output ``Proof.'' instead of ``Proof of Theorem
+% X.'', for instance, because the proof immediately succeeds the theorem in
+% question, you may use the syntax |[**thm:label]| instead.  In this case, the
+% proof-reference mechanism will know that this is the proof of the theorem
+% labeled |thm:label| and will avoid undefined references.  For example,
+% the following code:
+% \begin{verbatim}
+% \begin{theorem}[Gauss]
+%   \label{thm:Gauss}
+%   For a closed surface $S$ enclosing a volume $V$, we have
+%   \begin{equation}
+%     \oint_S\vec u\cdot d\vec S = \int_V(\vec\nabla\cdot\vec u)\,dV\ .
+%   \end{equation}
+% \end{theorem}
+% \begin{proof}[**thm:Gauss]
+%   ...
+% \end{proof}
+% \end{verbatim}
+% might output:
+% \begingroup\setlength{\fboxsep}{1em}
+% \par\noindent\fbox{%
+%   \begin{minipage}{\dimexpr\textwidth-2\fboxsep-2\fboxrule\relax}
+%     \textbf{Theorem 17} (Gauss). For a closed surface $S$ enclosing a
+%     volume $V$, we have
+%     \begin{equation}
+%       \oint_S\vec u\cdot d\vec S = \int_V(\vec\nabla\cdot\vec u)\,dV\ .
+%       \tag*{(41)}
+%     \end{equation}
+%     \par\textit{Proof.}\hspace{2em}\ldots
+%   \end{minipage}
+% }\endgroup
+%
+%
 % \subsection{On the theorem side}
 %
 % On the theorem side, the proof-ref mechanism works by hacking into the
@@ -875,7 +930,18 @@
 % \ldots},'' where the page number corresponds to the page on which this proof
 % is located.
 %
+% You may also use the syntax |\begin{proof}[**|\meta{label}|]|, which has the
+% effect of producing the simple output ``Proof.'' (this is desirable e.g.\@
+% if the proof immediately follows the theorem statement) but which still
+% informs the proof-reference mechanism that this proof is associated with the
+% given theorem labeled by \meta{label}.  This can avoid undefined references,
+% and can simplify your job if you want to move proofs around in your document.
 %
+% (It would be nice, of course, to have the package automatically output
+% ``Proof'' only if the proof immediately follows the theorem and output ``Proof
+% of XXX'' if the proof is further away.  Unfortunately this is hard to detect
+% in \LaTeX\ and I currently have no plans to try to implement this.)
+%
 % \subsection{Customizing appearance of the proof reference text}
 % \label{sec:proof-ref-customize-appearance}
 %
@@ -1048,6 +1114,7 @@
 \define at boolkey{phfmkthm}{defnostar}[true]{}
 \define at boolkey{phfmkthm}{defstar}[true]{}
 \define at boolkey{phfmkthm}{proofref}[true]{}
+\define at cmdkey{phfmkthm}{parentcounter}{}
 \define at cmdkey{phfmkthm}{proofrefstyle}{}
 %    \end{macrocode}
 % 
@@ -1067,6 +1134,7 @@
   \KV at phfmkthm@defnostartrue%
   \KV at phfmkthm@defstartrue%
   \KV at phfmkthm@proofreftrue%
+  \def\cmdKV at phfmkthm@parentcounter{}%
   \def\cmdKV at phfmkthm@proofrefstyle{default}%
   \setkeys{phfmkthm}{#1}%
 %    \end{macrocode}
@@ -1096,9 +1164,16 @@
   \ifKV at phfmkthm@defnostar%
     \if\relax\detokenize\expandafter{\cmdKV at phfmkthm@counter}\relax%
 %    \end{macrocode}
-% ---in case we use a separate counter (if \cmdoptionfmt{counter=}):
+% ---in case we use a separate given counter (if \cmdoptionfmt{counter=} is
+% given empty or not specified). Also check if we want a parent counter
+% (per-section or per-chapter numbering) and take that into account:
 %    \begin{macrocode}
-      \newtheorem{phfthm@#2}{#3}%
+      \if\relax\detokenize\expandafter{\cmdKV at phfmkthm@parentcounter}\relax%
+        \edef\x{\noexpand\newtheorem{phfthm@#2}{#3}}%
+      \else
+        \edef\x{\noexpand\newtheorem{phfthm@#2}{#3}[\expandonce\cmdKV at phfmkthm@parentcounter]}%
+      \fi
+      \x
       \csdef{phfthm@#2autorefname}{#3}%
     \else%
       \ifKV at phfmkthm@aliascounter%
@@ -1111,7 +1186,8 @@
         \csdef{#2autorefname}{#3}%
       \else%
 %    \end{macrocode}
-% ---in case we directly instruct |\newtheorem| to use the other counter (does not work with |\autoref|):
+% ---in case we directly instruct |\newtheorem| to use the other counter (does
+% not work with |\autoref|):
 %    \begin{macrocode}
         \newtheorem{phfthm@#2}[\cmdKV at phfmkthm@counter]{#3}%
       \fi%
@@ -1121,7 +1197,7 @@
 % And also define the actual theorem environment, adding calls to hooks.
 %    \begin{macrocode}
     \newenvironment{#2}[1][]{%
-      \begin{phfthm@#2}[##1]%
+      \begin{phfthm@#2}[{##1}]%
         \begingroup%
           \csname phfthm at hook@start@#2\endcsname{##1}%
       }{%
@@ -1430,10 +1506,15 @@
     \else
       \noexpand\phfthm at proof@noparselabel{##1}%
     \fi
-    \noexpand\def\noexpand\phfthm at val@displayargs{[{%
-        \expandafter\noexpand\csname phfthm at prfenv@#2 at val@proofofname\endcsname
-        {\noexpand\phfthm at val@prooftitle}%
-      }]}%
+    \noexpand\if\noexpand\relax\noexpand\detokenize%
+            \noexpand\expandafter{\noexpand\phfthm at val@prooftitle}\noexpand\relax
+      \noexpand\def\noexpand\phfthm at val@displayargs{}
+    \noexpand\else
+      \noexpand\def\noexpand\phfthm at val@displayargs{[{%
+          \expandafter\noexpand\csname phfthm at prfenv@#2 at val@proofofname\endcsname
+          {\noexpand\phfthm at val@prooftitle}%
+        }]}%
+    \noexpand\fi
   }
 %    \end{macrocode}
 % 
@@ -1645,10 +1726,20 @@
 \def\phfthm at proof@parselabel#1{%
   \phfthm at proof@parselabel at maybelabel#1\phfthm at proof@parselabel at END%
 }
+%    \end{macrocode}
+% If the argument is |[*thm-label]| we want ``Proof of \meta{ref to
+% thm-label}.''.  If the argument is |[**thm-label]| we want ``Proof.'' but
+% we're informing the proofref-system that this is the proof of \meta{thm-label}
+% (e.g., to avoid undefined references to proofs).  Otherwise if we get %
+% |[Some Custom Theorem]| then we want ``Proof of Some Custom Theorem.''.
+%    \begin{macrocode}
 \def\phfthm at proof@parselabel at maybelabel{%
   \@ifnextchar*\phfthm at proof@parselabel at label\phfthm at proof@parselabel at title%
 }
-\def\phfthm at proof@parselabel at label*#1\phfthm at proof@parselabel at END{%
+\def\phfthm at proof@parselabel at label*{%
+  \@ifnextchar*\phfthm at proof@parselabel at labelsilent\phfthm at proof@parselabel at labelnormal%
+}
+\def\phfthm at proof@parselabel at labelsilent*#1\phfthm at proof@parselabel at END{%
 %    \end{macrocode}
 % The use of |\detokenize| here is a trick to make sure that all chars in the
 % label text have a non-active category (e.g.\@ we would have problems, e.g., if
@@ -1655,6 +1746,10 @@
 % in the label ``|thm:gauss|'' the ``|:|'' is an active char---such as in French):
 %    \begin{macrocode}
   \edef\phfthm at val@proofoflabel{\detokenize{#1}}%
+  \def\phfthm at val@prooftitle{}% 
+}
+\def\phfthm at proof@parselabel at labelnormal#1\phfthm at proof@parselabel at END{%
+  \edef\phfthm at val@proofoflabel{\detokenize{#1}}%
   \def\phfthm at val@prooftitle{\phfthm at autoref{#1}}%
 }
 \def\phfthm at proof@parselabel at title#1\phfthm at proof@parselabel at END{%
@@ -1679,12 +1774,14 @@
 % 
 %
 % In order to look up what we are a proof of, we use |\autoref| provided by the
-% \pkgname{hyperref} package.  If it is not available, fall back to the regular
-% |\ref| command.
+% \pkgname{hyperref} package.  Crucially, it is NOT the job of \pkgname{phfthm}
+% to load this package, and we should only use them if they are available (we
+% don't want to depend on it).  If it is not available, then we fall back to the
+% regular |\ref| command.
 %    \begin{macrocode}
 \def\phfthm at autoref{\ref}
 \AtBeginDocument{%
-  \@ifpackageloaded{hyperref}{\def\phfthm at autoref{\autoref}}{}
+  \@ifpackageloaded{hyperref}{\def\phfthm at autoref{\autoref}}{}%
 }
 %    \end{macrocode}
 % 
@@ -1983,11 +2080,53 @@
 % \end{macro}
 % 
 %
-% \subsubsection{Other proof-ref styles: only \phfverb{margin} for now}
+% \subsubsection{Other proof-ref styles: \phfverb{margin} and \phfverb{marginbottom}}
 %
 % These styles simply use the same mechanism as the default style, but plug in
 % different sub-callbacks.
 %
+% Here's a command that actually places the marginpar:
+% \begin{macro}{\phfthmproofref at placemarginpar}
+%    \begin{macrocode}
+\newcommand\phfthmproofref at placemarginpar[2]{%
+  \marginpar[%
+    \raggedleft #1%
+  ]{%
+    \raggedright #2%
+  }%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\phfthmproofref at placephantommarginpar}
+%   In the |marginbottom| proof-ref style, we place an invisible |\marginpar| at
+%   the top of the proof so that the proof-ref margin note will not be shifted
+%   too high when we try to align it to the bottom of the theorem statement.  To
+%   work around a weird bug in Rev\TeX, where I get the error message `command
+%   sequence undefined: |\@captype|', I have found that a fix is to override
+%   this local invisible |\marginpar| to locally make sure the |\@captype| is
+%   defined.  The wild fix I've found---no guarantees, there are dark magic
+%   forces at work here---is the following, which you can include in your
+%   document preamble if you're banging your head against this problem and
+%   you're desperate:
+% \begin{verbatim}
+%   \makeatletter
+%   \renewcommand\phfthmproofref at placephantommarginpar{%
+%     \begingroup\csdef{@captype}{figure}\marginpar{%
+%       \vspace{-\baselineskip}\rule{0pt}{0pt}}\endgroup%
+%   }
+%   \makeatother
+% \end{verbatim}
+%    \begin{macrocode}
+\newcommand\phfthmproofref at placephantommarginpar{%
+    \leavevmode\marginpar{\vspace{-\baselineskip}\rule{\z@}{\z@}}%
+}%
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \paragraph{The \phfverb{margin} style}
+%
 % \begin{macro}{\phfthm at proofrefstyle@margin at setup}
 %   Set-up macro for the ``|margin|'' proof-ref style (displays the proof
 %   reference in the margin of the page).
@@ -2011,13 +2150,66 @@
 % \url{http://tex.stackexchange.com/a/16161/32188}}
 %    \begin{macrocode}
   \def\phfthm at proofref@impl at fmt##1##2{%
-    \leavevmode\marginpar{\proofrefsize{\proofonname{##1}{##2}}}%
+    \leavevmode\phfthmproofref at placemarginpar{%
+      \proofrefsize{\proofonname{##1}{##2}}%
+    }{%
+      \proofrefsize{\proofonname{##1}{##2}}%
+    }%
   }%
 }
 %    \end{macrocode}
 % \end{macro}
 % 
+% \paragraph{The \phfverb{marginbottom} style}
 %
+% \begin{macro}{\phfthm at proofrefstyle@marginbottom at setup}
+%   Set-up macro for the ``|marginbottom|'' proof-ref style (displays the proof
+%   reference in the margin of the page).
+%    \begin{macrocode}
+\def\phfthm at proofrefstyle@marginbottom at setup{%
+  \phfthm at proofrefstyle@default at setup
+%    \end{macrocode}
+% 
+% The proof reference should be displayed directly at the bottom, not at the end
+% of the theorem, so plug in |\phfthm at proofref@default at main| onto |... at end| and
+% not onto |... at afterlabel|.  Don't forget that these macros accept one
+% argument, the theorem label.  In |... at afterlabel| we place a dummy marginpar
+% with an invisible rule one |\baselineskip| upwards, so that we force any
+% proof-ref marginpar not to extend above the top of the theorem statement.
+%    \begin{macrocode}
+  \def\phfthm at proofref@impl at afterlabel##1{%
+    \phfthmproofref at placephantommarginpar
+  }%
+  \let\phfthm at proofref@impl at end\phfthm at proofrefstyle@default at main
+%    \end{macrocode}
+% 
+% Define the formatting callback to put the note in the margin of the page using
+% a |\marginpar|.  We use a trick to align the margin note with the bottom of
+% the paragraph.\footnote{\url{https://tex.stackexchange.com/a/388018/32188}}
+%    \begin{macrocode}
+  \def\phfthm at proofref@impl at fmt##1##2{%
+    \phfthmproofref at marginbottom@domarginpar{##1}{##2}%
+  }%
+}
+\def\phfthmproofref at marginbottom@domarginpar#1#2{%
+  \setbox\phfthm at tmp@boxa=\hbox to \marginparwidth{%
+    \parbox[b]{\marginparwidth}{\raggedleft\sloppy
+      \proofrefsize{\strut\proofonname{#1}{#2}\strut}}}%
+  \setbox\phfthm at tmp@box=\hbox to \marginparwidth{%
+    \parbox[b]{\marginparwidth}{\raggedright\sloppy
+      \proofrefsize{\strut\proofonname{#1}{#2}\strut}}}%
+  \phfthmproofref at placemarginpar{%
+    \box\phfthm at tmp@boxa%
+  }{%
+    \box\phfthm at tmp@box%
+  }%
+}
+\newbox\phfthm at tmp@box
+\newbox\phfthm at tmp@boxa
+%    \end{macrocode}
+% \end{macro}
+%
+%
 % \subsection{Thmheading definition-like environments}
 %
 %
@@ -2150,6 +2342,8 @@
 \def\definitionname{Definition}
 \def\ideaname{Idea}
 \def\questionname{Question}
+\def\claimname{Claim}
+\def\observationname{Observation}
 \def\problemname{Problem}
 %    \end{macrocode}
 % 
@@ -2230,6 +2424,8 @@
   \phfthm at thmset@default
   \phfthm at def@thmset at mktheorem{idea}{\ideaname}
   \phfthm at def@thmset at mktheorem{question}{\questionname}
+  \phfthm at def@thmset at mktheorem{claim}{\claimname}
+  \phfthm at def@thmset at mktheorem{observation}{\observationname}
   \phfthm at def@thmset at mktheorem{problem}{\problemname}
 }
 %    \end{macrocode}
@@ -2291,6 +2487,7 @@
   \KV at phfthmpkg@qedsymbolblacksquarefalse%
   \KV at phfthmpkg@prooftitleitbffalse%
   \KV at phfthmpkg@sepcountersfalse%
+  \KV at phfthmpkg@countpersectionfalse%
   \KV at phfthmpkg@proofreffalse%
   \if\relax\detokenize{#1}\relax\else%
     \PackageError{phfthm}{'resetstyle' does not take any argument.}{You
@@ -2312,13 +2509,18 @@
 \KV at phfthmpkg@sepcountersfalse
 %    \end{macrocode}
 % 
+% The \pkgoptionfmt{countpersection} option, off by default.
+%    \begin{macrocode}
+\define at boolkey{phfthmpkg}{countpersection}[true]{}
+\KV at phfthmpkg@countpersectionfalse
+%    \end{macrocode}
+% 
 %
-% The \pkgoptionfmt{proofref} option.  The proof-ref is off initially by
-% default.
+% The \pkgoptionfmt{proofref} option.  The proof-ref is on initially by default.
 %    \begin{macrocode}
 \newif\ifKV at phfthmpkg@proofref
-\KV at phfthmpkg@proofreffalse
-\def\cmdKV at phfthmpkg@proofref at style{}
+\KV at phfthmpkg@proofreftrue
+\def\cmdKV at phfthmpkg@proofref at style{default}
 %    \end{macrocode}
 % Actually define the option itself.  Here we do some customized parsing of the
 % value of the |proofref=...| option, to treat the cases |proofref=| (empty
@@ -2451,6 +2653,9 @@
   \def\phfthm at proofref@style at margin{
     \def\phfthm at val@mkthmopt at proofrefstyle{proofrefstyle=margin}
   }
+  \def\phfthm at proofref@style at marginbottom{
+    \def\phfthm at val@mkthmopt at proofrefstyle{proofrefstyle=marginbottom}
+  }
   \def\phfthm at proofref@style at longref{
 %    \end{macrocode}
 % For |longref|: by setting |\proofonname| globally, this option can be combined
@@ -2476,6 +2681,16 @@
   \def\x{%
     \phfthm at internal@execattribs{phfthm at proofref@style@}{ProofRef Style}}
   \expandafter\x\expandafter{\cmdKV at phfthmpkg@proofref at style}
+%    \end{macrocode}
+% 
+% Prepare the proof-ref option in case we don't want any proof reference
+% mechanism on.
+%
+% \changed[chg-bugfix-pkgopt-proofreffalse]{v1.1}{2019/03/12}{Bug fix: package
+% option \texttt{proofref\eqsign false} didn't have any effect}
+%    \begin{macrocode}
+\else
+  \def\phfthm at val@mkthmopt at proofrefstyle{proofref=false}
 \fi
 %    \end{macrocode}
 % 
@@ -2490,12 +2705,28 @@
 %    \end{macrocode}
 % 
 % Prepare an argument to |\phfMakeTheorem| according to the
-% \pkgoptionfmt{sepcounters} option.
+% \pkgoptionfmt{countpersection} and \pkgoptionfmt{sepcounters} options.  First
+% determine the parent counter in case \pkgoptionfmt{countpersection} is set
+% (|chapter| if |chapter| counter exists, else |section|).
 %    \begin{macrocode}
+\ifKV at phfthmpkg@countpersection
+  \ifcsname c at chapter\endcsname
+    \def\phfthm at tmp@parentcountername{chapter}
+  \else
+    \def\phfthm at tmp@parentcountername{section}
+  \fi
+\fi
 \ifKV at phfthmpkg@sepcounters
-  \def\phfthm at val@mkthmopt at counteropts{}
+  \ifKV at phfthmpkg@countpersection
+    \edef\phfthm at val@mkthmopt at counteropts{parentcounter=\phfthm at tmp@parentcountername}
+  \else
+    \def\phfthm at val@mkthmopt at counteropts{}
+  \fi
 \else
   \def\phfthm at val@mkthmopt at counteropts{counter=phfthmcounter}
+  \ifKV at phfthmpkg@countpersection
+    \numberwithin{phfthmcounter}{\phfthm at tmp@parentcountername}
+  \fi
 \fi
 %    \end{macrocode}
 % 
@@ -2525,19 +2756,19 @@
   \fi
 }
 \ifKV at phfthmpkg@smallproofs
-  \phfthm at pkgopterr@require at proofenv{smallproofs}
+  %\phfthm at pkgopterr@require at proofenv{smallproofs}
   \apptocmd\phfthm at hookproof@startcommon{%
     \def\baselinestretch{1.2}\footnotesize}{}{%
     Failed to change command \string\phfthm at hook@start at proof}
 \fi
 \ifKV at phfthmpkg@qedsymbolblacksquare
-  \phfthm at pkgopterr@require at proofenv{qedsymbolblacksquare}
+  %\phfthm at pkgopterr@require at proofenv{qedsymbolblacksquare}
   \RequirePackage{amssymb}
   \providecommand\filledsquare{\ensuremath{\blacksquare}}
   \renewcommand\qedsymbol{\text{\tiny\ensuremath{\filledsquare}}}
 \fi
 \ifKV at phfthmpkg@prooftitleitbf
-  \phfthm at pkgopterr@require at proofenv{prooftitleitbf}
+  %\phfthm at pkgopterr@require at proofenv{prooftitleitbf}
   \def\phfthm at ProofTitleFmt#1{{\itshape\bfseries#1.}}
 \fi
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/phfthm/phfthm.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/phfthm/phfthm.ins	2021-10-11 20:24:49 UTC (rev 60734)
+++ trunk/Master/texmf-dist/source/latex/phfthm/phfthm.ins	2021-10-11 20:25:04 UTC (rev 60735)
@@ -1,5 +1,5 @@
 %%
-%% Copyright (C) 2016 by Philippe Faist <philippe.faist at bluewin.ch>
+%% Copyright (C) 2016 by Philippe Faist, philippe.faist at bluewin.ch
 %%
 %% This file may be distributed and/or modified under the conditions of
 %% the LaTeX Project Public License, either version 1.3 of this license
@@ -21,7 +21,7 @@
 
 This is a generated file.
 
-Copyright (C) 2016 by Philippe Faist <philippe.faist at bluewin.ch>
+Copyright (C) 2016 by Philippe Faist, philippe.faist at bluewin.ch
 
 This file may be distributed and/or modified under the conditions of
 the LaTeX Project Public License, either version 1.3 of this license

Added: trunk/Master/texmf-dist/source/latex/phfthm/pkg.mk
===================================================================
--- trunk/Master/texmf-dist/source/latex/phfthm/pkg.mk	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/phfthm/pkg.mk	2021-10-11 20:25:04 UTC (rev 60735)
@@ -0,0 +1,188 @@
+
+#
+# Common useful definitions
+#
+LATEX = latex
+
+PDFLATEXNAME = pdflatex
+
+PDFLATEX = TEXINPUTS="$$TEXINPUTS:../phfnote" $(PDFLATEXNAME)
+PDFLATEXOPTS = -interaction=batchmode
+PDFLATEXOPTSLAST = -interaction=batchmode --synctex=1
+
+MAKEINDEX = makeindex
+
+
+#
+# Set default PREFIX. This can be overridden with 'make install PREFIX=/installation/directory'
+#
+DEFAULT_PREFIX := $(shell kpsewhich -var-value TEXMFHOME)
+PREFIX ?= $(DEFAULT_PREFIX)
+
+
+#
+# package should be set in variable PKG
+#
+PKGREADME = README.md
+
+#
+# packages may specify additional files in the distribution with this variable
+# (by default empty)
+#
+DIST_ADDITIONAL_FILES ?= 
+
+#
+# Additional files automatically generated by the .ins file, such as .def files
+# (by default empty)
+#
+ADDITIONAL_GENERATED_FILES ?= 
+
+
+# By default, the generated style file is a '.sty' latex package.  If it's a
+# '.cls' class file instead, the local Makefile will redefine this to 'cls'.
+PKGSTYEXT ?= sty
+
+PKGDTX = $(PKG).dtx
+PKGSTY = $(PKG).$(PKGSTYEXT)
+PKGINS = $(PKG).ins
+PKGPDF = $(PKG).pdf
+PKGTDSZIP = $(PKG).tds.zip
+PKGZIP = $(PKG).zip
+
+
+.PHONY: help sty cls pdf install install_sty install_cls install_doc tdszip dist clean cleanall cleansty cleancls cleanaux cleanpdf cleantdszip cleandist
+
+
+help:
+	@echo "Targets for $(PKG):"
+	@echo "make $(PKGSTYEXT)             -- generate LaTeX package file $(PKG).$(PKGSTYEXT)"
+	@echo "make pdf             -- generate pdf documentation"
+	@echo "make install         -- install style and documentation files to $(DEFAULT_PREFIX)"
+	@echo "make install PREFIX=[specify texmf directory destination]"
+	@echo "make $(PKG).tds.zip  -- create TDS.ZIP package for distribution"
+	@echo "make dist            -- create distribution ZIP, ready for upload to CTAN"
+	@echo "make clean           -- remove LaTeX auxiliary files"
+	@echo "make clean$(PKGSTYEXT)        -- remove generated style file"
+	@echo "make cleanpdf        -- remove generated pdf documentation"
+	@echo "make cleanall        -- remove all generated files, incl. distribution zip"
+
+
+clean: cleanaux
+
+cleanall: cleansty cleanaux cleanpdf cleantdszip cleandist
+
+# ------------------------------------------------
+# make sty
+# ------------------------------------------------
+
+sty: $(PKGSTY)
+
+# synonym of `sty` in case of LaTeX classes, we use same commands etc.
+cls: $(PKGSTY)
+
+$(PKGSTY): $(PKGINS) $(PKGDTX)
+	$(LATEX) $<
+
+cleansty:
+	@rm -f $(PKGSTY) $(ADDITIONAL_GENERATED_FILES)
+
+cleancls: cleansty
+
+
+# ------------------------------------------------
+# make pdf
+# ------------------------------------------------
+
+pdf: $(PKG).pdf
+
+#
+# fake index & glossary so they get a TOC entry from the beginning, and so the page
+# numbers in the index are correct.
+#
+$(PKG).aux $(PKG).idx $(PKG).glo: $(PKGDTX) $(PKGSTY)
+	DTX=$< ; echo '\\begin{theindex}\\item index here \\end{theindex}' >$${DTX%.dtx}.ind
+	DTX=$< ; echo '\\begin{theglossary}\\item changes here\\end{theglossary}' >$${DTX%.dtx}.gls
+	$(PDFLATEX) $(PDFLATEXOPTS) $<
+	$(PDFLATEX) $(PDFLATEXOPTS) $<
+	$(PDFLATEX) $(PDFLATEXOPTS) $<
+
+$(PKG).ind: $(PKG).idx
+	$(MAKEINDEX) -s gind.ist -o $@ $<
+
+$(PKG).gls: $(PKG).glo
+	$(MAKEINDEX) -s gglo.ist -o $@ $<
+
+# final steps of making the PKG.pdf doc file.  At the end, touch the ind and gls files so
+# that they don't look out-of-date (because the idx and glo files were overwritten again)
+$(PKGPDF): $(PKGDTX) $(PKG).aux $(PKG).ind $(PKG).gls
+	$(PDFLATEX) $(PDFLATEXOPTS) $<
+	$(PDFLATEX) $(PDFLATEXOPTS) $<
+	$(PDFLATEX) $(PDFLATEXOPTSLAST) $<
+	touch $(PKG).ind $(PKG).gls $(PKG).pdf
+
+
+cleanaux:
+	@rm -f *.aux *.log *.toc *.glo *.gls *.ind *.idx *.ilg *.out *.bbl *.blg *.synctex.gz *.hd
+
+cleanpdf:
+	@rm -f $(PKGPDF)
+
+# ------------------------------------------------
+# 'make install' partial installation targets
+# ------------------------------------------------
+
+#
+# The install target itself is defined per-package, in case packages want to install more
+# files (such as bibtex styles)
+#
+
+install_sty: $(PKGSTY)
+	mkdir -p $(DESTDIR)$(PREFIX)/tex/latex/$(PKG)
+	cp $(PKGSTY) $(ADDITIONAL_GENERATED_FILES)  $(DESTDIR)$(PREFIX)/tex/latex/$(PKG)
+
+install_cls: install_sty
+
+install_doc: $(PKGPDF)
+	mkdir -p $(DESTDIR)$(PREFIX)/doc/latex/$(PKG)
+	cp $(PKGPDF) $(PKGREADME)  $(DESTDIR)$(PREFIX)/doc/latex/$(PKG)
+
+
+
+# ------------------------------------------------
+# make tdszip
+# ------------------------------------------------
+
+TDSTMPDIR = $(CURDIR)/_install_tds_zip.make.tmp
+
+tdszip: $(PKGTDSZIP)
+
+$(PKGTDSZIP): $(PKGSTY) $(PKGPDF)
+	mkdir $(TDSTMPDIR)
+	$(MAKE) install PREFIX=$(TDSTMPDIR)
+	cd $(TDSTMPDIR) && zip -r $(CURDIR)/$(PKGTDSZIP) *
+	rm -rf $(TDSTMPDIR)
+
+cleantdszip:
+	@rm -f $(PKGTDSZIP)
+
+
+# ------------------------------------------------
+# make dist
+# ------------------------------------------------
+
+DISTTMPDIR = $(CURDIR)/_install_dist_zip.make.tmp
+
+dist: $(PKGZIP)
+
+# feedback from CTAN upload manager: prefer not to provide tds.zip in CTAN upload
+$(PKGZIP):  #$(PKGTDSZIP)
+	rm -rf $(DISTTMPDIR)
+	mkdir -p $(DISTTMPDIR)/$(PKG)
+#	 cp $(PKGTDSZIP) $(DISTTMPDIR)
+	cp $(PKGDTX) $(PKGINS) $(PKGPDF) $(PKGREADME) Makefile pkg.mk $(DIST_ADDITIONAL_FILES) $(DISTTMPDIR)/$(PKG)
+#	cd $(DISTTMPDIR) && zip -r $(CURDIR)/$(PKGZIP) $(PKG) $(PKGTDSZIP)
+	cd $(DISTTMPDIR) && zip -r $(CURDIR)/$(PKGZIP) $(PKG)
+	rm -rf $(DISTTMPDIR)
+
+cleandist:
+	@rm -f $(PKGZIP)


Property changes on: trunk/Master/texmf-dist/source/latex/phfthm/pkg.mk
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/phfthm/phfthm.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/phfthm/phfthm.sty	2021-10-11 20:24:49 UTC (rev 60734)
+++ trunk/Master/texmf-dist/tex/latex/phfthm/phfthm.sty	2021-10-11 20:25:04 UTC (rev 60735)
@@ -8,7 +8,7 @@
 %% 
 %% This is a generated file.
 %% 
-%% Copyright (C) 2016 by Philippe Faist <philippe.faist at bluewin.ch>
+%% Copyright (C) 2016 by Philippe Faist, philippe.faist at bluewin.ch
 %% 
 %% This file may be distributed and/or modified under the conditions of
 %% the LaTeX Project Public License, either version 1.3 of this license
@@ -22,7 +22,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
 \ProvidesPackage{phfthm}
-    [2016/08/15 v1.0 phfthm package]
+    [2021/03/01 v1.2 phfthm package]
 \RequirePackage{xkeyval}
 \RequirePackage{etoolbox}
 \RequirePackage{aliascnt}
@@ -43,6 +43,7 @@
 \define at boolkey{phfmkthm}{defnostar}[true]{}
 \define at boolkey{phfmkthm}{defstar}[true]{}
 \define at boolkey{phfmkthm}{proofref}[true]{}
+\define at cmdkey{phfmkthm}{parentcounter}{}
 \define at cmdkey{phfmkthm}{proofrefstyle}{}
 \newcommand\phfMakeTheorem[3][]{% }
   \KV at phfmkthm@aliascountertrue%
@@ -51,6 +52,7 @@
   \KV at phfmkthm@defnostartrue%
   \KV at phfmkthm@defstartrue%
   \KV at phfmkthm@proofreftrue%
+  \def\cmdKV at phfmkthm@parentcounter{}%
   \def\cmdKV at phfmkthm@proofrefstyle{default}%
   \setkeys{phfmkthm}{#1}%
   \if\relax\detokenize\expandafter{\cmdKV at phfmkthm@thmstyle}\relax%
@@ -59,7 +61,12 @@
   \fi%
   \ifKV at phfmkthm@defnostar%
     \if\relax\detokenize\expandafter{\cmdKV at phfmkthm@counter}\relax%
-      \newtheorem{phfthm@#2}{#3}%
+      \if\relax\detokenize\expandafter{\cmdKV at phfmkthm@parentcounter}\relax%
+        \edef\x{\noexpand\newtheorem{phfthm@#2}{#3}}%
+      \else
+        \edef\x{\noexpand\newtheorem{phfthm@#2}{#3}[\expandonce\cmdKV at phfmkthm@parentcounter]}%
+      \fi
+      \x
       \csdef{phfthm@#2autorefname}{#3}%
     \else%
       \ifKV at phfmkthm@aliascounter%
@@ -72,7 +79,7 @@
       \fi%
     \fi%
     \newenvironment{#2}[1][]{%
-      \begin{phfthm@#2}[##1]%
+      \begin{phfthm@#2}[{##1}]%
         \begingroup%
           \csname phfthm at hook@start@#2\endcsname{##1}%
       }{%
@@ -193,10 +200,15 @@
     \else
       \noexpand\phfthm at proof@noparselabel{##1}%
     \fi
-    \noexpand\def\noexpand\phfthm at val@displayargs{[{%
-        \expandafter\noexpand\csname phfthm at prfenv@#2 at val@proofofname\endcsname
-        {\noexpand\phfthm at val@prooftitle}%
-      }]}%
+    \noexpand\if\noexpand\relax\noexpand\detokenize%
+            \noexpand\expandafter{\noexpand\phfthm at val@prooftitle}\noexpand\relax
+      \noexpand\def\noexpand\phfthm at val@displayargs{}
+    \noexpand\else
+      \noexpand\def\noexpand\phfthm at val@displayargs{[{%
+          \expandafter\noexpand\csname phfthm at prfenv@#2 at val@proofofname\endcsname
+          {\noexpand\phfthm at val@prooftitle}%
+        }]}%
+    \noexpand\fi
   }
   \cslet{phfthm at prfenv@#2 at val@proofofname}\cmdKV at phfmkprf@proofofname%
   \csdef{phfthm at prfenv@#2 at val@pinproofanchor}{%
@@ -290,8 +302,15 @@
 \def\phfthm at proof@parselabel at maybelabel{%
   \@ifnextchar*\phfthm at proof@parselabel at label\phfthm at proof@parselabel at title%
 }
-\def\phfthm at proof@parselabel at label*#1\phfthm at proof@parselabel at END{%
+\def\phfthm at proof@parselabel at label*{%
+  \@ifnextchar*\phfthm at proof@parselabel at labelsilent\phfthm at proof@parselabel at labelnormal%
+}
+\def\phfthm at proof@parselabel at labelsilent*#1\phfthm at proof@parselabel at END{%
   \edef\phfthm at val@proofoflabel{\detokenize{#1}}%
+  \def\phfthm at val@prooftitle{}%
+}
+\def\phfthm at proof@parselabel at labelnormal#1\phfthm at proof@parselabel at END{%
+  \edef\phfthm at val@proofoflabel{\detokenize{#1}}%
   \def\phfthm at val@prooftitle{\phfthm at autoref{#1}}%
 }
 \def\phfthm at proof@parselabel at title#1\phfthm at proof@parselabel at END{%
@@ -304,7 +323,7 @@
 }
 \def\phfthm at autoref{\ref}
 \AtBeginDocument{%
-  \@ifpackageloaded{hyperref}{\def\phfthm at autoref{\autoref}}{}
+  \@ifpackageloaded{hyperref}{\def\phfthm at autoref{\autoref}}{}%
 }
 \providecommand\proofonname[2]{Proof on #2.}
 \def\proofrefsize{\footnotesize}
@@ -406,14 +425,53 @@
   \let\phfthm at proofref@impl at fmtcloseby\phfthm at proofrefstyle@default at fmtcloseby
   \let\phfthm at proofref@impl at fmt\phfthm at proofrefstyle@default at fmt
 }
+\newcommand\phfthmproofref at placemarginpar[2]{%
+  \marginpar[%
+    \raggedleft #1%
+  ]{%
+    \raggedright #2%
+  }%
+}
+\newcommand\phfthmproofref at placephantommarginpar{%
+    \leavevmode\marginpar{\vspace{-\baselineskip}\rule{\z@}{\z@}}%
+}%
 \def\phfthm at proofrefstyle@margin at setup{%
   \phfthm at proofrefstyle@default at setup
   \let\phfthm at proofref@impl at afterlabel\phfthm at proofrefstyle@default at main
   \let\phfthm at proofref@impl at end\@gobble
   \def\phfthm at proofref@impl at fmt##1##2{%
-    \leavevmode\marginpar{\proofrefsize{\proofonname{##1}{##2}}}%
+    \leavevmode\phfthmproofref at placemarginpar{%
+      \proofrefsize{\proofonname{##1}{##2}}%
+    }{%
+      \proofrefsize{\proofonname{##1}{##2}}%
+    }%
   }%
 }
+\def\phfthm at proofrefstyle@marginbottom at setup{%
+  \phfthm at proofrefstyle@default at setup
+  \def\phfthm at proofref@impl at afterlabel##1{%
+    \phfthmproofref at placephantommarginpar
+  }%
+  \let\phfthm at proofref@impl at end\phfthm at proofrefstyle@default at main
+  \def\phfthm at proofref@impl at fmt##1##2{%
+    \phfthmproofref at marginbottom@domarginpar{##1}{##2}%
+  }%
+}
+\def\phfthmproofref at marginbottom@domarginpar#1#2{%
+  \setbox\phfthm at tmp@boxa=\hbox to \marginparwidth{%
+    \parbox[b]{\marginparwidth}{\raggedleft\sloppy
+      \proofrefsize{\strut\proofonname{#1}{#2}\strut}}}%
+  \setbox\phfthm at tmp@box=\hbox to \marginparwidth{%
+    \parbox[b]{\marginparwidth}{\raggedright\sloppy
+      \proofrefsize{\strut\proofonname{#1}{#2}\strut}}}%
+  \phfthmproofref at placemarginpar{%
+    \box\phfthm at tmp@boxa%
+  }{%
+    \box\phfthm at tmp@box%
+  }%
+}
+\newbox\phfthm at tmp@box
+\newbox\phfthm at tmp@boxa
 \define at cmdkey{phfthmmkthmheading}{thmstyle}{}
 \define at cmdkey{phfthmmkthmheading}{internalcounter}{}
 \newcounter{phfthmheadingcounter}%
@@ -454,6 +512,8 @@
 \def\definitionname{Definition}
 \def\ideaname{Idea}
 \def\questionname{Question}
+\def\claimname{Claim}
+\def\observationname{Observation}
 \def\problemname{Problem}
 \def\phfthm at def@thmset at optlist{}
 \def\phfthm at def@thmset#1{%
@@ -493,6 +553,8 @@
   \phfthm at thmset@default
   \phfthm at def@thmset at mktheorem{idea}{\ideaname}
   \phfthm at def@thmset at mktheorem{question}{\questionname}
+  \phfthm at def@thmset at mktheorem{claim}{\claimname}
+  \phfthm at def@thmset at mktheorem{observation}{\observationname}
   \phfthm at def@thmset at mktheorem{problem}{\problemname}
 }
 \newcommand\phfLoadThmSet[3]{%
@@ -510,6 +572,7 @@
   \KV at phfthmpkg@qedsymbolblacksquarefalse%
   \KV at phfthmpkg@prooftitleitbffalse%
   \KV at phfthmpkg@sepcountersfalse%
+  \KV at phfthmpkg@countpersectionfalse%
   \KV at phfthmpkg@proofreffalse%
   \if\relax\detokenize{#1}\relax\else%
     \PackageError{phfthm}{'resetstyle' does not take any argument.}{You
@@ -520,9 +583,11 @@
 }
 \define at boolkey{phfthmpkg}{sepcounters}[true]{}
 \KV at phfthmpkg@sepcountersfalse
+\define at boolkey{phfthmpkg}{countpersection}[true]{}
+\KV at phfthmpkg@countpersectionfalse
 \newif\ifKV at phfthmpkg@proofref
-\KV at phfthmpkg@proofreffalse
-\def\cmdKV at phfthmpkg@proofref at style{}
+\KV at phfthmpkg@proofreftrue
+\def\cmdKV at phfthmpkg@proofref at style{default}
 \define at key{phfthmpkg}{proofref}[]{%
   \ifblank{#1}{%
     \KV at phfthmpkg@proofreftrue%
@@ -577,6 +642,9 @@
   \def\phfthm at proofref@style at margin{
     \def\phfthm at val@mkthmopt at proofrefstyle{proofrefstyle=margin}
   }
+  \def\phfthm at proofref@style at marginbottom{
+    \def\phfthm at val@mkthmopt at proofrefstyle{proofrefstyle=marginbottom}
+  }
   \def\phfthm at proofref@style at longref{
     \def\proofonname##1##2{The proof of this \phfthm at autorefnameof{##1} can
       be found on ##2.}
@@ -590,13 +658,29 @@
   \def\x{%
     \phfthm at internal@execattribs{phfthm at proofref@style@}{ProofRef Style}}
   \expandafter\x\expandafter{\cmdKV at phfthmpkg@proofref at style}
+\else
+  \def\phfthm at val@mkthmopt at proofrefstyle{proofref=false}
 \fi
 \newcounter{phfthmcounter}
 \setcounter{phfthmcounter}{0}
+\ifKV at phfthmpkg@countpersection
+  \ifcsname c at chapter\endcsname
+    \def\phfthm at tmp@parentcountername{chapter}
+  \else
+    \def\phfthm at tmp@parentcountername{section}
+  \fi
+\fi
 \ifKV at phfthmpkg@sepcounters
-  \def\phfthm at val@mkthmopt at counteropts{}
+  \ifKV at phfthmpkg@countpersection
+    \edef\phfthm at val@mkthmopt at counteropts{parentcounter=\phfthm at tmp@parentcountername}
+  \else
+    \def\phfthm at val@mkthmopt at counteropts{}
+  \fi
 \else
   \def\phfthm at val@mkthmopt at counteropts{counter=phfthmcounter}
+  \ifKV at phfthmpkg@countpersection
+    \numberwithin{phfthmcounter}{\phfthm at tmp@parentcountername}
+  \fi
 \fi
 \phfLoadThmSet%
 {[\phfthm at val@mkthmopt at counteropts,\phfthm at val@mkthmopt at proofrefstyle,
@@ -610,19 +694,19 @@
   \fi
 }
 \ifKV at phfthmpkg@smallproofs
-  \phfthm at pkgopterr@require at proofenv{smallproofs}
+  %\phfthm at pkgopterr@require at proofenv{smallproofs}
   \apptocmd\phfthm at hookproof@startcommon{%
     \def\baselinestretch{1.2}\footnotesize}{}{%
     Failed to change command \string\phfthm at hook@start at proof}
 \fi
 \ifKV at phfthmpkg@qedsymbolblacksquare
-  \phfthm at pkgopterr@require at proofenv{qedsymbolblacksquare}
+  %\phfthm at pkgopterr@require at proofenv{qedsymbolblacksquare}
   \RequirePackage{amssymb}
   \providecommand\filledsquare{\ensuremath{\blacksquare}}
   \renewcommand\qedsymbol{\text{\tiny\ensuremath{\filledsquare}}}
 \fi
 \ifKV at phfthmpkg@prooftitleitbf
-  \phfthm at pkgopterr@require at proofenv{prooftitleitbf}
+  %\phfthm at pkgopterr@require at proofenv{prooftitleitbf}
   \def\phfthm at ProofTitleFmt#1{{\itshape\bfseries#1.}}
 \fi
 \ifKV at phfthmpkg@proofenv



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