diff options
author | Karl Berry <karl@freefriends.org> | 2024-01-09 21:07:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-01-09 21:07:44 +0000 |
commit | c7282435cd999572e255e6d6d7f0499b71269475 (patch) | |
tree | 41e70a88d4bcbd6930546210f0f33b8ff382e99f /Master/texmf-dist/source | |
parent | 9c4f627805aa2fab14ddb10039400aaae8a56e64 (diff) |
href-ul (9jan24)
git-svn-id: svn://tug.org/texlive/trunk@69359 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/href-ul/href-ul.dtx | 46 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/href-ul/href-ul.ins | 4 |
2 files changed, 42 insertions, 8 deletions
diff --git a/Master/texmf-dist/source/latex/href-ul/href-ul.dtx b/Master/texmf-dist/source/latex/href-ul/href-ul.dtx index 82aa5e6f700..e0c410d9ccf 100644 --- a/Master/texmf-dist/source/latex/href-ul/href-ul.dtx +++ b/Master/texmf-dist/source/latex/href-ul/href-ul.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % (The MIT License) % -% Copyright (c) 2021-2022 Yegor Bugayenko +% 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 @@ -50,7 +50,7 @@ %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{href-ul} %<*package> -[31.10.20220 0.3.0 Underlined Hyperlinks] +[09.01.20240 0.4.0 Underlined Hyperlinks] %</package> %<*driver> \documentclass{ltxdoc} @@ -117,16 +117,47 @@ % \end{document} % \end{docshot} +% With the help of the |plain| package option, it's possible to avoid underscores: +% \docshotOptions{firstline=3,lastline=7} +% \begin{docshot} +% \documentclass{article} +% \pagestyle{empty} +% \usepackage[plain]{href-ul} +% \begin{document} +% This link has no underscore: \\ +% \href{https://google.com}{Google}. +% \end{document} +% \end{docshot} + % \StopEventually{} % \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.} -% First, we include two packages: +% 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{ + /href/.cd, + plain/.store in=\href@plain +} +\ProcessPgfPackageOptions{/href} +% \end{macrocode} + +% Then, we include the |ulem| package in order to enable underscores: +% \begin{macrocode} +\makeatletter +\ifdefined\href@plain\else \PassOptionsToPackage{normalem}{ulem} \RequirePackage{ulem} +\fi +\makeatother +% \end{macrocode} + +% Then, we include the |hyperref| package for PDF hyperlinks: +% \begin{macrocode} \PassOptionsToPackage{hidelinks}{hyperref} \RequirePackage{hyperref} % \end{macrocode} @@ -134,14 +165,17 @@ % \begin{macro}{\href} % Then, we define the |\href| command: % \begin{macrocode} -\makeatletter\begingroup% +\makeatletter% +\begingroup% \catcode`\$=6 % \catcode`\#=12 % \gdef\href@split$1#$2#$3\\$4{% - \hyper@@link{$1}{$2}{\uline{$4}}% + \hyper@@link{$1}{$2}{% + \ifdefined\href@plain$4\else\uline{$4}\fi}% \endgroup% }% -\endgroup\makeatother +\endgroup% +\makeatother% % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/href-ul/href-ul.ins b/Master/texmf-dist/source/latex/href-ul/href-ul.ins index abfcb368ff7..332400c0dc0 100644 --- a/Master/texmf-dist/source/latex/href-ul/href-ul.ins +++ b/Master/texmf-dist/source/latex/href-ul/href-ul.ins @@ -1,6 +1,6 @@ %% (The MIT License) %% -%% Copyright (c) 2021-2022 Yegor Bugayenko +%% 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 @@ -26,7 +26,7 @@ \preamble (The MIT License) -Copyright (c) 2021-2022 Yegor Bugayenko +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 |