texlive[68315] trunk: ctanbib (18sep23)

commits+karl at tug.org commits+karl at tug.org
Mon Sep 18 22:07:06 CEST 2023


Revision: 68315
          https://tug.org/svn/texlive?view=revision&revision=68315
Author:   karl
Date:     2023-09-18 22:07:06 +0200 (Mon, 18 Sep 2023)
Log Message:
-----------
ctanbib (18sep23)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib
    trunk/Master/texmf-dist/doc/man/man1/ctanbib.1
    trunk/Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf
    trunk/Master/texmf-dist/doc/support/ctanbib/README.md
    trunk/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.pdf
    trunk/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex
    trunk/Master/texmf-dist/scripts/ctanbib/ctanbib

Modified: trunk/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib	2023-09-18 20:06:54 UTC (rev 68314)
+++ trunk/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib	2023-09-18 20:07:06 UTC (rev 68315)
@@ -1,7 +1,7 @@
 #!/usr/bin/env texlua
 kpse.set_program_name("luatex")
 -- ctanbib -- export ctan entries to bib format
--- Copyright: Michal Hoftich <michal.h21 at gmail.com> (2014-2021)
+-- Copyright: Michal Hoftich <michal.h21 at gmail.com> (2014-2023)
 --
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3
@@ -27,6 +27,7 @@
   -C,--ctanpath   Use package's CTAN path as URL
   -e,--entrytype  (default manual)  Change entry type
   -h,--help       Print this message
+  -p,--pkgname    Put the package name in a \ctanbibpkgname command
   -v,--version    Print version info
   ]]
 local args = lapp(msg)
@@ -34,7 +35,7 @@
   print(msg)
   os.exit(0)
 elseif args.version then
-  print "ctanbib version 0.2b"
+  print "ctanbib version 0.2c"
   os.exit(0)
 elseif args.ctan then
   pkgurl = true
@@ -74,6 +75,13 @@
 }
 ]]
 
+if args.pkgname then
+  titleformat = "The \\ctanbibpkgname{%s} package"
+  preamble = [[@preamble{ "\providecommand\ctanbibpkgname[1]{\textsl{#1}}" }
+]] 
+  bibtexformat = preamble .. bibtexformat
+end
+
 local dom = require('luaxml-domobject')
 
 local load_xml =  function(url, verification)
@@ -158,7 +166,8 @@
   local title = record:query_selector("name")[1]
   if title then
     title = title:get_text()
-    title = title:gsub("^(.)", function(a) return unicode.utf8.upper(a) end)
+    -- don't uppercase package name, as suggested by Karl Berry and Boris Veytsman
+    -- title = title:gsub("^(.)", function(a) return unicode.utf8.upper(a) end)
   else
     title = pkgname
   end

Modified: trunk/Master/texmf-dist/doc/man/man1/ctanbib.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/ctanbib.1	2023-09-18 20:06:54 UTC (rev 68314)
+++ trunk/Master/texmf-dist/doc/man/man1/ctanbib.1	2023-09-18 20:07:06 UTC (rev 68315)
@@ -1,6 +1,6 @@
 .\" Manpage for ctanbib.
 .\" Contact michal.h21 at gmail.com to correct errors or typos.
-.TH ctanbib 1 "20 feb 2023" "0.2b" "ctanbib man page"
+.TH ctanbib 1 "18 Sep 2023" "0.2c" "ctanbib man page"
 .SH NAME
 ctanbib
 \- retrieve bibliographic information for packages hosted on CTAN.
@@ -17,6 +17,9 @@
 like --ctan option, but use original url instead of CTAN path.
 .IP -h,--help 
 print the help message.
+.IP -p,--pkgname
+put the package name in a \ctanbibpkgname command. This command can be
+redefined in the document for the desired formatting.
 .IP -v,--version 
 print the version info.
 .SH EXAMPLES

