From 64fb9a735879cbc1eb894261f88232cfdfeaa59f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 18 Sep 2023 20:07:06 +0000 Subject: ctanbib (18sep23) git-svn-id: svn://tug.org/texlive/trunk@68315 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/man/man1/ctanbib.1 | 5 +++- Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf | Bin 19997 -> 20210 bytes Master/texmf-dist/doc/support/ctanbib/README.md | 2 +- .../texmf-dist/doc/support/ctanbib/ctanbib-doc.pdf | Bin 36316 -> 37822 bytes .../texmf-dist/doc/support/ctanbib/ctanbib-doc.tex | 28 +++++++++++++++++++-- Master/texmf-dist/scripts/ctanbib/ctanbib | 15 ++++++++--- 6 files changed, 43 insertions(+), 7 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/man/man1/ctanbib.1 b/Master/texmf-dist/doc/man/man1/ctanbib.1 index 488869a35ce..246583a9d88 100644 --- a/Master/texmf-dist/doc/man/man1/ctanbib.1 +++ b/Master/texmf-dist/doc/man/man1/ctanbib.1 @@ -1,6 +1,6 @@ .\" Manpage for ctanbib. .\" Contact michal.h21@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 @@ url field contains package CTAN path, instead of link to the package. 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 diff --git a/Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf b/Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf index 9727b303992..557a152c38d 100644 Binary files a/Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf and b/Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf differ diff --git a/Master/texmf-dist/doc/support/ctanbib/README.md b/Master/texmf-dist/doc/support/ctanbib/README.md index a6147f125d7..fc4afe1bccc 100644 --- a/Master/texmf-dist/doc/support/ctanbib/README.md +++ b/Master/texmf-dist/doc/support/ctanbib/README.md @@ -10,7 +10,7 @@ This script can generate BibTeX records for LaTeX packages hosted on CTAN. 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 diff --git a/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.pdf b/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.pdf index aaeca921e01..9ea133ce088 100644 Binary files a/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.pdf and b/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.pdf differ diff --git a/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex b/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex index 2878951c3a6..9f7ce00b8be 100644 --- a/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex +++ b/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex @@ -41,6 +41,7 @@ The \texttt{curl} utility needs to be installed on the user's system in order to \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 @@ ctanbib latex \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 @@ instead of the original package URL. \begin{verbatim} @manual{latex, -title = {The Latex package}, +title = {The latex package}, ... url = {https://ctan.org/pkg/latex}, ... @@ -117,6 +118,23 @@ ctanbib -e ctan latex } \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} +@preamble{ "\providecommand\ctanbibpkgname[1]{\textsl{#1}}" } +@manual{latex, + title = {The \ctanbibpkgname{latex} package}, + ... +} +\end{verbatim} + \section{License} @@ -129,11 +147,17 @@ This package was created thanks to TeX.sx user 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} diff --git a/Master/texmf-dist/scripts/ctanbib/ctanbib b/Master/texmf-dist/scripts/ctanbib/ctanbib index 0242c235de4..a97819ab86b 100755 --- a/Master/texmf-dist/scripts/ctanbib/ctanbib +++ b/Master/texmf-dist/scripts/ctanbib/ctanbib @@ -1,7 +1,7 @@ #!/usr/bin/env texlua kpse.set_program_name("luatex") -- ctanbib -- export ctan entries to bib format --- Copyright: Michal Hoftich (2014-2021) +-- Copyright: Michal Hoftich (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 @@ Available options: -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 @@ if args.help then 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 @@ version = {$version}, } ]] +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 get_title = function(record) 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 -- cgit v1.2.3