texlive[70176] Master/texmf-dist: cleveref-forward (26feb24)

commits+karl at tug.org commits+karl at tug.org
Mon Feb 26 21:58:57 CET 2024


Revision: 70176
          https://tug.org/svn/texlive?view=revision&revision=70176
Author:   karl
Date:     2024-02-26 21:58:57 +0100 (Mon, 26 Feb 2024)
Log Message:
-----------
cleveref-forward (26feb24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/cleveref-forward/README.md
    trunk/Master/texmf-dist/doc/latex/cleveref-forward/demo/cleveref-forward-demo.pdf
    trunk/Master/texmf-dist/doc/latex/cleveref-forward/demo/cleveref-forward-demo.tex
    trunk/Master/texmf-dist/tex/latex/cleveref-forward/cleveref-forward.sty

Modified: trunk/Master/texmf-dist/doc/latex/cleveref-forward/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/cleveref-forward/README.md	2024-02-26 20:58:47 UTC (rev 70175)
+++ trunk/Master/texmf-dist/doc/latex/cleveref-forward/README.md	2024-02-26 20:58:57 UTC (rev 70176)
@@ -2,24 +2,26 @@
 
 # `cleveref-forward` — Forward-referencing functionality for cleveref
 
-`cleveref-forward` aims at providing the forward-referencing functionality to `cleveref`.
+`cleveref-forward` aims at providing the forward-referencing functionality for the package `cleveref`.
 
-This package is derived from the package [`cleveref-usedon`](https://ctan.org/pkg/cleveref-usedon), with several fixes and enhancements.
+> This package is derived from the package [`cleveref-usedon`](https://ctan.org/pkg/cleveref-usedon), with several fixes and enhancements.
 
+> Package dependencies: [`cleveref`](https://ctan.org/pkg/cleveref), [*`crefthe`*](https://ctan.org/pkg/crefthe), [`iflang`](https://ctan.org/pkg/iflang), [`regexpatch`](https://ctan.org/pkg/regexpatch).
+
 ## Regarding the usage
 
 It might be a good idea to start with the [demo documents](https://github.com/Jinwen-XU/cleveref-forward/tree/main/demo).
 
-> The documentation and examples written by Sven Pistre for the original package [`cleveref-usedon`](https://ctan.org/pkg/cleveref-usedon) are also very inspiring (but be aware that the usage has changed a lot, so some of the code there may no longer work here).
+> The [documentation](http://mirrors.ctan.org/macros/latex/contrib/cleveref-usedon/cleveref-usedon.pdf) and [examples](https://github.com/SvenPistre/cleveref-usedon/tree/main/examples) written by Sven Pistre for the original package `cleveref-usedon` are also very inspiring (but be aware that the usage has changed a lot, so some of the code there may no longer work here).
 
 ## Known issues / what to do next
 
-- The multilingual support is not yet perfect.
-- The code is somewhat messy for now, and the naming of many macros should be made better.
-- The support for displayed maths is still not perfect.
-- Not all configuration yields nice result, more examples are needed.
+- This package currently works for English, French, German, Italian and Spanish — certainly more languages would be added to this list in the future.
+- The code is somewhat messy for now, and the naming of many macros could be improved.
+- The support for displayed maths is still not perfect: currently, if you choose to print the forward-referencing message outside the math environment, then for `equation`, `multline` and `dmath`, it works nicely (you may need to configure `cleveref` to make it work with `dmath`); but for `align`, `flalign`, `alignat` and `gather`, it would only show the message for the last labeled line. The inside-math mode has no such limitation, but it would require sufficient margin width.
+- Not all configuration yields nice result, more appealing examples are needed.
 
-The original package [`cleveref-usedon`](https://ctan.org/pkg/cleveref-usedon) is better in terms of documentation, while the current package is slightly more advanced in terms of code. It is hoped that one day they can be combined into a better version.
+The original package [`cleveref-usedon`](https://ctan.org/pkg/cleveref-usedon) is nicer in terms of documentation, while the current package is slightly more advanced in terms of code. It is hoped that one day they can be combined into a better version.
 
 
 ## Acknowledgement

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

Modified: trunk/Master/texmf-dist/doc/latex/cleveref-forward/demo/cleveref-forward-demo.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/cleveref-forward/demo/cleveref-forward-demo.tex	2024-02-26 20:58:47 UTC (rev 70175)
+++ trunk/Master/texmf-dist/doc/latex/cleveref-forward/demo/cleveref-forward-demo.tex	2024-02-26 20:58:57 UTC (rev 70176)
@@ -1,5 +1,5 @@
 \documentclass[
-    use style = plain,
+    % use style = plain,
     title in boldface,
     % title in sffamily,
     emphasize theorems,
@@ -8,6 +8,8 @@
 ]{einfart}
 \usepackage{ProjLib}
 
+\setmonofont[Scale=.9]{Iosevka}
+
 \usepackage[crefthe]{cleveref-forward}
 \usepackage{changepage,todonotes,marginnote}
 
@@ -32,7 +34,7 @@
     breaklines = true,
     frame = lines,
     backgroundcolor = \color{code-background},
-    flexiblecolumns = true,
+    basewidth = .5em,
     escapeinside = {(*}{*)},
     alsoletter = {_,:},
     % numbers = left,
@@ -81,8 +83,8 @@
 \lstnewenvironment{code}{\setstretch{1.05}\LocallyStopLineNumbers}{\ResumeLineNumbers\vspace{-.3\baselineskip}\vspace{-.5\parskip}}
 \lstnewenvironment{code*}{\setstretch{1.05}\lstset{numbers=left}\LocallyStopLineNumbers}{\ResumeLineNumbers\vspace{-.3\baselineskip}\vspace{-.5\parskip}}
 
-\newcommand{\packageoption}[1]{\texttt{\textcolor{code-option}{#1}}}
-\newcommand{\commandoption}[1]{\texttt{\textcolor{code-keys}{#1}}}
+\newcommand{\packageoption}[1]{\textcolor{code-option}{\texttt{#1}}}
+\newcommand{\commandoption}[1]{\textcolor{code-keys}{\texttt{#1}}}
 
 %%================================
 %% tip
@@ -157,7 +159,7 @@
 
 \section{Specify a default option}
 
-If you wish to apply the mode \commandoption{used on}, or \commandoption{used by}, or \commandoption{used by and on} to all \lstinline|\cref| (and \lstinline|\labelcref|, etc.), you can use the package option \packageoption{default = }\meta{mode}. Then you don't need to write it everywhere. And if you wish to manually change this \meta{mode} somewhere, you can still specify it as the command option; and if you don't want the message to display for some references, you may also use the option \commandoption{no use} on the corresponding \lstinline|\label| to disable the related messages.
+If you wish to apply the mode \commandoption{used on}, or \commandoption{used by}, or \commandoption{used by and on} to all \lstinline|\cref| (and \lstinline|\labelcref|, etc.), you can use the package option \packageoption{default=}\meta{mode}. Then you don't need to write it everywhere. And if you wish to manually change this \meta{mode} somewhere, you can still specify it as the command option; and if you don't want the message to display for some references, you may also use the option \commandoption{no use} on the corresponding \lstinline|\label| to disable the related messages.
 
 
 \section{Customizations}
@@ -177,7 +179,7 @@
 \SetUsedByAndOnMessageText{Appears in~#1 on~#2.}
 
 \bigskip
-And here is an example of setting the message style with \textsf{todonotes}:
+And here is an example of setting the message style with the package \textsf{todonotes}:
 
 \begin{code}
 \SetForwardReferenceStyle
@@ -263,7 +265,7 @@
 \bigskip
 As you might have noticed, \lstinline|\SetForwardReferenceStyleOutsideMath| is for setting the style of those messages that appear outside the equations.
 
-There is also a \lstinline|\SetForwardReferenceStyleInsideMath|, which triggers the message immediately at where you placed the label. This way it is only plausible to put the message inside the margin. For example, you may configure:
+There is also a \lstinline|\SetForwardReferenceStyleInsideMath|, which triggers the message immediately at where you placed the label. This way it is only plausible to put the message inside the margin. For example, with the package \textsf{marginnote} loaded, you may configure:
 
 \begin{code}
 \SetForwardReferenceStyle
@@ -348,7 +350,7 @@
 %% You can safely ignore the code between \ExplSyntaxOn and \ExplSyntaxOff
 %% They are just for resetting the theorem referencing style for the rest of the document
 \ExplSyntaxOn
-\input{create-theorem-preset-names} % simple-name mode is not suitable for French, German, etc.
+\input{create-theorem-preset-names-cleveref} % simple-name mode is not suitable for French, German, etc.
 \exp_args:No \SetTheorem { \c_projlib_theorem_supported_clist, theorem-with-name } % remove the text style in the references
   {
     name style = {

Modified: trunk/Master/texmf-dist/tex/latex/cleveref-forward/cleveref-forward.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/cleveref-forward/cleveref-forward.sty	2024-02-26 20:58:47 UTC (rev 70175)
+++ trunk/Master/texmf-dist/tex/latex/cleveref-forward/cleveref-forward.sty	2024-02-26 20:58:57 UTC (rev 70176)
@@ -13,7 +13,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}[2022-06-01]
 \ProvidesExplPackage{cleveref-forward}
-  {2024/02/24} {}
+  {2024/02/25} {}
   {Forward-referencing functionality for cleveref}
 
 \keys_define:nn { cleveref-forward }
@@ -21,28 +21,28 @@
     , default        .tl_set:N   = \l__crfwd_default_package_option_tl
     , default        .initial:n  = { }
     , default        .value_required:n = true
-    , Used-On        .meta:n     = { default = UsedOn }
-    , Used~On        .meta:n     = { default = UsedOn }
-    , Used On        .meta:n     = { default = UsedOn }
-    , used-on        .meta:n     = { default = UsedOn }
-    , used~on        .meta:n     = { default = UsedOn }
-    , used on        .meta:n     = { default = UsedOn }
-    , uo             .meta:n     = { default = UsedOn }
-    , Used-By        .meta:n     = { default = UsedBy }
-    , Used~By        .meta:n     = { default = UsedBy }
-    , Used By        .meta:n     = { default = UsedBy }
-    , used-by        .meta:n     = { default = UsedBy }
-    , used~by        .meta:n     = { default = UsedBy }
-    , used by        .meta:n     = { default = UsedBy }
-    , ub             .meta:n     = { default = UsedBy }
-    , Used-By-And-On .meta:n     = { default = UsedByAndOn }
-    , Used~By~And~On .meta:n     = { default = UsedByAndOn }
-    , Used By And On .meta:n     = { default = UsedByAndOn }
-    , used-by-and-on .meta:n     = { default = UsedByAndOn }
-    , used~by~and~on .meta:n     = { default = UsedByAndOn }
-    , used by and on .meta:n     = { default = UsedByAndOn }
-    , ubao           .meta:n     = { default = UsedByAndOn }
-    , ubo            .meta:n     = { default = UsedByAndOn }
+    , Used-On        .meta:n     = { default = used-on }
+    , Used~On        .meta:n     = { default = used-on }
+    , Used On        .meta:n     = { default = used-on }
+    , used-on        .meta:n     = { default = used-on }
+    , used~on        .meta:n     = { default = used-on }
+    , used on        .meta:n     = { default = used-on }
+    , uo             .meta:n     = { default = used-on }
+    , Used-By        .meta:n     = { default = used-by }
+    , Used~By        .meta:n     = { default = used-by }
+    , Used By        .meta:n     = { default = used-by }
+    , used-by        .meta:n     = { default = used-by }
+    , used~by        .meta:n     = { default = used-by }
+    , used by        .meta:n     = { default = used-by }
+    , ub             .meta:n     = { default = used-by }
+    , Used-By-And-On .meta:n     = { default = used-by-and-on }
+    , Used~By~And~On .meta:n     = { default = used-by-and-on }
+    , Used By And On .meta:n     = { default = used-by-and-on }
+    , used-by-and-on .meta:n     = { default = used-by-and-on }
+    , used~by~and~on .meta:n     = { default = used-by-and-on }
+    , used by and on .meta:n     = { default = used-by-and-on }
+    , ubao           .meta:n     = { default = used-by-and-on }
+    , ubo            .meta:n     = { default = used-by-and-on }
 
     , crefthe        .bool_set:N = \l__crfwd_crefthe_enabled_bool
     , crefthe        .initial:n  = { false }
@@ -57,14 +57,16 @@
     \RequirePackage { crefthe }
   }
 
-\newcommand*{\@setcpagerefrange}[3]{%
+% Fix for cleveref in order to work with long range of pages
+% See https://tex.stackexchange.com/a/620066
+\providecommand*{\@setcpagerefrange}[3]{%
     \@@setcpagerefrange{#1}{#2}{cref}{#3}}
-\newcommand*{\@setCpagerefrange}[3]{%
+\providecommand*{\@setCpagerefrange}[3]{%
     \@@setcpagerefrange{#1}{#2}{Cref}{#3}}
-\newcommand*{\@setlabelcpagerefrange}[3]{%
+\providecommand*{\@setlabelcpagerefrange}[3]{%
     \@@setcpagerefrange{#1}{#2}{labelcref}{#3}}
 
-% Temporary fix for cleveref in order to work with xr-hyper
+% Fix for cleveref in order to work with xr-hyper
 % See https://tex.stackexchange.com/a/708445
 \def\cref at getref#1#2{%
   \expandafter\let\expandafter#2\csname r@#1 at cref\endcsname%



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