Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024 prerelease roundup #61

Merged
merged 9 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Compile LaTeX document (PdfLaTeX)
uses: dante-ev/latex-action@latest
with:
root_file: example-programming.tex
compiler: pdflatex
args: -pdflatex -latexoption=-file-line-error -latexoption=-interaction=nonstopmode

- name: Compile LaTeX document (LuaLaTeX)
uses: dante-ev/latex-action@latest
with:
root_file: example-programming.tex
compiler: lualatex
args: -lualatex -latexoption=-file-line-error -latexoption=-interaction=nonstopmode

- name: Compile LaTeX document (XeLaTeX)
uses: dante-ev/latex-action@latest
with:
root_file: example-programming.tex
compiler: xelatex
args: -xelatex -latexoption=-file-line-error -latexoption=-interaction=nonstopmode
7 changes: 4 additions & 3 deletions example-programming.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
% These ones are used in the guide, replace with your own.
%
\usepackage{multicol}
\usepackage{ccicons}
\lstdefinelanguage[programming]{TeX}[AlLaTeX]{TeX}{%
deletetexcs={title,author,bibliography},%
deletekeywords={tabular},
Expand Down Expand Up @@ -171,14 +172,14 @@ \subsection{Document Parts}
\documentclass[english,submission]{programming}`\label{l:doc}`
\usepackage[backend=biber]{biblatex} % Use Biblatex `\label{l:bib}`
\addbibresource{example.bib}

\begin{document}

\paperdetails{`\label{l:details}`
perspective=engineering,
area={General-purpose programming}
}

\begin{document}


\title{The importance of why and how to do work}`\label{l:meta}`
\author{Anna Author}
\affiliation{The Unseen University, Ankh-Morpork}
Expand Down
106 changes: 69 additions & 37 deletions programming.cls
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\def\P@banner{The Art, Science, and Engineering of Programming}
\def\P@version{8.0}
\def\P@version{8.1}
\ProvidesClass{programming}%
[2023/02/03 v\P@version ^^J Articles for \P@banner^^J]

Expand Down Expand Up @@ -137,22 +137,15 @@


\providecommand*\P@license{by}

\newcommand*\P@set@license[1]{%
\renewcommand*\P@license{#1}
\if@atdocument
\P@error{License set too late, move \string\paperdetails up in the document.}%
{The license cannot be set to ``#1'' at this point in the process. Please
move the \string\paperdetails command before the \string\begin\{document\}
command.}
\else
\@ifpackageloaded{doclicense}%
{\undef\doclicenseURL%
\setkeys{doclicense}{modifier=#1}%
% hack: propagate settings
\doclicense@set}
{\PassOptionsToPackage{modifier=#1}{doclicense}}
\fi}
\P@error{License set too late, move \string\paperdetails\space up in the document.}%
{The license cannot be set to ``#1'' at this point in the process. Please
move the \string\paperdetails\space command before the \string\begin{document}
command.}
\fi
\renewcommand*\P@license{#1}%
\P@lic@setURL}%

\P@Key{license}{
\P@setnum{license}{@tempa}{%
Expand Down Expand Up @@ -465,26 +458,65 @@
\definecolor{P@GrayBG}{gray}{.90}
\definecolor{P@ORCID}{HTML}{A6CE39}

\newlength{\doclicenseimagewidth}
\setlength{\doclicenseimagewidth}{2.7cm}
\RequirePackage[
type={CC},
modifier=\P@license,
version={4.0},
imagewidth=\doclicenseimagewidth,
]{doclicense}
%
% We're emulating doclicense and having none of its shenanigans
%
% Data.
\newlength{\P@lic@imagewidth}
\setlength{\P@lic@imagewidth}{2.7cm}
\newcommand*\P@lic@version{4.0}
\newcommand*\P@lic@imagemodifier{-88x31}
%
\csdef{P@lic@l@[email protected]}{Attribution 4.0 International}%
% \csdef{P@lic@l@[email protected]}{Attribution-ShareAlike 4.0 International}%
% \csdef{P@lic@l@[email protected]}{Attribution-NoDerivatives 4.0 International}%
\csdef{P@lic@l@[email protected]}{Attribution-NonCommercial 4.0 International}%
% \csdef{P@lic@l@[email protected]}{Attribution-NonCommercial-ShareAlike 4.0 International}%
% \csdef{P@lic@l@[email protected]}{Attribution-NonCommercial-NoDerivatives 4.0 International}%
%
% These require ccicons, and we take care of that when necessary.
% If someone uses these regardless, they can sure keep the errors
\csdef{P@lic@i@[email protected]}{\ccby}%
% \csdef{P@lic@i@[email protected]}{\ccbysa}%
% \csdef{P@lic@i@[email protected]}{\ccbynd}%
\csdef{P@lic@i@[email protected]}{\ccbync}%
% \csdef{P@lic@i@[email protected]}{\ccbyncsa}%
% \csdef{P@lic@i@[email protected]}{\ccbyncnd}%

\newcommand*\P@lic@ImageFileName{doclicense-CC-\P@license\P@lic@imagemodifier}
\newcommand*\P@lic@OldImageFileName{doclicense-CC-\P@license}
\newcommand*\P@lic@text[1]{This work is licensed under a #1 license}
\newcommand*\P@lic@Text{\P@lic@text{\href{\P@lic@URL}{``CC~\MakeUppercase{\P@license}~\P@lic@version}''}}
\newcommand*\P@lic@LongTextForHyperref{\P@lic@text{Creative Commons "\csuse{P@lic@l@\P@license @\P@lic@version}"}}
\newcommand*\P@lic@Icon{\csuse{P@lic@i@\P@license @\P@lic@version}}

\newcommand*\P@lic@Image@%
{\href%
{\P@lic@URL}%
{\includegraphics[width=\P@lic@imagewidth]{\P@lic@ImageFileName}}}
\newcommand*\P@lic@Image@@%
{\makebox[\P@lic@imagewidth]%
{\setlength{\fboxsep}{5pt}%
\raisebox{.5\baselineskip}{\colorbox{P@GrayBG}{\Huge\selectfont\P@lic@Icon}}}}
\providecommand*\P@lic@Image{}
\IfFileExists{doclicense.sty}% borrow images
{\let\P@lic@Image\P@lic@Image@%
\IfFileExists{\P@[email protected]}
% image not present, but if doclicense is, assume old
{}{\let\P@lic@ImageFileName\P@lic@OldImageFileName}}
{\RequirePackage{ccicons}% no image present, us icon
\let\P@lic@Image\P@lic@Image@@}
%
% hook into hyperxmp at document begin
%
\providecommand*\P@lic@URL{https://creativecommons.org/licenses/by/4.0/deed.en}
\newcommand*\P@lic@setURL{\xdef\P@lic@URL{https://creativecommons.org/licenses/\P@license/\P@lic@version/deed.en}}

% Fixes for intermediate versions.
% TL 2015
% this is actually an installation bug for TL 2015,
% but we cannot reliably test that, so we resort to the check
% if the package is new enough for TL 2016.
\@ifpackagelater{doclicense}{2016/04/24}%
{\let\P@doclicenseImage\doclicenseImage}% we're good.
{\def\P@doclicenseImage{%
\makebox[\doclicenseimagewidth]{%
\setlength{\fboxsep}{5pt}%
\raisebox{.5\baselineskip}{\colorbox{P@GrayBG}{\Huge\selectfont\doclicenseIcon}}}}}
\BeforeBeginEnvironment{document}%
{\P@lic@setURL
\hypersetup{%
pdfcopyright = {\P@lic@LongTextForHyperref},
pdflicenseurl = {\P@lic@URL}}}

\RequirePackage{pict2e}
\RequirePackage[tbtags,fleqn]{amsmath}
Expand Down Expand Up @@ -973,14 +1005,14 @@
\begin{minipage}[b][0pt][b]{\textwidth}
\null\noindent%
\normalfont%
\hspace{-1mm}\P@doclicenseImage%
\hspace{-1mm}\P@lic@Image%
\hfill%
\begin{minipage}[b]%
{\dimexpr\linewidth - \doclicenseimagewidth - 1\columnsep\relax}%
{\dimexpr\linewidth - \P@lic@imagewidth - 1\columnsep\relax}%
\ignorespaces
\scriptsize%
\textcopyright\ {\@authorrunning}\\
\doclicenseText\\
\P@lic@Text\\
\ifboolexpr{bool{P@submission}}%
{Submitted to \textit{\P@banner}.}%
{In \textit{\P@banner}\ignorespaces%
Expand Down