| 1 |
\documentclass[11pt]{ltxdoc} |
| 2 |
\newcommand\package[1]{\texttt{#1}} |
| 3 |
\usepackage{longtable} |
| 4 |
\usepackage{tabularx} |
| 5 |
\newenvironment{changelog}{\longtable{@{} l p{30em}}}{\endlongtable} |
| 6 |
\newcommand\change[2]{#1 & #2\\} |
| 7 |
\title{The \texttt{ctanbib} package} |
| 8 |
\author{Michal Hoftich\\\href{mailto:[email protected]}{[email protected]}} |
| 9 |
\date{\gitdate, version \gitversion} |
| 10 |
\usepackage{hyperref} |
| 11 |
\usepackage{fontspec} |
| 12 |
\setmainfont{TeX Gyre Schola} |
| 13 |
\setmonofont[Scale=MatchLowercase]{Inconsolatazi4} |
| 14 |
\usepackage{microtype} |
| 15 |
\begin{document} |
| 16 |
\maketitle |
| 17 |
|
| 18 |
\section{Introduction} |
| 19 |
This package provides script named \package{ctanbib} which can be used for retrieving of the bibliographic information for packages hosted on CTAN. |
| 20 |
|
| 21 |
It looks up the Catalogue entry for each PKGNAME on CTAN (at |
| 22 |
\url{https://ctan.org/xml/2.0/pkg/PKGNAME}), and convert relevant information |
| 23 |
to a BibTeX entry. |
| 24 |
|
| 25 |
By default, the url field in the output entry is the package's home |
| 26 |
field value if that is specified in the Catalogue entry; if it isn't, |
| 27 |
\url{https://ctan.org/pkg/PKGNAME is used}. |
| 28 |
|
| 29 |
\section{Usage} |
| 30 |
|
| 31 |
|
| 32 |
It can be used in the following way: |
| 33 |
|
| 34 |
|
| 35 |
\medskip |
| 36 |
|
| 37 |
\noindent\package{ctanbib [options] $\langle$packagename1$\rangle$ \ldots\ $\langle$packagenameX$\rangle$ > filename.bib} |
| 38 |
|
| 39 |
\medskip |
| 40 |
|
| 41 |
The \texttt{curl} utility needs to be installed on the user's system in order to support the package info download. |
| 42 |
|
| 43 |
|
| 44 |
\section{Available options} |
| 45 |
|
| 46 |
\begin{description} |
| 47 |
\item[-c,-\/-ctan] always use CTAN /pkg/ url instead of the package homepage |
| 48 |
\item[-C,-\/-ctanpath] use the package's CTAN path as url (e.g.: /support/ctanbib) |
| 49 |
\item[-e,-\/-entrypoint] explicitly set the Bib\TeX\ entry type. |
| 50 |
\item[-h,-\/-help] print the help message. |
| 51 |
\item[-p,-\/-pkgname] wrap the package name in a \verb|\ctanbibpkgname| command. |
| 52 |
\item[-v,-\/-version] print the version info. |
| 53 |
\end{description} |
| 54 |
|
| 55 |
|
| 56 |
\section{Examples} |
| 57 |
|
| 58 |
\begin{verbatim} |
| 59 |
ctanbib latex |
| 60 |
\end{verbatim} |
| 61 |
|
| 62 |
|
| 63 |
\noindent This invocation will print data in the Bib(La)\TeX\ format to the standard output: |
| 64 |
|
| 65 |
\begin{verbatim} |
| 66 |
@manual{latex, |
| 67 |
title = {The latex package}, |
| 68 |
subtitle = {A TeX macro package that defines LaTeX}, |
| 69 |
author = {{The LaTeX Team} and Lamport, Leslie}, |
| 70 |
url = {http://www.latex-project.org/}, |
| 71 |
urldate = {2021-06-26}, |
| 72 |
date = {}, |
| 73 |
version = {2021-06-01}, |
| 74 |
} |
| 75 |
\end{verbatim} |
| 76 |
|
| 77 |
\noindent The \texttt{--ctan} option: |
| 78 |
|
| 79 |
\begin{verbatim} |
| 80 |
ctanbib -c latex |
| 81 |
\end{verbatim} |
| 82 |
|
| 83 |
\noindent This produces a bib record that uses the CTAN package entry for the URL, |
| 84 |
instead of the original package URL. |
| 85 |
|
| 86 |
|
| 87 |
\begin{verbatim} |
| 88 |
@manual{latex, |
| 89 |
title = {The latex package}, |
| 90 |
... |
| 91 |
url = {https://ctan.org/pkg/latex}, |
| 92 |
... |
| 93 |
} |
| 94 |
\end{verbatim} |
| 95 |
|
| 96 |
\noindent The \texttt{--ctanpath} option: |
| 97 |
|
| 98 |
\begin{verbatim} |
| 99 |
ctanbib -C biblatex |
| 100 |
\end{verbatim} |
| 101 |
|
| 102 |
\noindent This produces a bib record that uses the CTAN package tree location for the URL. |
| 103 |
|
| 104 |
\begin{verbatim} |
| 105 |
@manual{biblatex, |
| 106 |
... |
| 107 |
url = {/macros/latex/contrib/biblatex}, |
| 108 |
... |
| 109 |
} |
| 110 |
\end{verbatim} |
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
\noindent The \texttt{--entrytype} option: |
| 115 |
|
| 116 |
\begin{verbatim} |
| 117 |
ctanbib -e ctan latex |
| 118 |
\end{verbatim} |
| 119 |
|
| 120 |
\noindent It selects different entry type for the record: |
| 121 |
|
| 122 |
\begin{verbatim} |
| 123 |
@ctan{latex, |
| 124 |
... |
| 125 |
} |
| 126 |
\end{verbatim} |
| 127 |
|
| 128 |
\noindent The \texttt{--pkgname} option: |
| 129 |
|
| 130 |
\begin{verbatim} |
| 131 |
ctanbib -p latex |
| 132 |
\end{verbatim} |
| 133 |
|
| 134 |
\noindent Puts the package name into the \verb|\ctanbibpkgname| command, which can be |
| 135 |
redefined by user to produce a special formatting of the name: |
| 136 |
|
| 137 |
\begin{verbatim} |
| 138 |
@preamble{ "\providecommand\ctanbibpkgname[1]{\textsl{#1}}" } |
| 139 |
@manual{latex, |
| 140 |
title = {The \ctanbibpkgname{latex} package}, |
| 141 |
... |
| 142 |
} |
| 143 |
\end{verbatim} |
| 144 |
|
| 145 |
|
| 146 |
\section{License} |
| 147 |
|
| 148 |
Permission is granted to copy, distribute and/or modify this software |
| 149 |
under the terms of the \LaTeX\ Project Public License, version 1.3. |
| 150 |
|
| 151 |
\section{Acknowledgements} |
| 152 |
|
| 153 |
This package was created thanks to TeX.sx user |
| 154 |
Daniel\footnote{\url{https://tex.stackexchange.com/users/3751/daniel}}. Lukas |
| 155 |
C.~Bossert had useful comments which led to update of the original script and |
| 156 |
it's eventual release on CTAN. Herbert Voss added the \verb|--CTAN| option. |
| 157 |
Karl Berry and Boris Veytsman suggested addition of the \verb|--pkgname| option |
| 158 |
and leaving package names uncapitalized. |
| 159 |
|
| 160 |
\newpage |
| 161 |
\section{Changelog} |
| 162 |
|
| 163 |
\begin{changelog} |
| 164 |
\change{2026-05-26}{Version 0.2e released} |
| 165 |
\change{2026-05-26}{Use repository address as URL if the home field is missing} |
| 166 |
\change{2026-05-26}{Rewrote the man page, thanks to Karl Berry} |
| 167 |
\change{2023-10-25}{Version 0.2d released} |
| 168 |
\change{2023-10-20}{Sort authors alphabetically} |
| 169 |
\change{2023-10-19}{Updated the \verb|--help| message} |
| 170 |
\change{2023-10-16}{Use larger font in the documentation} |
| 171 |
\change{2023-10-16}{Indent the Bib\TeX\ entry by two spaces} |
| 172 |
\change{2023-10-08}{Get date from the copyright field if we cannot retrieve it from version} |
| 173 |
\change{2023-09-18}{Version 0.2c released} |
| 174 |
\change{2023-09-14}{Renamed the \verb|--tugboat| option to \verb|--pkgname|} |
| 175 |
\change{2023-09-12}{Don't capitalize package names} |
| 176 |
\change{2023-09-12}{Added the \verb|--tugboat| option for creation of records suitable for the TUGboat journal} |
| 177 |
\change{2023-02-20}{Verson 0.2b released} |
| 178 |
\change{2023-02-20}{Use \verb|--ssl-no-revoke| option for Curl, to prevent SSL certificate errors} |
| 179 |
\change{2023-02-20}{Better handling of errors in package info downloading} |
| 180 |
\change{2023-02-20}{Fixed link to the author mail address} |
| 181 |
\change{2021-06-29}{Version 0.2a released} |
| 182 |
\change{2021-06-29}{Added the \verb|--ctanpath| option.} |
| 183 |
\change{2021-06-26}{Version 0.2 released} |
| 184 |
\change{2021-06-26}{Removed the \verb|--CTAN| option, entry type can be set using \verb|--entrytype| and CTAN URL is requested using \verb|--ctan|} |
| 185 |
\change{2021-06-26}{Added \verb|--entrytype| option for explicit specification of the Bib\TeX\ entry type} |
| 186 |
\change{2021-06-26}{Fixed package name verification} |
| 187 |
\change{2021-06-26}{Added support for multiple package names} |
| 188 |
\change{2021-06-26}{Print \verb|https://www.ctan.org/pkg/<pkgname>| with the \texttt{-c} option} |
| 189 |
\change{2021-06-20}{Version 0.1e released} |
| 190 |
\change{2021-06-20}{Added \verb|--CTAN| option, thanks to Herbert Voss} |
| 191 |
\change{2019-12-23}{Don't return non-zero exit codes for non-error runs} |
| 192 |
\change{2019-12-23}{Test for the packagename with the \texttt{-c} option} |
| 193 |
\change{2019-09-21}{Try to find the author in full CTAN author list if the author cannot be found in the package info} |
| 194 |
\change{2019-09-16}{Use the CTAN API 2.0 to fetch the package info} |
| 195 |
\change{2019-05-04}{Version 0.1c released} |
| 196 |
\change{2019-05-04}{Use the \texttt{curl} command to download the package info} |
| 197 |
\change{2019-05-04}{Added information about the need to have the \texttt{curl} command installed} |
| 198 |
\change{2019-03-11}{Version 0.1b released} |
| 199 |
\change{2018-09-10}{Added support for institutional names} |
| 200 |
\change{2018-09-10}{Escape TeX commands in the title and subtitle} |
| 201 |
\change{2018-08-29}{Added man page} |
| 202 |
\change{2018-08-27}{Added --ctan option} |
| 203 |
\change{2018-08-23}{Version 0.1 released.} |
| 204 |
\change{2018-08-23}{Created documentation.} |
| 205 |
\change{2018-08-21}{Rewrote the script to use the DOM api provided by LuaXML. This provides greater flexibility in the XML processing.} |
| 206 |
\change{2018-08-20}{Fixed the script for the current XML format provided by CTAN.} |
| 207 |
\change{2014-09-12}{Initial version of the script have been released in answer on TeX.sx\footnote{\url{https://tex.stackexchange.com/a/200856/2891}}.} |
| 208 |
\end{changelog} |
| 209 |
|
| 210 |
|
| 211 |
\end{document} |