From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id F2A5413835A for ; Sun, 28 Jun 2020 10:46:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1CC61E08A0; Sun, 28 Jun 2020 10:46:50 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E57F8E08A0 for ; Sun, 28 Jun 2020 10:46:49 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B832934EBC4 for ; Sun, 28 Jun 2020 10:46:48 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 62F431AC for ; Sun, 28 Jun 2020 10:46:47 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1593016784.1a510e755d964b4b96a1cbc429b3e5774e8234bc.ulm@gentoo> Subject: [gentoo-commits] proj/pms:master commit in: / X-VCS-Repository: proj/pms X-VCS-Files: pms.cls X-VCS-Directories: / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 1a510e755d964b4b96a1cbc429b3e5774e8234bc X-VCS-Branch: master Date: Sun, 28 Jun 2020 10:46:47 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3ea4b785-78bb-47c9-a126-c805ecccd80e X-Archives-Hash: 7dbdeb535f6f01756d2c9ad0fd259856 Message-ID: <20200628104647.7TArobvhC7nrO1SHFC2pUbNhXvPsoI96qdk8bTOTdIA@z> commit: 1a510e755d964b4b96a1cbc429b3e5774e8234bc Author: Ulrich Müller gentoo org> AuthorDate: Wed Jun 24 16:39:44 2020 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Wed Jun 24 16:39:44 2020 +0000 URL: https://gitweb.gentoo.org/proj/pms.git/commit/?id=1a510e75 pms.cls: Drop the caption package because it interferes with TeX4ht. The "caption" package already caused issues in the past (for example, see commits b35f619 and 467f1b7), and version v3.4h finally broke the list of tables in HTML output. TeX4ht upstream says that the package should be avoided: https://puszcza.gnu.org.ua/bugs/?313#comment8 Positioning the caption above the table is simple enough without using the package. So we only lose the boldface labels which is a very minor issue. As an added bonus, this allows removal of most workarounds that were necessary for TeX4ht. Signed-off-by: Ulrich Müller gentoo.org> pms.cls | 67 +++++++++++++++++++++++++++-------------------------------------- 1 file changed, 28 insertions(+), 39 deletions(-) diff --git a/pms.cls b/pms.cls index d7047cf..d7dc8e8 100644 --- a/pms.cls +++ b/pms.cls @@ -17,8 +17,6 @@ \PassOptionsToPackage{textwidth=400pt,textheight=700pt, left=20mm,marginparsep=10pt,marginparwidth=40mm, vmarginratio=1:2,includehead}{geometry} -% Position caption of float environments at the top -\PassOptionsToPackage{position=top,labelfont=bf}{caption} % Enable UTF-8 input encoding \PassOptionsToPackage{utf8}{inputenc} \PassOptionsToPackage{quiet}{marginnote} @@ -43,20 +41,14 @@ parskip, % Space between paragraphs instead of indentation underscore, % Allow simple _ instead of \_ chngcntr, % Redefinition of counters - tocbibind % Add bibliography to table of contents + tocbibind, % Add bibliography to table of contents + float, % More control over float environments + hyperref, % Support for hyperlinks + gitinfo2, % Metadata from git + algorithm, % + algorithmic % Set algorithms } -% tex4ht workaround: hyperref needs to be loaded /after/ tex4ht injects itself -\g@addto@macro\@documentclasshook{ - \RequirePackage{ - caption, % Extended float environment formatting - float, % More control over float environments - hyperref, % Support for hyperlinks - gitinfo2, % Metadata from git - algorithm, % - algorithmic % Set algorithms - } -} \ClassInfo{pms}{Capsulation of LaTeX stuff for the Package Manager Specification, loaded baseclass: \ClassToLoad\MessageBreak} @@ -75,15 +67,6 @@ \setboolean{TEX4HT-HACKS}{true} \fi -% tex4ht workaround: these need to happen after loading the float package -\g@addto@macro\@documentclasshook{ - \floatstyle{ruled} - \captionsetup[ruled]{labelsep=default,labelfont=bf} - \newfloat{listing}{tbp}{lol}[chapter] - \floatname{listing}{Listing} -} -\newcommand{\listoflistings}{\listof{listing}{List of Listings}} - % Define own label and reference commands, that display the label in % the page margin. \ifthenelse{\boolean{TEX4HT-HACKS}}{% @@ -117,11 +100,8 @@ \counterwithout{footnote}{chapter} % Some shorthands for the lazy ones. -% tex4ht workaround: this needs to happen after loading hyperref -\g@addto@macro\@documentclasshook{ - \renewcommand{\i}[1]{\textit{#1}} - \renewcommand{\t}[1]{\texttt{#1}} -} +\renewcommand{\i}[1]{\textit{#1}} +\renewcommand{\t}[1]{\texttt{#1}} \newcommand{\e}[1]{\emph{#1}} \newcommand{\note}[1]{\begin{trivlist}\item\textbf{Note:} #1\end{trivlist}} @@ -138,6 +118,17 @@ % Define a new column type P for tables, like p but with ragged-right text \newcolumntype{P}[1]{>{\setlength\rightskip{0pt plus 1fil}}p{#1}} +% Define a float environment for listings +\floatstyle{ruled} +\newfloat{listing}{tbp}{lol}[chapter] +\floatname{listing}{Listing} +\newcommand{\listoflistings}{\listof{listing}{List of Listings}} + +% We always place captions above floats, so redefine vertical spacings +% Don't use the "caption" package because it interferes with TeX4ht +\setlength\belowcaptionskip{\abovecaptionskip} +\setlength\abovecaptionskip{0pt} + % Prevent numbers in list of tables from overrunning into the table captions \renewcommand*{\l@figure}{\@dottedtocline{1}{1.5em}{2.8em}} % was 2.3em \let\l@table\l@figure @@ -148,18 +139,16 @@ \setlength\emergencystretch{1em} % was 0 % Define some PDF meta-data. -% tex4ht workaround: this needs to happen after loading hyperref -\g@addto@macro\@documentclasshook{ - \hypersetup{% - urlcolor=black, - colorlinks=true, - citecolor=black, - linkcolor=black, - pdflang={en}, - pdfcreator={pdfLaTeX and hyperref}, - pdfproducer={pdfLaTeX and hyperref}, - } +\hypersetup{% + urlcolor=black, + colorlinks=true, + citecolor=black, + linkcolor=black, + pdflang={en}, + pdfcreator={pdfLaTeX and hyperref}, + pdfproducer={pdfLaTeX and hyperref}, } + % Reads the last commit date from the Git repository and even succeeds % when none is available \date{%