summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/TeX4ht/source/ChangeLog5
-rw-r--r--support/TeX4ht/source/tex4ht-4ht.tex4
-rw-r--r--support/TeX4ht/source/tex4ht-html4.tex4
-rwxr-xr-xsupport/ctanbib/ctanbib62
-rw-r--r--support/ctanbib/ctanbib-doc.pdfbin37822 -> 39862 bytes
-rw-r--r--support/ctanbib/ctanbib-doc.tex53
-rw-r--r--support/ctanbib/ctanbib.137
7 files changed, 114 insertions, 51 deletions
diff --git a/support/TeX4ht/source/ChangeLog b/support/TeX4ht/source/ChangeLog
index 4dd692e4a7..9ac2a7d02d 100644
--- a/support/TeX4ht/source/ChangeLog
+++ b/support/TeX4ht/source/ChangeLog
@@ -1,3 +1,8 @@
+2023-10-25 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (tabularray.4ht),
+ * tex4ht-html4.tex (html4.4ht): fixed row id attributes.
+
2023-10-24 Michal Hoftich <michal.h21@gmail.com>
* tex4ht-4ht.tex (latex.4ht): make the \@wrindex command robust.
diff --git a/support/TeX4ht/source/tex4ht-4ht.tex b/support/TeX4ht/source/tex4ht-4ht.tex
index 4a3036cffd..720483836c 100644
--- a/support/TeX4ht/source/tex4ht-4ht.tex
+++ b/support/TeX4ht/source/tex4ht-4ht.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 1397 2023-10-24 19:39:36Z michal_h21 $
+% $Id: tex4ht-4ht.tex 1398 2023-10-25 20:40:50Z michal_h21 $
% tex tex4ht-4ht or ht tex tex4ht-4ht
%
% Copyright 2009-2023 TeX Users Group
@@ -11121,7 +11121,7 @@ Insert basic tags for table and rows
}
\HLet\__tblr_environ_code:nnnn\:tempa
-\long\def\:tempa#1{\xdef\HRow{\@arabic\c@rownum}\c:tabularray\o:__tblr_build_row:N:{#1}\d:tabularray}
+\long\def\:tempa#1{\int_set:Nn \c@rownum {#1}\xdef\HRow{\@arabic\c@rownum}\c:tabularray\o:__tblr_build_row:N:{#1}\d:tabularray}
\HLet\__tblr_build_row:N\:tempa
\ExplSyntaxOff
>>>
diff --git a/support/TeX4ht/source/tex4ht-html4.tex b/support/TeX4ht/source/tex4ht-html4.tex
index 0d10aaf33e..f3a61fa344 100644
--- a/support/TeX4ht/source/tex4ht-html4.tex
+++ b/support/TeX4ht/source/tex4ht-html4.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-html4.tex 1396 2023-10-20 16:07:23Z michal_h21 $
+% $Id: tex4ht-html4.tex 1398 2023-10-25 20:40:50Z michal_h21 $
% Compile 4 times: latex tex4ht-html4
% Copy html4.4ht into the work directory before all but the last compilation.
%
@@ -2249,7 +2249,7 @@ We mainly need to handle paragraphs.
\gHAdvance\Next:TableNo by 1 \global\let\TableNo=\Next:TableNo%
\HCode{<table class="tabularray \@currenvir" id="tbl-\TableNo">}
}{\ifvmode\IgnorePar\fi\EndP\HCode{</table>}}
-{\HCode{<tr id="row-\TableNo\HRow-">}}{\HCode{</tr>}}
+{\HCode{<tr id="row-\TableNo-\HRow-">}}{\HCode{</tr>}}
{\HCode{<td id="cell\TableNo-\HRow-\HCol" style="\CellStyle" \CellAttributes>}}{\HCode{</td>}}
{\Configure{tabularrayattributes}{rowspan="\HRowspan"}}
{\Configure{tabularrayattributes}{colspan="\HMultispan"}}{}
diff --git a/support/ctanbib/ctanbib b/support/ctanbib/ctanbib
index a97819ab86..dbb54d5bff 100755
--- a/support/ctanbib/ctanbib
+++ b/support/ctanbib/ctanbib
@@ -21,21 +21,31 @@ local bibtype = "manual"
local pkgurl = false
local msg = [[ctanbib - convert ctan package information to bibtex format
Usage:
-ctanbib [options] name1 name2 ...
+ctanbib [options] PKGNAME1 PKGNAME2 ...
+
+Look up the Catalogue entry for each PKGNAME on CTAN (at
+https://ctan.org/xml/2.0/pkg/PKGNAME), and convert relevant information
+to a BibTeX entry.
+
+By default, the url field in the output entry is the package's home
+field value if that is specified in the Catalogue entry; if it isn't,
+https://ctan.org/pkg/PKGNAME is used.
+
Available options:
- -c,--ctan Use CTAN URL instead of the package homepage
- -C,--ctanpath Use package's CTAN path as URL
+ -c,--ctan Always use CTAN /pkg/ url instead of the package homepage
+ -C,--ctanpath Use the package's CTAN path as url (e.g.: /support/ctanbib)
-e,--entrytype (default manual) Change entry type
-h,--help Print this message
- -p,--pkgname Put the package name in a \ctanbibpkgname command
+ -p,--pkgname Wrap the package name in a \ctanbibpkgname command
-v,--version Print version info
- ]]
+
+ctanbib package page: https://ctan.org/pkg/ctanbib]]
local args = lapp(msg)
if args.help then
print(msg)
os.exit(0)
elseif args.version then
- print "ctanbib version 0.2c"
+ print "ctanbib version 0.2d"
os.exit(0)
elseif args.ctan then
pkgurl = true
@@ -58,20 +68,20 @@ if not pkgname then
end
local authors_url = "https://ctan.org/xml/2.0/authors"
-local license_url = "http://www.ctan.org/xml/2.0/licenses"
+local license_url = "https://www.ctan.org/xml/2.0/licenses"
-- change that for different title scheme
local titleformat = "The %s package"
local bibtexformat = [[
@manual{$package,
-title = {$title},
-subtitle = {$subtitle},
-author = {$author},
-url = {$url},
-urldate = {$urldate},
-date = {$date},
-version = {$version},
+ title = {$title},
+ subtitle = {$subtitle},
+ author = {$author},
+ url = {$url},
+ urldate = {$urldate},
+ date = {$date},
+ version = {$version},
}
]]
@@ -159,6 +169,10 @@ local get_authors = function(a)
for _, author in ipairs(a) do
table.insert(retrieved_authors, get_author(author))
end
+ -- CTAN returns authors in the random order. to fix that, we sort them.
+ -- I know that it is not a good solution for non-latin and accented names.
+ -- We could use Lua-UCA for the sorting, but I feel it is a bit of overkill.
+ table.sort(retrieved_authors)
return table.concat(retrieved_authors," and ")
end
@@ -199,6 +213,23 @@ local get_version = function(record)
end
end
+
+local get_copyright_date = function(record)
+ -- we must get the latest <copyright>, because it contains the latest date
+ local copyright_tbl = record:query_selector("copyright")
+ local copyright = copyright_tbl[#copyright_tbl]
+ if copyright then
+ local year = copyright:get_attribute("year")
+ if year then
+ -- year can hold a range of year. we will chose the newest date
+ return year:match("(%d+)$")
+ end
+
+ end
+
+end
+
+
local ctan_url = function(record, pkgname)
return "https://ctan.org/pkg/"..pkgname
end
@@ -244,6 +275,9 @@ for _, pkgname in ipairs(args) do
e.url = ctan_path(record)
end
e.version, e.date = get_version(record)
+ if not e.date then
+ e.date = get_copyright_date(record)
+ end
e.urldate = os.date("%Y-%m-%d")
local result = compile(bibtexformat, e)
diff --git a/support/ctanbib/ctanbib-doc.pdf b/support/ctanbib/ctanbib-doc.pdf
index 9ea133ce08..6ce79e042c 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 9f7ce00b8b..c13d62564b 100644
--- a/support/ctanbib/ctanbib-doc.tex
+++ b/support/ctanbib/ctanbib-doc.tex
@@ -1,4 +1,4 @@
-\documentclass{ltxdoc}
+\documentclass[11pt]{ltxdoc}
\newcommand\package[1]{\texttt{#1}}
\usepackage{longtable}
\usepackage{tabularx}
@@ -18,6 +18,13 @@
\section{Introduction}
This package provides script named \package{ctanbib} which can be used for retrieving of the bibliographic information for packages hosted on CTAN.
+It looks up the Catalogue entry for each PKGNAME on CTAN (at
+\url{https://ctan.org/xml/2.0/pkg/PKGNAME}), and convert relevant information
+to a BibTeX entry.
+
+By default, the url field in the output entry is the package's home
+field value if that is specified in the Catalogue entry; if it isn't,
+\url{https://ctan.org/pkg/PKGNAME is used}.
\section{Usage}
@@ -37,11 +44,11 @@ The \texttt{curl} utility needs to be installed on the user's system in order to
\section{Available options}
\begin{description}
- \item[-c,-\/-ctan] use the CTAN package entry as package URL instead of URL provided by the package.
- \item[-C,-\/-ctanpath] use package's CTAN path as URL
+ \item[-c,-\/-ctan] always use CTAN /pkg/ url instead of the package homepage
+ \item[-C,-\/-ctanpath] use the package's CTAN path as url (e.g.: /support/ctanbib)
\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[-p,-\/-pkgname] wrap the package name in a \verb|\ctanbibpkgname| command.
\item[-v,-\/-version] print the version info.
\end{description}
@@ -53,17 +60,17 @@ ctanbib latex
\end{verbatim}
-\noindent This invocation will print data in the Bib\LaTeX\ format to the standard output:
+\noindent This invocation will print data in the Bib(La)\TeX\ format to the standard output:
\begin{verbatim}
@manual{latex,
-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/},
-urldate = {2021-06-26},
-date = {},
-version = {2021-06-01},
+ 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/},
+ urldate = {2021-06-26},
+ date = {},
+ version = {2021-06-01},
}
\end{verbatim}
@@ -79,10 +86,10 @@ instead of the original package URL.
\begin{verbatim}
@manual{latex,
-title = {The latex package},
-...
-url = {https://ctan.org/pkg/latex},
-...
+ title = {The latex package},
+ ...
+ url = {https://ctan.org/pkg/latex},
+ ...
}
\end{verbatim}
@@ -96,9 +103,9 @@ ctanbib -C biblatex
\begin{verbatim}
@manual{biblatex,
-...
-url = {/macros/latex/contrib/biblatex},
-...
+ ...
+ url = {/macros/latex/contrib/biblatex},
+ ...
}
\end{verbatim}
@@ -114,7 +121,7 @@ ctanbib -e ctan latex
\begin{verbatim}
@ctan{latex,
-...
+ ...
}
\end{verbatim}
@@ -154,6 +161,12 @@ and leaving package names uncapitalized.
\section{Changelog}
\begin{changelog}
+ \change{2023-10-25}{Version 0.2d released}
+ \change{2023-10-20}{Sort authors alphabetically}
+ \change{2023-10-19}{Updated the \verb|--help| message}
+ \change{2023-10-16}{Use larger font in the documentation}
+ \change{2023-10-16}{Indent the Bib\TeX\ entry by two spaces}
+ \change{2023-10-08}{Get date from the copyright field if we cannot retrieve it from version}
\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}
diff --git a/support/ctanbib/ctanbib.1 b/support/ctanbib/ctanbib.1
index 246583a9d8..398919679b 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 "18 Sep 2023" "0.2c" "ctanbib man page"
+.TH ctanbib 1 "25 Oct 2023" "0.2d" "ctanbib man page"
.SH NAME
ctanbib
\- retrieve bibliographic information for packages hosted on CTAN.
@@ -9,17 +9,28 @@ ctanbib <options> [package name]
.SH DESCRIPTION
This command can retrieve bibliographic information for TeX packages hosted on
CTAN in the BibTeX format.
+
+
+Look up the Catalogue entry for each PKGNAME on CTAN (at
+https://ctan.org/xml/2.0/pkg/PKGNAME), and convert relevant information
+to a BibTeX entry.
+
+By default, the url field in the output entry is the package's home
+field value if that is specified in the Catalogue entry; if it isn't,
+https://ctan.org/pkg/PKGNAME is used.
+
.SH OPTIONS
.IP -c,--ctan
-use @ctan type instead of @manual. The difference between the two is that the
-url field contains package CTAN path, instead of link to the package.
+Always use CTAN /pkg/ url instead of the package homepage
.IP -C,--CTAN
-like --ctan option, but use original url instead of CTAN path.
+Use the package's CTAN path as url (e.g.: /support/ctanbib)
+.IP -e,--entrytype
+(default manual) Change entry type
.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.
+Wrap 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
@@ -32,13 +43,13 @@ This invocation will print data in the BibLaTeX format to the standard output:
.nf
.ft CW
@manual{latex,
-title = {The Latex package},
-subtitle = {A TeX macro package that defines LaTeX},
-author = {Lamport, Leslie and The LaTeX Team},
-url = {http://www.latex-project.org/},
-urldate = {2018-08-23},
-date = {2018-04-01},
-version = {PL 5}
+ title = {The Latex package},
+ subtitle = {A TeX macro package that defines LaTeX},
+ author = {Lamport, Leslie and The LaTeX Team},
+ url = {http://www.latex-project.org/},
+ urldate = {2018-08-23},
+ date = {2018-04-01},
+ version = {PL 5}
}
.ft R
.fi