texlive[64117] Master/texmf-dist: hereapplies (14aug22)
commits+karl at tug.org
commits+karl at tug.org
Sun Aug 14 22:27:30 CEST 2022
Revision: 64117
http://tug.org/svn/texlive?view=revision&revision=64117
Author: karl
Date: 2022-08-14 22:27:30 +0200 (Sun, 14 Aug 2022)
Log Message:
-----------
hereapplies (14aug22)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/hereapplies/ChangeLog.md
trunk/Master/texmf-dist/doc/latex/hereapplies/README.md
trunk/Master/texmf-dist/doc/latex/hereapplies/lyx-module/hereapplies.module
trunk/Master/texmf-dist/doc/latex/hereapplies/package.json
trunk/Master/texmf-dist/tex/latex/hereapplies/hereapplies.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/hereapplies/hereapplies-example.pdf
trunk/Master/texmf-dist/doc/latex/hereapplies/hereapplies-example.tex
trunk/Master/texmf-dist/doc/latex/hereapplies/lyx-module/hereapplies-example.lyx
Removed Paths:
-------------
trunk/Master/texmf-dist/doc/latex/hereapplies/example.png
trunk/Master/texmf-dist/doc/latex/hereapplies/example.tex
trunk/Master/texmf-dist/doc/latex/hereapplies/lyx-module/lyx-module-example.lyx
Modified: trunk/Master/texmf-dist/doc/latex/hereapplies/ChangeLog.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hereapplies/ChangeLog.md 2022-08-13 23:49:41 UTC (rev 64116)
+++ trunk/Master/texmf-dist/doc/latex/hereapplies/ChangeLog.md 2022-08-14 20:27:30 UTC (rev 64117)
@@ -2,11 +2,25 @@
==========
+## 0.3.0 (2022-08-13)
+
+Changes:
+
+* A starred version of the `\whereapplies` macro has been created
+* The label generated when `\hereapplies` is invoked with two arguments has now
+ become verbatim equal to the first argument -- previously it was equal to
+ `appl:[concept]:[label]`
+* Code review
+* The LyX module has been updated
+* Documentation
+* Examples
+
+
## 0.2.0 (2022-08-12)
Changes:
-* A starred version of `\hereapplies` has been created
+* A starred version of the `\hereapplies` macro has been created
* A module for LyX has been added to the repository
* The package now prints `??` (instead of generating an error) when
`\whereapplies` is invoked but `\hereapplies` is never invoked
Modified: trunk/Master/texmf-dist/doc/latex/hereapplies/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hereapplies/README.md 2022-08-13 23:49:41 UTC (rev 64116)
+++ trunk/Master/texmf-dist/doc/latex/hereapplies/README.md 2022-08-14 20:27:30 UTC (rev 64117)
@@ -1,13 +1,49 @@
-hereapplies.sty
-===============
+Here Applies
+============
-A LaTeX package for cross-linking applications of concepts
+A LaTeX package for cross-linking concepts to their applications
+Overview
+--------
+
+**Here Applies** is a LaTeX package that implements an _informal glossary_. Its
+core mechanism is identical to that of a conventional glossary – i.e. some
+concepts are marked as “important” and indicized every time they appear in the
+document – but it does not produce any nomenclature section, nor relies on the
+conventions that normally take part in a glossary.
+
+In fact, normally, besides an indicization mechanism, a proper glossary should
+be able to produce a dedicated section (usually at the end of the document)
+where the terms are collected in alphabetical order, their definitions are
+shown, and the lists of their occurrences are presented. By design, all these
+things but the last one are missing in **Here Applies**.
+
+Instead, the package offers only two macros: `\hereapplies` and `\whereapplies`
+(plus their “starred” versions `\hereapplies*` and `\whereapplies*`). In both
+cases a “concept name” is passed as argument – and this can be any string
+invented in the moment, as long as it contains only letters.
+
+Every time `\hereapplies` is invoked again on an identical string the document
+knows that the same concept from previous invocations is occurring at that
+point. And so every time the `\whereapplies` macro is invoked, all the
+occurrences of that concept within the entire document will be printed in the
+form of a linkable page number list (“pp. 1, 2, 3, 4, …”).
+
+As `\hereapplies` is designed to be invoked in the middle of a chapter or a
+section and make it linkable, the `\phantomsection` macro is invoked by default
+before a label is added to that place. To avoid calling `\phantomsection`,
+the “starred” macro `\hereapplies*` is available.
+
+Finally, like `\whereapplies` resembles a pluralizable version of `\pageref`,
+its “starred” version `\whereapplies*` resembles a pluralizable version of
+`\pageref*`.
+
+
Example usage
-------------
-### LaTeX source
+The following LaTeX manuscript
``` tex
\documentclass{article}
@@ -21,37 +57,89 @@
\maketitle
-This is concept one. To see this concept applied, please
-see \whereapplies{conceptone}.
+This is concept one. To find this concept applied, please
+see \whereapplies{conceptOne}.
-This is concept four. To see this concept applied, please
-see \whereapplies{conceptfour}.
+This is concept two. To find this concept applied, please
+see \whereapplies{conceptTwo}.
\newpage
-\hereapplies{conceptone}This is page \thepage. As you can see, ``concept
+\hereapplies{conceptOne}This is page \thepage. As you can see, ``concept
one'' applies here.\newpage
-\hereapplies{conceptfour}This is page \thepage. As you can see,
-``concept four'' applies here.\newpage
+\hereapplies{conceptTwo}This is page \thepage. As you can see,
+``concept two'' applies here.\newpage
-\hereapplies{conceptone}This is page \thepage. As you can see, ``concept
+\hereapplies{conceptOne}This is page \thepage. As you can see, ``concept
one'' applies here.\newpage
-\hereapplies{conceptfour}This is page \thepage. As you can see,
-``concept four'' applies here.\newpage
+\hereapplies{conceptTwo}This is page \thepage. As you can see,
+``concept two'' applies here.\newpage
-\hereapplies[myref]{conceptone}This is page \thepage. As you can
+\hereapplies[myref]{conceptOne}This is page \thepage. As you can
see, ``concept one'' applies here. This point in the document is
-labeled \texttt{appl:conceptone:myref}.
+labeled \texttt{myref}.
\end{document}
```
-### Result
+will generate [this document][1].
-![Example of hereapplies LaTeX package][1]
+A minimal tutorial
+------------------
- [1]: example.png
+### Macro `\hereapplies[label]{concept_name}`
+The `\hereapplies` macro notifies the document that a particular concept
+applies to a particular point and creates a label for it.
+
+If the optional argument is passed the label created will be named accordingly,
+otherwise an opaque name will be assigned to it. This argument may contain only
+what is legal in both `\label` and `\pageref`.
+
+The `concept_name` argument may contain only letters and the “at” sign (`@`).
+
+The “starred” version of this macro (`\hereapplies*`) does not invoke the
+`\phantomsection` directive.
+
+
+### Macro `\whereapplies{concept_name}`
+
+The `\whereapplies` macro prints all the occurrences of a concept, in the form
+“p. …” or “pp. …”
+
+The `concept_name` argument may contain only letters and the “at” sign (`@`).
+
+The “starred” version of this macro (`\whereapplies*`) will use `\pageref*`
+instead of `\pageref` for generating the page list.
+
+
+Get involved
+------------
+
+If you wish to get involved, please do not hesitate to send [merge requests][2]
+or participate in the discussion.
+
+The package is also [available on CTAN][3] under
+[`macros/latex/contrib/hereapplies`][4].
+
+For any issue, please [drop a message][5].
+
+
+Free software
+-------------
+
+**Here Applies** is free software. You can redistribute it and/or modify it
+under the terms of the **AGPL** license version 3 or any later version. See
+[COPYING][6] for details.
+
+
+ [1]: hereapplies-example.pdf
+ [2]: https://github.com/madmurphy/hereapplies.sty/pulls
+ [3]: https://www.ctan.org/pkg/hereapplies
+ [4]: https://www.ctan.org/tex-archive/macros/latex/contrib/hereapplies
+ [5]: https://github.com/madmurphy/libgnunetworker/issues
+ [6]: COPYING
+
Deleted: trunk/Master/texmf-dist/doc/latex/hereapplies/example.png
===================================================================
(Binary files differ)
Deleted: trunk/Master/texmf-dist/doc/latex/hereapplies/example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hereapplies/example.tex 2022-08-13 23:49:41 UTC (rev 64116)
+++ trunk/Master/texmf-dist/doc/latex/hereapplies/example.tex 2022-08-14 20:27:30 UTC (rev 64117)
@@ -1,36 +0,0 @@
-\documentclass{article}
-
-\usepackage{hereapplies}
-
-\begin{document}
-
-\title{Some title}
-\author{Some author}
-
-\maketitle
-
-This is concept one. To see this concept applied, please
-see \whereapplies{conceptone}.
-
-This is concept four. To see this concept applied, please
-see \whereapplies{conceptfour}.
-
-\newpage
-
-\hereapplies{conceptone}This is page \thepage. As you can see, ``concept
-one'' applies here.\newpage
-
-\hereapplies{conceptfour}This is page \thepage. As you can see,
-``concept four'' applies here.\newpage
-
-\hereapplies{conceptone}This is page \thepage. As you can see, ``concept
-one'' applies here.\newpage
-
-\hereapplies{conceptfour}This is page \thepage. As you can see,
-``concept four'' applies here.\newpage
-
-\hereapplies[myref]{conceptone}This is page \thepage. As you can
-see, ``concept one'' applies here. This point in the document is
-labeled \texttt{appl:conceptone:myref}.
-
-\end{document}
Added: trunk/Master/texmf-dist/doc/latex/hereapplies/hereapplies-example.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/hereapplies/hereapplies-example.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hereapplies/hereapplies-example.pdf 2022-08-13 23:49:41 UTC (rev 64116)
+++ trunk/Master/texmf-dist/doc/latex/hereapplies/hereapplies-example.pdf 2022-08-14 20:27:30 UTC (rev 64117)
Property changes on: trunk/Master/texmf-dist/doc/latex/hereapplies/hereapplies-example.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/hereapplies/hereapplies-example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hereapplies/hereapplies-example.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/hereapplies/hereapplies-example.tex 2022-08-14 20:27:30 UTC (rev 64117)
@@ -0,0 +1,36 @@
+\documentclass{article}
+
+\usepackage{hereapplies}
+
+\begin{document}
+
+\title{Some title}
+\author{Some author}
+
+\maketitle
+
+This is concept one. To find this concept applied, please
+see \whereapplies{conceptOne}.
+
+This is concept two. To find this concept applied, please
+see \whereapplies{conceptTwo}.
+
+\newpage
+
+\hereapplies{conceptOne}This is page \thepage. As you can see, ``concept
+one'' applies here.\newpage
+
+\hereapplies{conceptTwo}This is page \thepage. As you can see,
+``concept two'' applies here.\newpage
+
+\hereapplies{conceptOne}This is page \thepage. As you can see, ``concept
+one'' applies here.\newpage
+
+\hereapplies{conceptTwo}This is page \thepage. As you can see,
+``concept two'' applies here.\newpage
+
+\hereapplies[myref]{conceptOne}This is page \thepage. As you can
+see, ``concept one'' applies here. This point in the document is
+labeled \texttt{myref}.
+
+\end{document}
Property changes on: trunk/Master/texmf-dist/doc/latex/hereapplies/hereapplies-example.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/hereapplies/lyx-module/hereapplies-example.lyx
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hereapplies/lyx-module/hereapplies-example.lyx (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/hereapplies/lyx-module/hereapplies-example.lyx 2022-08-14 20:27:30 UTC (rev 64117)
@@ -0,0 +1,345 @@
+#LyX 2.3 created this file. For more info see http://www.lyx.org/
+\lyxformat 544
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass article
+\use_default_options false
+\begin_modules
+hereapplies
+\end_modules
+\maintain_unincluded_children false
+\language english
+\language_package none
+\inputencoding ascii
+\fontencoding default
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\paperfontsize default
+\spacing single
+\use_hyperref true
+\pdf_title "Some title"
+\pdf_author "Some author"
+\pdf_bookmarks false
+\pdf_bookmarksnumbered false
+\pdf_bookmarksopen false
+\pdf_bookmarksopenlevel 1
+\pdf_breaklinks false
+\pdf_pdfborder false
+\pdf_colorlinks false
+\pdf_backref section
+\pdf_pdfusetitle false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 0
+\use_package cancel 0
+\use_package esint 1
+\use_package mathdots 0
+\use_package mathtools 0
+\use_package mhchem 0
+\use_package stackrel 0
+\use_package stmaryrd 0
+\use_package undertilde 0
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 0
+\use_minted 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tracking_changes false
+\output_changes false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\end_header
+
+\begin_body
+
+\begin_layout Title
+Some title
+\end_layout
+
+\begin_layout Author
+Some author
+\end_layout
+
+\begin_layout Standard
+This is concept one.
+ To find this concept applied, please see
+\begin_inset Flex Where applies
+status open
+
+\begin_layout Plain Layout
+conceptOne
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+This is concept two.
+ To find this concept applied, please see
+\begin_inset Flex Where applies
+status open
+
+\begin_layout Plain Layout
+conceptTwo
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Newpage newpage
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Flex Here applies
+status open
+
+\begin_layout Plain Layout
+conceptOne
+\end_layout
+
+\end_inset
+
+This is page
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+thepage
+\end_layout
+
+\end_inset
+
+.
+ As you can see,
+\begin_inset Quotes eld
+\end_inset
+
+concept one
+\begin_inset Quotes erd
+\end_inset
+
+ applies here.
+\begin_inset Newpage newpage
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Flex Here applies
+status open
+
+\begin_layout Plain Layout
+conceptTwo
+\end_layout
+
+\end_inset
+
+This is page
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+thepage
+\end_layout
+
+\end_inset
+
+.
+ As you can see,
+\begin_inset Quotes eld
+\end_inset
+
+concept two
+\begin_inset Quotes erd
+\end_inset
+
+ applies here.
+\begin_inset Newpage newpage
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Flex Here applies
+status open
+
+\begin_layout Plain Layout
+conceptOne
+\end_layout
+
+\end_inset
+
+This is page
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+thepage
+\end_layout
+
+\end_inset
+
+.
+ As you can see,
+\begin_inset Quotes eld
+\end_inset
+
+concept one
+\begin_inset Quotes erd
+\end_inset
+
+ applies here.
+\begin_inset Newpage newpage
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Flex Here applies
+status open
+
+\begin_layout Plain Layout
+conceptTwo
+\end_layout
+
+\end_inset
+
+This is page
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+thepage
+\end_layout
+
+\end_inset
+
+.
+ As you can see,
+\begin_inset Quotes eld
+\end_inset
+
+concept two
+\begin_inset Quotes erd
+\end_inset
+
+ applies here.
+\begin_inset Newpage newpage
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Flex Here applies
+status open
+
+\begin_layout Plain Layout
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+myref
+\end_layout
+
+\end_inset
+
+conceptOne
+\end_layout
+
+\end_inset
+
+This is page
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+thepage
+\end_layout
+
+\end_inset
+
+.
+ As you can see,
+\begin_inset Quotes eld
+\end_inset
+
+concept one
+\begin_inset Quotes erd
+\end_inset
+
+ applies here.
+ This point in the document is labeled
+\family typewriter
+myref
+\family default
+.
+\end_layout
+
+\end_body
+\end_document
Property changes on: trunk/Master/texmf-dist/doc/latex/hereapplies/lyx-module/hereapplies-example.lyx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/hereapplies/lyx-module/hereapplies.module
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hereapplies/lyx-module/hereapplies.module 2022-08-13 23:49:41 UTC (rev 64116)
+++ trunk/Master/texmf-dist/doc/latex/hereapplies/lyx-module/hereapplies.module 2022-08-14 20:27:30 UTC (rev 64117)
@@ -1,6 +1,6 @@
#\DeclareLyXModule[hereapplies.sty]{Here Applies}
#DescriptionBegin
-#A module for cross-linking applications of concepts.
+#A module for cross-linking concepts to their applications.
#See the hereapplies.sty LaTeX package for more information.
#DescriptionEnd
#Authors: madmurphy
@@ -11,75 +11,79 @@
\usepackage{hereapplies}
EndPreamble
-InsetLayout Flex:Here_Applies
+InsetLayout Flex:Here_applies
LyXType custom
Decoration Classic
- LabelString "Applies"
- LatexType command
- LatexName hereapplies
- Requires hereapplies
- ForcePlain 1
- MultiPar 0
- NoInsetLayout 1
- BgColor lightgray
Font
+ Family Typewriter
Color black
Size Small
EndFont
LabelFont
+ Family Serif
Color teal
Size Small
EndFont
+ LabelString "Here applies"
+ LatexType command
+ LatexName hereapplies
+ Requires hereapplies
+ ForcePlain 1
+ MultiPar 0
+ NoInsetLayout 1
+ BgColor lightgray
Argument 1
+ Decoration Classic
LabelString "Label"
- MenuString "Occurrence label"
- Tooltip "A string that will used to build a reference label in the form “appl:concept:label”"
+ MenuString "Instance label"
+ Tooltip "A string that will become the label of the instance (which can be referenced with \ref, \pageref, etc.)"
Mandatory 0
- LabelFont
- Color blue
- EndFont
- Font
- Color red
- EndFont
EndArgument
End
-InsetLayout Flex:Here_Applies*
+InsetLayout Flex:Here_applies*
LyXType custom
Decoration Classic
- LabelString "Applies*"
- LatexType command
- LatexName hereapplies*
- Requires hereapplies
- ForcePlain 1
- MultiPar 0
- NoInsetLayout 1
- BgColor lightgray
Font
+ Family Typewriter
Color black
Size Small
EndFont
LabelFont
+ Family Serif
Color teal
Size Small
EndFont
+ LabelString "Here applies*"
+ LatexType command
+ LatexName hereapplies*
+ Requires hereapplies
+ ForcePlain 1
+ MultiPar 0
+ NoInsetLayout 1
+ BgColor lightgray
Argument 1
+ Decoration Classic
LabelString "Label"
- MenuString "Occurrence label"
- Tooltip "A string that will used to build a reference label in the form “appl:concept:label”"
+ MenuString "Instance label"
+ Tooltip "A string that will become the label of the instance (which can be referenced with \ref, \pageref, etc.)"
Mandatory 0
- LabelFont
- Color blue
- EndFont
- Font
- Color red
- EndFont
EndArgument
End
-InsetLayout Flex:Where_Applies
+InsetLayout Flex:Where_applies
LyXType custom
Decoration Classic
+ Font
+ Family Typewriter
+ Color black
+ Size Small
+ EndFont
+ LabelFont
+ Family Serif
+ Color green
+ Size Small
+ EndFont
LabelString "Applications of"
LatexType command
LatexName whereapplies
@@ -88,6 +92,11 @@
MultiPar 0
NoInsetLayout 1
BgColor lightgray
+End
+
+InsetLayout Flex:Where_applies*
+ LyXType custom
+ Decoration Classic
Font
Family Typewriter
Color black
@@ -98,5 +107,13 @@
Color green
Size Small
EndFont
+ LabelString "Applications of*"
+ LatexType command
+ LatexName whereapplies*
+ Requires hereapplies
+ ForcePlain 1
+ MultiPar 0
+ NoInsetLayout 1
+ BgColor lightgray
End
Deleted: trunk/Master/texmf-dist/doc/latex/hereapplies/lyx-module/lyx-module-example.lyx
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hereapplies/lyx-module/lyx-module-example.lyx 2022-08-13 23:49:41 UTC (rev 64116)
+++ trunk/Master/texmf-dist/doc/latex/hereapplies/lyx-module/lyx-module-example.lyx 2022-08-14 20:27:30 UTC (rev 64117)
@@ -1,345 +0,0 @@
-#LyX 2.3 created this file. For more info see http://www.lyx.org/
-\lyxformat 544
-\begin_document
-\begin_header
-\save_transient_properties true
-\origin unavailable
-\textclass article
-\use_default_options false
-\begin_modules
-hereapplies
-\end_modules
-\maintain_unincluded_children false
-\language english
-\language_package none
-\inputencoding ascii
-\fontencoding default
-\font_roman "default" "default"
-\font_sans "default" "default"
-\font_typewriter "default" "default"
-\font_math "auto" "auto"
-\font_default_family default
-\use_non_tex_fonts false
-\font_sc false
-\font_osf false
-\font_sf_scale 100 100
-\font_tt_scale 100 100
-\use_microtype false
-\use_dash_ligatures true
-\graphics default
-\default_output_format default
-\output_sync 0
-\bibtex_command default
-\index_command default
-\paperfontsize default
-\spacing single
-\use_hyperref true
-\pdf_title "Some title"
-\pdf_author "Some author"
-\pdf_bookmarks false
-\pdf_bookmarksnumbered false
-\pdf_bookmarksopen false
-\pdf_bookmarksopenlevel 1
-\pdf_breaklinks false
-\pdf_pdfborder false
-\pdf_colorlinks false
-\pdf_backref section
-\pdf_pdfusetitle false
-\papersize default
-\use_geometry false
-\use_package amsmath 1
-\use_package amssymb 0
-\use_package cancel 0
-\use_package esint 1
-\use_package mathdots 0
-\use_package mathtools 0
-\use_package mhchem 0
-\use_package stackrel 0
-\use_package stmaryrd 0
-\use_package undertilde 0
-\cite_engine basic
-\cite_engine_type default
-\biblio_style plain
-\use_bibtopic false
-\use_indices false
-\paperorientation portrait
-\suppress_date false
-\justification true
-\use_refstyle 0
-\use_minted 0
-\index Index
-\shortcut idx
-\color #008000
-\end_index
-\secnumdepth 3
-\tocdepth 3
-\paragraph_separation indent
-\paragraph_indentation default
-\is_math_indent 0
-\math_numbering_side default
-\quotes_style english
-\dynamic_quotes 0
-\papercolumns 1
-\papersides 1
-\paperpagestyle default
-\tracking_changes false
-\output_changes false
-\html_math_output 0
-\html_css_as_file 0
-\html_be_strict false
-\end_header
-
-\begin_body
-
-\begin_layout Title
-Some title
-\end_layout
-
-\begin_layout Author
-Some author
-\end_layout
-
-\begin_layout Standard
-This is concept one.
- To see this concept applied, please see
-\begin_inset Flex Where Applies
-status open
-
-\begin_layout Plain Layout
-conceptone
-\end_layout
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Standard
-This is concept four.
- To see this concept applied, please see
-\begin_inset Flex Where Applies
-status open
-
-\begin_layout Plain Layout
-conceptfour
-\end_layout
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Standard
-\begin_inset Newpage newpage
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Flex Here Applies
-status open
-
-\begin_layout Plain Layout
-conceptone
-\end_layout
-
-\end_inset
-
-This is page
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-thepage
-\end_layout
-
-\end_inset
-
-.
- As you can see,
-\begin_inset Quotes eld
-\end_inset
-
-concept one
-\begin_inset Quotes erd
-\end_inset
-
- applies here.
-\begin_inset Newpage newpage
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Flex Here Applies
-status open
-
-\begin_layout Plain Layout
-conceptfour
-\end_layout
-
-\end_inset
-
-This is page
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-thepage
-\end_layout
-
-\end_inset
-
-.
- As you can see,
-\begin_inset Quotes eld
-\end_inset
-
-concept four
-\begin_inset Quotes erd
-\end_inset
-
- applies here.
-\begin_inset Newpage newpage
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Flex Here Applies
-status open
-
-\begin_layout Plain Layout
-conceptone
-\end_layout
-
-\end_inset
-
-This is page
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-thepage
-\end_layout
-
-\end_inset
-
-.
- As you can see,
-\begin_inset Quotes eld
-\end_inset
-
-concept one
-\begin_inset Quotes erd
-\end_inset
-
- applies here.
-\begin_inset Newpage newpage
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Flex Here Applies
-status open
-
-\begin_layout Plain Layout
-conceptfour
-\end_layout
-
-\end_inset
-
-This is page
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-thepage
-\end_layout
-
-\end_inset
-
-.
- As you can see,
-\begin_inset Quotes eld
-\end_inset
-
-concept four
-\begin_inset Quotes erd
-\end_inset
-
- applies here.
-\begin_inset Newpage newpage
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Flex Here Applies
-status open
-
-\begin_layout Plain Layout
-\begin_inset Argument 1
-status open
-
-\begin_layout Plain Layout
-myref
-\end_layout
-
-\end_inset
-
-conceptone
-\end_layout
-
-\end_inset
-
-This is page
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-thepage
-\end_layout
-
-\end_inset
-
-.
- As you can see,
-\begin_inset Quotes eld
-\end_inset
-
-concept one
-\begin_inset Quotes erd
-\end_inset
-
- applies here.
- This point in the document is labeled
-\family typewriter
-appl:conceptone:myref
-\family default
-.
-\end_layout
-
-\end_body
-\end_document
Modified: trunk/Master/texmf-dist/doc/latex/hereapplies/package.json
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hereapplies/package.json 2022-08-13 23:49:41 UTC (rev 64116)
+++ trunk/Master/texmf-dist/doc/latex/hereapplies/package.json 2022-08-14 20:27:30 UTC (rev 64117)
@@ -1,7 +1,7 @@
{
"name": "hereapplies.sty",
- "version": "0.2.0",
- "description": "A LaTeX package for cross-linking applications of concepts",
+ "version": "0.3.0",
+ "description": "A LaTeX package for cross-linking concepts to their applications",
"homepage": "https://madmurphy.github.io/hereapplies.sty",
"author": "madmurphy",
"license": "AGPL-3.0-or-later",
Modified: trunk/Master/texmf-dist/tex/latex/hereapplies/hereapplies.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hereapplies/hereapplies.sty 2022-08-13 23:49:41 UTC (rev 64116)
+++ trunk/Master/texmf-dist/tex/latex/hereapplies/hereapplies.sty 2022-08-14 20:27:30 UTC (rev 64117)
@@ -3,11 +3,11 @@
%
% hereapplies.sty
%
-% A LaTeX package for cross-linking applications of concepts
+% A LaTeX package for cross-linking concepts to their applications
%
% https://github.com/madmurphy/hereapplies.sty
%
-% Version 0.2.0
+% Version 0.3.0
%
% Copyright (c) 2022 madmurphy <madmurphy333 at gmail.com>
%
@@ -39,29 +39,29 @@
%
% \maketitle
%
-% This is concept one. To see this concept applied, please
-% see \whereapplies{conceptone}.
+% This is concept one. To find this concept applied, please
+% see \whereapplies{conceptOne}.
%
-% This is concept four. To see this concept applied, please
-% see \whereapplies{conceptfour}.
+% This is concept two. To find this concept applied, please
+% see \whereapplies{conceptTwo}.
%
% \newpage
%
-% \hereapplies{conceptone}This is page \thepage. As you can see, ``concept
+% \hereapplies{conceptOne}This is page \thepage. As you can see, ``concept
% one'' applies here.\newpage
%
-% \hereapplies{conceptfour}This is page \thepage. As you can see,
-% ``concept four'' applies here.\newpage
+% \hereapplies{conceptTwo}This is page \thepage. As you can see,
+% ``concept two'' applies here.\newpage
%
-% \hereapplies{conceptone}This is page \thepage. As you can see, ``concept
+% \hereapplies{conceptOne}This is page \thepage. As you can see, ``concept
% one'' applies here.\newpage
%
-% \hereapplies{conceptfour}This is page \thepage. As you can see,
-% ``concept four'' applies here.\newpage
+% \hereapplies{conceptTwo}This is page \thepage. As you can see,
+% ``concept two'' applies here.\newpage
%
-% \hereapplies[myref]{conceptone}This is page \thepage. As you can
+% \hereapplies[myref]{conceptOne}This is page \thepage. As you can
% see, ``concept one'' applies here. This point in the document is
-% labeled \texttt{appl:conceptone:myref}.
+% labeled \texttt{myref}.
%
% \end{document}
%
@@ -77,6 +77,8 @@
%
% Assign a unique number to each applicable concept
\newcounter{@ha at concept@counter}
+% Assign a unique number to each unnamed occurrence of a concept
+\newcounter{@ha at unlabeled@counter}
%
%
% Macro `\@ha at newapplicable{concept_name}`
@@ -84,91 +86,141 @@
%
% Initialize a new applicable concept
%
-% Thie macro is for internal purposes only. When invoked it sets up the helper
+% Thie macro is for internal purposes only. When invoked, it sets up the helper
% macros, counters and auxiliary files needed for keeping track of a concept.
% If the concept was already initialized this macro will be no op.
%
+% The `concept_name` argument may contain only letters and the "at" sign (`@`).
+%
\newcommand{\@ha at newapplicable}[1]{%
% Was this concept already initialized?
- \expandafter\ifx\csname @ha at concept@#1 at cursor\endcsname\relax%
+ \expandafter\ifx\csname @ha at prop@@cursor@#1\endcsname\relax%
% The concept was never initialized
% Move the counter to the current id
\stepcounter{@ha at concept@counter}%
- % Count the unnamed occurrences
- \newcounter{@ha at concept@#1 at unnamed@counter}%
- % The content of this macro will be saved in the .haN file
- \expandafter\def\csname @ha at concept@#1 at output\endcsname{\textbf{??}}%
+ % Set the output to "??" - it will be updated by the .haN file
+ \expandafter\def\csname @ha at prop@@uoutput@#1\endcsname{\textbf{??}}%
+ % Set the starred output to "??" - it will be updated by the .haN file
+ \expandafter\def\csname @ha at prop@@soutput@#1\endcsname{\textbf{??}}%
% The last page that applies
- \expandafter\def\csname @ha at concept@#1 at cursor\endcsname{-1}%
+ \expandafter\def\csname @ha at prop@@cursor@#1\endcsname{-1}%
% Store the id of the current concept
- \expandafter\edef\csname @ha at concept@#1 at id\endcsname{\arabic{@ha at concept@counter}}%
+ \expandafter\edef\csname @ha at prop@@id@#1\endcsname{\arabic{@ha at concept@counter}}%
% Initialize the .haN file
- % The previous solution generated unwanted whitespaces:
- %\@starttoc{ha\csname @ha at concept@#1 at id\endcsname}%
- % I am thankful to David Carlisle for the following line:
- {\endlinechar=\m at ne\@starttoc{ha\csname @ha at concept@#1 at id\endcsname}}%
+ % Previous versions had this line, which created unwanted whitespaces:
+ %\@starttoc{ha\csname @ha at prop@@id@#1\endcsname}%
+ % I am thankful to David Carlisle for the following replacement:
+ {\endlinechar=\m at ne\@starttoc{ha\csname @ha at prop@@id@#1\endcsname}}%
% Store all the occurrences when the document reaches the end
\AtEndDocument{%
- % Set the .haN file as output
- \addtocontents{ha\csname @ha at concept@#1 at id\endcsname}{%
- % Check that there are occurrences
- \expandafter\ifcsname @ha at concept@#1 at cache\endcsname%
- % There are occurrences - write "p./pp. ..." to the output
- \gdef\expandafter\protect\csname @ha at concept@#1 at output\endcsname{%
- \csname @ha at concept@#1 at preamble\endcsname\csname @ha at concept@#1 at cache\endcsname%
+ % Make sure that there are occurrences
+ \expandafter\ifcsname @ha at prop@@preamble@#1\endcsname%
+ % There are occurrences
+ % When `\hereapplies` is the last directive of the document and
+ % is not followed by any text, due to an unknown bug
+ % `\whereapplies` prints "??" even when there are occurrences
+ % of a concept. Uncommenting the `\phantom` macro below fixes
+ % the bug, yet it might be wiser to leave the choice to the
+ % user and search for more final solutions in the meanwhile.
+ % The `\phantom{}` directive can also be inserted
+ % manually at the end of the document.
+ %\phantom{}%
+ % Set the .haN file as output
+ \addtocontents{ha\csname @ha at prop@@id@#1\endcsname}{%
+ % Write "p./pp. \pageref..." to the output
+ \gdef\expandafter\protect\csname @ha at prop@@uoutput@#1\endcsname{%
+ \csname @ha at prop@@preamble@#1\endcsname\csname @ha at prop@@ucache@#1\endcsname%
}%
- \else%
- % There are no occurrences - write "??" to the output
- \gdef\expandafter\protect\csname @ha at concept@#1 at output\endcsname{%
- \textbf{??}%
+ % Write "p./pp. \pageref*..." to the starred output
+ \gdef\expandafter\protect\csname @ha at prop@@soutput@#1\endcsname{%
+ \csname @ha at prop@@preamble@#1\endcsname\csname @ha at prop@@scache@#1\endcsname%
}%
- \fi%
- }%
+ }%
+ \fi%
}%
\fi%
}
%
%
-% Macro: `\starred at hereapplies[occurrence_name]{concept_name}`
+% Macro: `\@ha at getpropat{property_name}{concept_name}`
% *****************************************************************************
%
+% Get the current value of a concept's property
+%
+% Thie macro is for internal purposes (but nothing forbids invoking it
+% directly).
+%
+% Possible values for the `property_name` argument are: `cursor`, `id`,
+% `preamble`, `scache`, `soutput`, `ucache`, `uoutput`.
+%
+% The `concept_name` argument may contain only letters and the "at" sign (`@`).
+%
+\newcommand{\@ha at getpropat}[2]{%
+ % Make sure that the applicable concept is initialized
+ \@ha at newapplicable{#2}%
+ % Print all the occurrences of the concept
+ \csname @ha at prop@@#1@#2\endcsname%
+}
+%
+%
+% Macro: `\starred at labeled@hereapplies{label}{concept_name}`
+% *****************************************************************************
+%
+% Equivalent to `\hereapplies*`, but the two arguments are both mandatory
+%
+% Thie macro is for internal purposes (but nothing forbids invoking it
+% directly). See the documentation of `\hereapplies` for more information.
+%
+\newcommand{\starred at labeled@hereapplies}[2]{%
+ % Make sure that the concept has been initialized
+ \@ha at newapplicable{#2}%
+ % Assign a label to this occurrence
+ \label{#1}%
+ % If the cursor already points to the current page do nothing
+ \unless\ifnum\csname @ha at prop@@cursor@#2\endcsname=\thepage%
+ % Is this the first occurrence?
+ \expandafter\ifcsname @ha at prop@@preamble@#2\endcsname%
+ % This is *not* the first occurrence
+ % Use "pp." for the preamble when there are multiple occurrences
+ \expandafter\def\csname @ha at prop@@preamble@#2\endcsname{pp.~}%
+ % Populate the cache
+ \expandafter\g at addto@macro\csname @ha at prop@@ucache@#2\endcsname{, \pageref{#1}}%
+ % Populate the starred cache
+ \expandafter\g at addto@macro\csname @ha at prop@@scache@#2\endcsname{, \pageref*{#1}}%
+ \else%
+ % This is the first occurrence
+ % Use "p." for the preamble when there is only one occurrence
+ \expandafter\def\csname @ha at prop@@preamble@#2\endcsname{p.~}%
+ % Initialize the cache
+ \expandafter\def\csname @ha at prop@@ucache@#2\endcsname{\pageref{#1}}%
+ % Initialize the starred cache
+ \expandafter\def\csname @ha at prop@@scache@#2\endcsname{\pageref*{#1}}%
+ \fi%
+ % Make the cursor point to the current page
+ \expandafter\edef\csname @ha at prop@@cursor@#2\endcsname{\thepage}%
+ \fi%
+}
+%
+%
+% Macro: `\starred at hereapplies[label]{concept_name}`
+% *****************************************************************************
+%
% Equivalent to `\hereapplies*`
%
-% Thie macro is for internal purposes - but nothing forbids invoking it
-% directly.
+% Thie macro is for internal purposes (but nothing forbids invoking it
+% directly). See the documentation of `\hereapplies` for more information.
%
\newcommand{\starred at hereapplies}[2][]{%
- % Make sure that the concept has been initialized
- \@ha at newapplicable{#2}%
+ % Check whether the macro has been called with one or two arguments
\ifx&%
% The macro has been called with only one argument
% Assign a unique number to the unnamed occurrence
- \stepcounter{@ha at concept@#2 at unnamed@counter}%
- % Call `\starred at hereapplies` again (recursion), but this time with 2 arguments
- \edef\tmp{\noexpand\starred at hereapplies[__unnamed\arabic{@ha at concept@#2 at unnamed@counter}__]{#2}}\tmp%
+ \stepcounter{@ha at unlabeled@counter}%
+ % Call `\starred at hereapplies` with an opaque label
+ \edef\tmp{\noexpand\starred at labeled@hereapplies{#2:__appl\arabic{@ha at unlabeled@counter}__}{#2}}\tmp%
\else%
% The macro has been called with two arguments
- % Assign a label to this occurrence
- \label{appl:#2:#1}%
- % If the cursor already points to the current page do nothing
- \unless\ifnum\csname @ha at concept@#2 at cursor\endcsname=\thepage%
- % Make the cursor point to the current page
- \expandafter\edef\csname @ha at concept@#2 at cursor\endcsname{\thepage}%
- % Is this the first occurrence?
- \expandafter\ifcsname @ha at concept@#2 at cache\endcsname%
- % This is *not* the first occurrence
- % Use "pp." for the preamble when there are multiple occurrences
- \expandafter\def\csname @ha at concept@#2 at preamble\endcsname{pp.~}%
- % Populate the cache
- \expandafter\g at addto@macro\csname @ha at concept@#2 at cache\endcsname{, \pageref{appl:#2:#1}}%
- \else%
- % This is the first occurrence
- % Use "p." for the preamble when there is only one occurrence
- \expandafter\def\csname @ha at concept@#2 at preamble\endcsname{p.~}%
- % Initialize the cache
- \expandafter\def\csname @ha at concept@#2 at cache\endcsname{\pageref{appl:#2:#1}}%
- \fi%
- \fi%
+ \starred at labeled@hereapplies{#1}{#2}%
\fi%
}
%
@@ -178,18 +230,21 @@
% ===================
%
%
-% Macro: `\hereapplies[occurrence_name]{concept_name}`
+% Macro: `\hereapplies[label]{concept_name}`
% *****************************************************************************
%
-% Notify the document that here a particular concept applies
+% Notify the document that a particular concept applies and create a label for
+% it
%
-% If the `occurrence_name` argument is passed, a new label will be created in
-% the form `appl:[concept_name]:[occurrence_name]`. Without passing the
-% `occurrence_name` argument, an opaque name will be assigned to the label.
+% If the optional argument is passed the label created will be named
+% accordingly, otherwise an opaque name will be assigned to it. This argument
+% may contain only what is legal in both `\label` and `\pageref`.
%
-% The starred version of this macro (`\hereapplies*`) will not invoke the
-% `\phantomsection` directive before generating the label.
+% The `concept_name` argument may contain only letters and the "at" sign (`@`).
%
+% The starred version of this macro (`\hereapplies*`) does not invoke the
+% `\phantomsection` directive.
+%
\newcommand{\hereapplies}{%
% Check if a star is present in the invocation of the command
\@ifstar{\starred at hereapplies}{\phantomsection\relax\starred at hereapplies}%
@@ -199,12 +254,15 @@
% Macro: `\whereapplies{concept_name}`
% *****************************************************************************
%
-% Print all the applications of a concept in the form "p./pp. ..."
+% Print all the occurrences of a concept in the form "p. ..." or "pp. ..."
%
-\newcommand{\whereapplies}[1]{%
- % Make sure that the applicable concept is initialized
- \@ha at newapplicable{#1}%
- % Print all the applications of the concept
- \csname @ha at concept@#1 at output\endcsname%
+% The `concept_name` argument may contain only letters and the "at" sign (`@`).
+%
+% The starred version of this macro (`\whereapplies*`) will use `\pageref*`
+% instead of `\pageref` for generating the page list.
+%
+\newcommand{\whereapplies}{%
+ % Check if a star is present in the invocation of the command
+ \@ifstar{\@ha at getpropat{soutput}}{\@ha at getpropat{uoutput}}%
}
More information about the tex-live-commits
mailing list.