Modified: trunk/Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/ctanbib/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/support/ctanbib/README.md	2023-09-18 20:06:54 UTC (rev 68314)
+++ trunk/Master/texmf-dist/doc/support/ctanbib/README.md	2023-09-18 20:07:06 UTC (rev 68315)
@@ -10,7 +10,7 @@
 More details can be found on [TeX.sx](https://tex.stackexchange.com/a/200856/2891)
 
 
-Copyright: 2021 Michal Hoftich
+Copyright: 2014–2023 Michal Hoftich
 
 This work may be distributed and/or modified under the
 conditions of the LaTeX Project Public License, either version 1.3

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

Modified: trunk/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex	2023-09-18 20:06:54 UTC (rev 68314)
+++ trunk/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex	2023-09-18 20:07:06 UTC (rev 68315)
@@ -41,6 +41,7 @@
   \item[-C,-\/-ctanpath]   use package's CTAN path as URL
   \item[-e,-\/-entrypoint] explicitly set the Bib\TeX\ entry type.
   \item[-h,-\/-help] print the help message.
+  \item[-p,-\/-pkgname] Put the package name in a \verb|\ctanbibpkgname| command.
   \item[-v,-\/-version] print the version info.
 \end{description}
 
@@ -56,7 +57,7 @@
 
 \begin{verbatim}
 @manual{latex,
-title = {The Latex package},
+title = {The latex package},
 subtitle = {A TeX macro package that defines LaTeX},
 author = {{The LaTeX Team} and Lamport, Leslie},
 url = {http://www.latex-project.org/},
@@ -78,7 +79,7 @@
 
 \begin{verbatim}
 @manual{latex,
-title = {The Latex package},
+title = {The latex package},
 ...
 url = {https://ctan.org/pkg/latex},
 ...
@@ -117,7 +118,24 @@
 }
 \end{verbatim}
 
+\noindent The \texttt{--pkgname} option:
 
+\begin{verbatim}
+ctanbib -p latex
+\end{verbatim}
+
+\noindent Puts the package name into the \verb|\ctanbibpkgname| command, which can be
+redefined by user to produce a special formatting of the name:
+
+\begin{verbatim}
+ at preamble{ "\providecommand\ctanbibpkgname[1]{\textsl{#1}}" }
+ at manual{latex,
+  title = {The \ctanbibpkgname{latex} package},
+  ...
+}
+\end{verbatim}
+
+
 \section{License}
 
 Permission is granted to copy, distribute and/or modify this software
@@ -129,11 +147,17 @@
 Daniel\footnote{\url{https://tex.stackexchange.com/users/3751/daniel}}. Lukas
 C.~Bossert had useful comments which led to update of the original script and
 it's eventual release on CTAN. Herbert Voss added the \verb|--CTAN| option.
+Karl Berry and Boris Veytsman suggested addition of the \verb|--pkgname| option 
+and leaving package names uncapitalized.
 
 \newpage
 \section{Changelog}
 
 \begin{changelog}
+  \change{2023-09-18}{Version 0.2c released}
+  \change{2023-09-14}{Renamed the \verb|--tugboat| option to \verb|--pkgname|}
+  \change{2023-09-12}{Don't capitalize package names}
+  \change{2023-09-12}{Added the \verb|--tugboat| option for creation of records suitable for the TUGboat journal}
   \change{2023-02-20}{Verson 0.2b released}
   \change{2023-02-20}{Use \verb|--ssl-no-revoke| option for Curl, to prevent SSL certificate errors}
   \change{2023-02-20}{Better handling of errors in package info downloading}

Modified: trunk/Master/texmf-dist/scripts/ctanbib/ctanbib
===================================================================
--- trunk/Master/texmf-dist/scripts/ctanbib/ctanbib	2023-09-18 20:06:54 UTC (rev 68314)
+++ trunk/Master/texmf-dist/scripts/ctanbib/ctanbib	2023-09-18 20:07:06 UTC (rev 68315)
@@ -1,7 +1,7 @@
 #!/usr/bin/env texlua
 kpse.set_program_name("luatex")
 -- ctanbib -- export ctan entries to bib format
--- Copyright: Michal Hoftich <michal.h21 at gmail.com> (2014-2021)
+-- Copyright: Michal Hoftich <michal.h21 at gmail.com> (2014-2023)
 --
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3
@@ -27,6 +27,7 @@
   -C,--ctanpath   Use package's CTAN path as URL
   -e,--entrytype  (default manual)  Change entry type
   -h,--help       Print this message
+  -p,--pkgname    Put the package name in a \ctanbibpkgname command
   -v,--version    Print version info
   ]]
 local args = lapp(msg)
@@ -34,7 +35,7 @@
   print(msg)
   os.exit(0)
 elseif args.version then
-  print "ctanbib version 0.2b"
+  print "ctanbib version 0.2c"
   os.exit(0)
 elseif args.ctan then
   pkgurl = true
@@ -74,6 +75,13 @@
 }
 ]]
 
+if args.pkgname then
+  titleformat = "The \\ctanbibpkgname{%s} package"
+  preamble = [[@preamble{ "\providecommand\ctanbibpkgname[1]{\textsl{#1}}" }
+]] 
+  bibtexformat = preamble .. bibtexformat
+end
+
 local dom = require('luaxml-domobject')
 
 local load_xml =  function(url, verification)
@@ -158,7 +166,8 @@
   local title = record:query_selector("name")[1]
   if title then
     title = title:get_text()
-    title = title:gsub("^(.)", function(a) return unicode.utf8.upper(a) end)
+    -- don't uppercase package name, as suggested by Karl Berry and Boris Veytsman
+    -- title = title:gsub("^(.)", function(a) return unicode.utf8.upper(a) end)
   else
     title = pkgname
   end



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