summaryrefslogtreecommitdiff
path: root/support/ctanbib
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-09-19 03:01:15 +0000
committerNorbert Preining <norbert@preining.info>2023-09-19 03:01:15 +0000
commit23c5f33b784af6cc6c4ee2f5482ef5f21c774006 (patch)
tree08d8a2ff1d038a4af70438c37ce6a36adb202fc6 /support/ctanbib
parent04fec36be1d386c1f8d5a57c3cd613d494a5c323 (diff)
CTAN sync 202309190301
Diffstat (limited to 'support/ctanbib')
-rw-r--r--support/ctanbib/README.md2
-rwxr-xr-xsupport/ctanbib/ctanbib15
-rw-r--r--support/ctanbib/ctanbib-doc.pdfbin36316 -> 37822 bytes
-rw-r--r--support/ctanbib/ctanbib-doc.tex28
-rw-r--r--support/ctanbib/ctanbib.15
5 files changed, 43 insertions, 7 deletions
diff --git a/support/ctanbib/README.md b/support/ctanbib/README.md
index a6147f125d..fc4afe1bcc 100644
--- a/support/ctanbib/README.md
+++ b/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/support/ctanbib/ctanbib b/support/ctanbib/ctanbib
index 0242c235de..a97819ab86 100755
--- a/support/ctanbib/ctanbib
+++ b/support/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 <michal.h21@gmail.com> (2014-2021)
+-- Copyright: Michal Hoftich <michal.h21@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 @@ 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
diff --git a/support/ctanbib/ctanbib-doc.pdf b/support/ctanbib/ctanbib-doc.pdf
index aaeca921e0..9ea133ce08 100644
--- a/support/ctanbib/ctanbib-doc.pdf
+++ b/support/ctanbib/ctanbib-doc.pdf
Binary files differ
diff --git a/support/ctanbib/ctanbib-doc.tex b/support/ctanbib/ctanbib-doc.tex
index 2878951c3a..9f7ce00b8b 100644
--- a/support/ctanbib/ctanbib-doc.tex
+++ b/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/support/ctanbib/ctanbib.1 b/support/ctanbib/ctanbib.1
index 488869a35c..246583a9d8 100644
--- a/support/ctanbib/ctanbib.1
+++ b/support/ctanbib/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