summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-06-20 19:57:54 +0000
committerKarl Berry <karl@freefriends.org>2021-06-20 19:57:54 +0000
commit1fd83a5e467e9bc72220664c2ced44600eae89de (patch)
tree873d107911ea6e1c14fc5e05f8cdf5b0b3ee9095 /Master/texmf-dist
parent6586e04e3d94e8f8f6e7459fd81b8b45937deaef (diff)
ctanbib (20jun21)
git-svn-id: svn://tug.org/texlive/trunk@59659 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/man/man1/ctanbib.12
-rw-r--r--Master/texmf-dist/doc/man/man1/ctanbib.man1.pdfbin20186 -> 21346 bytes
-rw-r--r--Master/texmf-dist/doc/support/ctanbib/README.md2
-rw-r--r--Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.pdfbin34681 -> 35575 bytes
-rw-r--r--Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex6
-rwxr-xr-xMaster/texmf-dist/scripts/ctanbib/ctanbib27
6 files changed, 27 insertions, 10 deletions
diff --git a/Master/texmf-dist/doc/man/man1/ctanbib.1 b/Master/texmf-dist/doc/man/man1/ctanbib.1
index baa40b1190a..54544054c89 100644
--- a/Master/texmf-dist/doc/man/man1/ctanbib.1
+++ b/Master/texmf-dist/doc/man/man1/ctanbib.1
@@ -13,6 +13,8 @@ CTAN in the BibTeX format.
.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.
+.IP -C,--CTAN
+like --ctan option, but use original url instead of CTAN path.
.IP -h,--help
print the help message.
.IP -v,--version
diff --git a/Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf b/Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf
index 975df448c6f..7741af220b5 100644
--- a/Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ctanbib/README.md b/Master/texmf-dist/doc/support/ctanbib/README.md
index edd016e5619..263cd82a1a1 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: 2018 Michal Hoftich
+Copyright: 2019 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 b665ab7762e..ec58084d270 100644
--- a/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.pdf
+++ b/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex b/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex
index 651d0058e6c..89b99279b51 100644
--- a/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex
+++ b/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex
@@ -36,6 +36,7 @@ The \texttt{curl} utility needs to be installed on the user's system in order to
\item[-c,-\/-ctan] use the \texttt{@ctan} type instead of \texttt{@manual}.
The difference between the two is that the url field contains packages CTAN
path, instead of a link to the package.
+ \item[-C,-\/-CTAN] like \verb|--ctan| option, but use original url instead of CTAN path.
\item[-h,-\/-help] print the help message.
\item[-v,-\/-version] print the version info.
\end{description}
@@ -93,12 +94,15 @@ under the terms of the \LaTeX\ Project Public License, version 1.3.
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.
+it's eventual release on CTAN. Herbert Voss added the \verb|--CTAN| option.
\newpage
\section{Changelog}
\begin{changelog}
+ \change{2021-06-20}{Added \verb|--CTAN| option, thanks to Herbert Voss}
+ \change{2019-12-23}{Don't return non-zero exit codes for non-error runs}
+ \change{2019-12-23}{Test for the packagename with the \texttt{-c} option}
\change{2019-09-21}{Try to find the author in full CTAN author list if the author cannot be found in the package info}
\change{2019-09-16}{Use the CTAN API 2.0 to fetch the package info}
\change{2019-05-04}{Version 0.1c released}
diff --git a/Master/texmf-dist/scripts/ctanbib/ctanbib b/Master/texmf-dist/scripts/ctanbib/ctanbib
index 21adfd46792..a16976acdc4 100755
--- a/Master/texmf-dist/scripts/ctanbib/ctanbib
+++ b/Master/texmf-dist/scripts/ctanbib/ctanbib
@@ -16,26 +16,38 @@ kpse.set_program_name("luatex")
-- The Current Maintainer of this work is Michal Hoftich
local bibtype = "manual"
+local pkgurl = false
if #arg < 1 or arg[1]=="--help" or arg[1]=="-h" then
print([[ctanbib - convert ctan package information to bibtex format
Usage:
ctanbib [options] <package name>
Available options:
- -c,--ctan Use @ctan type instead of @manual
+ -c,--ctan Use @ctan type instead of @manual and long url
+ -C,--CTAN Use @ctan type and short ... /pkg/url
-h,--help Print this message
-v,--version Print version info
]])
- os.exit(1)
+ os.exit(0)
elseif arg[1]=="--version" or arg[1]=="-v" then
- print "ctanbib version 0.1d"
- os.exit(1)
+ print "ctanbib version 0.1e"
+ os.exit(0)
elseif arg[1]=="--ctan" or arg[1]=="-c" then
table.remove(arg, 1)
bibtype = "ctan"
+elseif arg[1]=="--CTAN" or arg[1]=="-C" then
+ table.remove(arg, 1)
+ bibtype = "ctan"
+ pkgurl = true
end
local pkgname = arg[1]
-local url = "https://www.ctan.org/xml/2.0/pkg/" .. pkgname .. "?author-name=true"
+
+if not pkgname then
+ print "[ctanbib] Error: missing package name"
+ os.exit(1)
+end
+
+local url = "https://ctan.org/xml/2.0/pkg/" .. pkgname .. "?author-name=true"
local authors_url = "https://ctan.org/xml/2.0/authors"
-- change that for different title scheme
@@ -55,7 +67,6 @@ version = {$version}
local dom = require('luaxml-domobject')
-
local load_xml = function(url)
-- local command = io.popen("wget -qO- ".. url,"r")
local command = io.popen("curl -sS ".. url,"r")
@@ -142,7 +153,7 @@ end
local get_url = function(record)
local home = record:query_selector("home")[1]
if home then return home:get_attribute("href") end
- return "http://www.ctan.org/pkg/"..pkgname
+ return "https://ctan.org/pkg/"..pkgname
end
local get_caption = function(record)
@@ -191,7 +202,7 @@ e.title = get_title(record)
e.subtitle = get_caption(record)
e.url = get_url(record)
-- use the CTAN path as url for the CTAN type
-if bibtype == "ctan" then
+if (bibtype == "ctan") and not pkgurl then
e.url = ctan_url(record)
end
e.version, e.date = get_version(record)