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 --- Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'Build') diff --git a/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib b/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib index 0242c235de4..a97819ab86b 100755 --- a/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib +++ b/Build/source/texk/texlive/linked_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