texlive[74412] Master/texmf-dist: href-ul (3mar25)

commits+karl at tug.org commits+karl at tug.org
Mon Mar 3 22:16:00 CET 2025


Revision: 74412
          https://tug.org/svn/texlive?view=revision&revision=74412
Author:   karl
Date:     2025-03-03 22:15:59 +0100 (Mon, 03 Mar 2025)
Log Message:
-----------
href-ul (3mar25)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/href-ul/DEPENDS.txt
    trunk/Master/texmf-dist/doc/latex/href-ul/LICENSE.txt
    trunk/Master/texmf-dist/doc/latex/href-ul/href-ul.pdf
    trunk/Master/texmf-dist/source/latex/href-ul/href-ul.dtx
    trunk/Master/texmf-dist/source/latex/href-ul/href-ul.ins
    trunk/Master/texmf-dist/tex/latex/href-ul/href-ul.sty

Modified: trunk/Master/texmf-dist/doc/latex/href-ul/DEPENDS.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/href-ul/DEPENDS.txt	2025-03-03 21:15:48 UTC (rev 74411)
+++ trunk/Master/texmf-dist/doc/latex/href-ul/DEPENDS.txt	2025-03-03 21:15:59 UTC (rev 74412)
@@ -1,6 +1,7 @@
 hard hyperref
-hard ulem
 hard pgfopts
+hard soul
+hard url
 soft docshots
 soft environ
 soft etoolbox

Modified: trunk/Master/texmf-dist/doc/latex/href-ul/LICENSE.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/href-ul/LICENSE.txt	2025-03-03 21:15:48 UTC (rev 74411)
+++ trunk/Master/texmf-dist/doc/latex/href-ul/LICENSE.txt	2025-03-03 21:15:59 UTC (rev 74412)
@@ -1,6 +1,6 @@
 (The MIT License)
 
-Copyright (c) 2021-2024 Yegor Bugayenko
+Copyright (c) 2021-2025 Yegor Bugayenko
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the 'Software'), to deal

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

Modified: trunk/Master/texmf-dist/source/latex/href-ul/href-ul.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/href-ul/href-ul.dtx	2025-03-03 21:15:48 UTC (rev 74411)
+++ trunk/Master/texmf-dist/source/latex/href-ul/href-ul.dtx	2025-03-03 21:15:59 UTC (rev 74412)
@@ -1,25 +1,6 @@
 % \iffalse meta-comment
-% (The MIT License)
-%
-% Copyright (c) 2021-2024 Yegor Bugayenko
-%
-% Permission is hereby granted, free of charge, to any person obtaining a copy
-% of this software and associated documentation files (the 'Software'), to deal
-% in the Software without restriction, including without limitation the rights
-% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-% copies of the Software, and to permit persons to whom the Software is
-% furnished to do so, subject to the following conditions:
-%
-% The above copyright notice and this permission notice shall be included in all
-% copies or substantial portions of the Software.
-%
-% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-% SOFTWARE.
+% SPDX-FileCopyrightText: Copyright (c) 2021-2025 Yegor Bugayenko
+% SPDX-License-Identifier: MIT
 % \fi
 
 % \CheckSum{0}
@@ -50,7 +31,7 @@
 %<package>\NeedsTeXFormat{LaTeX2e}
 %<package>\ProvidesPackage{href-ul}
 %<*package>
-[2024/11/01 0.4.1 Underlined Hyperlinks]
+[2025/03/02 0.5.1 Underlined Hyperlinks]
 %</package>
 %<*driver>
 \documentclass{ltxdoc}
@@ -91,6 +72,22 @@
 %   \href{https://google.com}{Google}!
 % \end{document}
 % \end{docshot}
+%
+% The package also supports URL breaking at various special characters, allowing
+% long URLs to break naturally across lines:
+%
+% \begin{docshot}
+% \documentclass{article}
+% \pagestyle{empty}
+% \usepackage{href-ul}
+% \begin{document}
+% \parbox{7em}{
+% \href{https://google.com}{%
+% This-link-has-a-very-%
+% long-URL-that-will-break-%
+% at-appropriate-points}}
+% \end{document}
+% \end{docshot}
 
 % Changing the color of the text also changes the color of the line:
 % \begin{docshot}
@@ -134,9 +131,11 @@
 % \section{Implementation}
 % \changes{v0.2.0}{2021/06/11}{Initial version}
 % \changes{v0.3.0}{2022/10/31}{We started using "docshots" package for better rendering of examples.}
+% \changes{0.4.0}{2024/01/09}{Package options processing introduced with a single \texttt{plain} option.}
+% \changes{0.5.0}{2025/03/02}{Enhanced URL breaking functionality to improve handling of long URLs.}
+% \changes{0.5.1}{2025/03/02}{Added text breaking capabilities to the second argument of \texttt{\char`\\href} and shifted from \texttt{ulem} to \texttt{soul} package.}
 
 % First, we process package options:
-% \changes{0.4.0}{2024/01/09}{Package options processing introduced with a single \texttt{plain} option.}
 %    \begin{macrocode}
 \RequirePackage{pgfopts}
 \pgfkeys{
@@ -146,12 +145,11 @@
 \ProcessPgfPackageOptions{/href}
 %    \end{macrocode}
 
-% Then, we include the |ulem| package in order to enable underscores:
+% Then, we include the |soul| package in order to enable underscores:
 %    \begin{macrocode}
 \makeatletter
 \ifdefined\href at plain\else
-\PassOptionsToPackage{normalem}{ulem}
-\RequirePackage{ulem}
+\RequirePackage{soul}
 \fi
 \makeatother
 %    \end{macrocode}
@@ -161,10 +159,10 @@
 \PassOptionsToPackage{hidelinks}{hyperref}
 \PassOptionsToPackage{hyphens}{url}
 \RequirePackage{hyperref}
+\RequirePackage{url}
 %    \end{macrocode}
 
-% \begin{macro}{\href}
-% Then, we define the |\href| command:
+% Then, we re-define the default |\href| command:
 %    \begin{macrocode}
 \makeatletter%
 \begingroup%
@@ -172,10 +170,25 @@
 \catcode`\#=12 %
 \gdef\href at split$1#$2#$3\\$4{%
   \hyper@@link{$1}{$2}{%
-  	\ifdefined\href at plain$4\else\uline{$4}\fi}%
+    \ifdefined\href at plain$4\else\ul{$4}\fi}%
   \endgroup%
 }%
 \endgroup%
+%    \end{macrocode}
+
+% \begin{macro}{\href}
+% Then, we define our own |\href| command:
+%    \begin{macrocode}
+\let\href at orig\href
+\renewcommand{\href}[2]{%
+  \begingroup
+  \urlstyle{same}%
+  \def\UrlBreaks{\do\.\do\@\do\\\do\/\do\!\do\_\do\|\do\;\do\>\do\]%
+    \do\)\do\,\do\?\do\'\do+\do\=\do\#\do\-}%
+  \def\UrlBigBreaks{\do\:\do\/}%
+  \href at orig{#1}{#2}%
+  \endgroup
+}%
 \makeatother%
 %    \end{macrocode}
 % \end{macro}

Modified: trunk/Master/texmf-dist/source/latex/href-ul/href-ul.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/href-ul/href-ul.ins	2025-03-03 21:15:48 UTC (rev 74411)
+++ trunk/Master/texmf-dist/source/latex/href-ul/href-ul.ins	2025-03-03 21:15:59 UTC (rev 74412)
@@ -1,24 +1,5 @@
-%% (The MIT License)
-%%
-%% Copyright (c) 2021-2024 Yegor Bugayenko
-%%
-%% Permission is hereby granted, free of charge, to any person obtaining a copy
-%% of this software and associated documentation files (the 'Software'), to deal
-%% in the Software without restriction, including without limitation the rights
-%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-%% copies of the Software, and to permit persons to whom the Software is
-%% furnished to do so, subject to the following conditions:
-%%
-%% The above copyright notice and this permission notice shall be included in all
-%% copies or substantial portions of the Software.
-%%
-%% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-%% SOFTWARE.
+%% SPDX-FileCopyrightText: Copyright (c) 2021-2025 Yegor Bugayenko
+%% SPDX-License-Identifier: MIT
 
 \input docstrip.tex
 \keepsilent
@@ -26,7 +7,7 @@
 \preamble
 (The MIT License)
 
-Copyright (c) 2021-2024 Yegor Bugayenko
+Copyright (c) 2021-2025 Yegor Bugayenko
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the 'Software'), to deal

Modified: trunk/Master/texmf-dist/tex/latex/href-ul/href-ul.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/href-ul/href-ul.sty	2025-03-03 21:15:48 UTC (rev 74411)
+++ trunk/Master/texmf-dist/tex/latex/href-ul/href-ul.sty	2025-03-03 21:15:59 UTC (rev 74412)
@@ -7,7 +7,7 @@
 %% href-ul.dtx  (with options: `package')
 %% (The MIT License)
 %% 
-%% Copyright (c) 2021-2024 Yegor Bugayenko
+%% Copyright (c) 2021-2025 Yegor Bugayenko
 %% 
 %% Permission is hereby granted, free of charge, to any person obtaining a copy
 %% of this software and associated documentation files (the 'Software'), to deal
@@ -31,7 +31,7 @@
 
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{href-ul}
-[2024/11/01 0.4.1 Underlined Hyperlinks]
+[2025/03/02 0.5.1 Underlined Hyperlinks]
 
 
 
@@ -48,8 +48,7 @@
 
 \makeatletter
 \ifdefined\href at plain\else
-\PassOptionsToPackage{normalem}{ulem}
-\RequirePackage{ulem}
+\RequirePackage{soul}
 \fi
 \makeatother
 
@@ -56,6 +55,7 @@
 \PassOptionsToPackage{hidelinks}{hyperref}
 \PassOptionsToPackage{hyphens}{url}
 \RequirePackage{hyperref}
+\RequirePackage{url}
 
 \makeatletter%
 \begingroup%
@@ -63,10 +63,21 @@
 \catcode`\#=12 %
 \gdef\href at split$1#$2#$3\\$4{%
   \hyper@@link{$1}{$2}{%
-   \ifdefined\href at plain$4\else\uline{$4}\fi}%
+    \ifdefined\href at plain$4\else\ul{$4}\fi}%
   \endgroup%
 }%
 \endgroup%
+
+\let\href at orig\href
+\renewcommand{\href}[2]{%
+  \begingroup
+  \urlstyle{same}%
+  \def\UrlBreaks{\do\.\do\@\do\\\do\/\do\!\do\_\do\|\do\;\do\>\do\]%
+    \do\)\do\,\do\?\do\'\do+\do\=\do\#\do\-}%
+  \def\UrlBigBreaks{\do\:\do\/}%
+  \href at orig{#1}{#2}%
+  \endgroup
+}%
 \makeatother%
 
 



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