Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7186ef7
A variety of things.
kmccurley Jan 18, 2026
6354655
Remove test for iacrtrans since it's not in texlive.
kmccurley Jan 18, 2026
b44d26b
Add more packages for tests.
kmccurley Jan 18, 2026
dea53dd
Spelling error on ieeetran.
kmccurley Jan 18, 2026
364606c
Another attempt to fix tests.
kmccurley Jan 18, 2026
683c27c
A feeble attempt to get log output from pytest in github.
kmccurley Jan 18, 2026
0f23223
Another try.
kmccurley Jan 18, 2026
628eff0
Yet another try.
kmccurley Jan 18, 2026
4af2cb1
Just run one test while figuring out how to debug tests.
kmccurley Jan 18, 2026
b2e091d
Different logging in github.
kmccurley Jan 18, 2026
39025fd
Use texlive 2025.
kmccurley Jan 18, 2026
5ec9f39
Add another package for fonts.
kmccurley Jan 18, 2026
5187e00
Remove a class that may be problematic in github tests.
kmccurley Jan 18, 2026
06903ca
Remove some packages.
kmccurley Jan 18, 2026
d6b4056
Add a package.
kmccurley Jan 18, 2026
0284d63
Add amsfonts.
kmccurley Jan 18, 2026
85fff4b
Add another font package.
kmccurley Jan 18, 2026
f41cff7
Switch to medium. I give up on selecting packages.
kmccurley Jan 18, 2026
d2d2953
Another smaller set.
kmccurley Jan 18, 2026
2c66b98
ieeeconf fix.
kmccurley Jan 18, 2026
1bf5d34
IEEEconf => ieeeconf with medium.
kmccurley Jan 18, 2026
cabe5f2
Once more - this time with titlesec.
kmccurley Jan 18, 2026
f04abc3
Add some packages for other classes.
kmccurley Jan 19, 2026
4e36c9e
Remove non-existent flushend package.
kmccurley Jan 19, 2026
60d3ba0
Once again with no feeling.
kmccurley Jan 19, 2026
9718c51
Add some more for jacow document class.
kmccurley Jan 19, 2026
f082aa4
Fix the packages?
kmccurley Jan 19, 2026
43fdfc5
Switch to test39.
kmccurley Jan 19, 2026
b53d0de
More packages for acmart.
kmccurley Jan 19, 2026
7261233
More packages.
kmccurley Jan 19, 2026
c77a0bb
Yet another typo.
kmccurley Jan 19, 2026
7d9ee8e
upquotes.
kmccurley Jan 19, 2026
7368da8
Try all of the tests now.
kmccurley Jan 19, 2026
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
4 changes: 4 additions & 0 deletions .github/workflows/latex_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ name: test of iacrcc LaTeX class.

on:
push:
paths:
'iacrcc/**'
pull_request:
paths:
'iacrcc/**'

permissions:
contents: read
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/metacapture_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: test of metacapture LaTeX package.

on:
push:
paths:
'metacapture/**'
pull_request:
paths:
'metacapture/**'

permissions:
contents: read

jobs:
latex_test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: "pip"
- name: Install texlive
uses: zauguin/install-texlive@v4
with:
package_file: .github/workflows/texlive.packages
texlive_version: 2025
- name: Get TeXLive version
run: |
tlmgr --version
tlmgr update --all
- name: Install dependencies
working-directory: metacapture/tests
run: |
python -m pip install --upgrade pip
pip install pytest pdfplumber pdfminer python-xmp-toolkit nameparser xmp pylatexenc pypdf
- name: Tests for metacapture.sty
working-directory: metacapture/tests
run: |
echo "/usr/local/texlive/2025/bin/x86_64-linux/" >> "$GITHUB_PATH"
python -m pytest compile_tests.py -vv
41 changes: 40 additions & 1 deletion .github/workflows/texlive.packages
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
scheme-small
scheme-medium
latex-bin
filehook
currfile
Expand Down Expand Up @@ -47,4 +47,43 @@ pdfmanagement-testphase
latex-lab
ltxcmds
kvsetkeys
cleveref
zref-clever
spie
economic
elsarticle
ieeetran
llncs
jacow
active-conf
paper
acmart
amscls
environ
helvetic
endnotes
amsfonts
nimbus15
ieeeconf
titlesec
etoolbox
sttools
footmisc
newtxtt
unicode-math
lm
newtx
enumitem
cite
tex-gyre
hyperxmp
ncctools
draftwatermark
xcolor
cmap
libertine
inconsolata
comment
pbalance
preprint
upquote
4 changes: 0 additions & 4 deletions metacapture/iacrj.cls
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,6 @@
\fi
}

% Meta information is written out in [jobname].meta
\newwrite\iacrmeta
\immediate\openout\iacrmeta=\jobname.meta

\AtEndDocument{%
% Final version requires textabstract.
\IfFileExists{\jobname.abstract}{}{%
Expand Down
82 changes: 42 additions & 40 deletions metacapture/metacapture.sty
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
%% Package-specific variables are defined with the \METAC@ prefix.
%% Some variables are also defined in expl3 style with the metac module name.

% Just a shortcut for Errors
\newcommand\PkgErr[1]{\PackageError{metacapture}{#1}{}}

\def\METAC@fileversion{0.9}
\def\METAC@filedate{2025/04/22}

Expand Down Expand Up @@ -46,12 +49,15 @@
emailreq .choices:nn = {none, one, all} {\tl_set_eq:NN \g_metac_emailreq_tl \l_keys_choice_tl },
emailreq .initial:n = {none},
orcidreq.if = @metacapture@orcidreq, % whether every author needs an orcid.
countryrequired.if = @metacapture@countryrequired, % Whether every affiliation requires a country.
countryrequired.if = @metacapture@countryrequired, % Every affiliation requires a country.
cityrequired.if = @metacapture@cityrequired, % Every affiliation requires city and country.
notitlefootnote.if = @metacapture@notitlefootnote, % whether to allow footnotes on titles.
footnotesymbols.if = @metacapture@footnotesymbols, % title and author footnotes with symbols.
}

\ProcessKeyOptions[metacapture]
% If city is required, then country is also required.
\if@metacapture@cityrequired\@metacapture@countryrequiredtrue\fi

% This holds the sequence of authors. Each entry is a serialized prop.
\seq_new:N \g_metac_author_seq
Expand Down Expand Up @@ -85,7 +91,7 @@
% \seq_put_right:Nn \l_tmpa_seq {\href{mailto:\l_tmpa_tl}{\l_tmpa_tl}~{}~(\l_tmpb_tl)}
\seq_put_right:Nn \l_tmpa_seq {#1}
}{
\PackageError{metacapture}{All authors must have a name}
\PkgErr{All authors must have a name}
}
} {}
}
Expand Down Expand Up @@ -147,7 +153,7 @@
onclick .code:n = {},
name .code:n = {},
name .value_required:n = true,
unknown .code:n = \PackageError{metacapture}{Unknown~key~for~author:'\l_keys_key_str'}
unknown .code:n = \PkgErr{Unknown~key~for~author:'\l_keys_key_str'}
}
% Similarly, these keys are used only to validate what is supplied
% through \addaffiliation. Nothing is stored when they are set.
Expand All @@ -172,7 +178,7 @@
UA,AE,GB,US,UM,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW} {}, % ISO-3166 Alpha-2 codes
name .code:n = {},
name .value_required:n = true,
unknown .code:n = \PackageError{metacapture}{Unknown~key~for~affiliation:'\l_keys_key_str'}
unknown .code:n = \PkgErr{Unknown~key~for~affiliation:'\l_keys_key_str'}
}
% Similarly, these keys are used only to validate what is supplied
% through \addfunding. Nothing is stored when they are set, but validation
Expand All @@ -195,7 +201,7 @@
UA,AE,GB,US,UM,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW} {}, % ISO-3166 Alpha-2 codes
name .code:n = {},
name .value_required:n = true,
unknown .code:n = \PackageError{metacapture}{Unknown~key~for~funding:'\l_keys_key_str'}
unknown .code:n = \PkgErr{Unknown~key~for~funding:'\l_keys_key_str'}
}
\ExplSyntaxOff

Expand All @@ -208,8 +214,8 @@
% of recurrences of, a substring.
\RequirePackage{xstring} % Required for IfSubStr

% This provides the savenotes macro to allow footnotes in boxes.
\RequirePackage{footnotehyper}
% This provides the savenotes and spewnotes macros to allow footnotes in boxes.
\RequirePackage{footnote}

% comma-delimited list of author names.
\global\let\METAC@listofauthors\@empty
Expand Down Expand Up @@ -237,7 +243,7 @@
\if@metacapture@anonymous\else
% Check that emails were correctly recorded.
\fi
\immediate\closeout\metacwrite%
\closeout\metacwrite%
% Check if either \title, \addauthor or \addaffiliation macros were redefined
% Also check if the font (\familydefault) or the margings (\paperwidth) were modified.
% Throw an error if so, these are needed for meta-data collection
Expand All @@ -260,13 +266,10 @@
}
\let\storeprotect\protect

% xpatch: Extending etoolbox patching commands
\RequirePackage{xpatch}
% etoolbox: used for \AtEndPreamble
%\RequirePackage{etoolbox}

% create an immediate version of \protected@write
\let\protected@iwrite\protected@write
\xpatchcmd{\protected@iwrite}{\write}{\immediate\write}{}{}
\newcommand\@writemeta[1]{\protected@iwrite\metacwrite{}{#1}}%
\newcommand\@writemeta[1]{\protected@write\metacwrite{}{#1}}%

% alphalph: Convert numbers to letters. This is used for
% footnotes in \addauthor and \title
Expand Down Expand Up @@ -398,9 +401,6 @@
% addresses for now).
\AtEndDocument{
\footnotesize
\begin{list}{}{\leftmargin=0.5cm%\rightmargin=\leftmargin
\item\relax
}
% This is complicated. For each author we need to generate a
% list of affiliation addresses, that we look up by values in
% the inst for an author. For this reason we create a prop
Expand Down Expand Up @@ -463,7 +463,6 @@
} {}
\\[6pt]
}
\end{list}
}
\fi%!anonymous
\end{center}%
Expand Down Expand Up @@ -872,7 +871,7 @@
% We prohibit \thanks because footnotes are added as attributes rather than part of the
% content for title and author.
\tl_if_eq:NnTF \g_metac_maketitle_tl {none} {} {
\renewcommand{\thanks}[1]{\PackageError{metacapture}{The~\string\thanks\space macro~is~not~supported. ^^JSee~the~documentation~for~the~metacapture~package~on~how~to~use~footnotes.}{}}
\renewcommand{\thanks}[1]{\PkgErr{The~\string\thanks\space macro~is~not~supported. ^^JSee~the~documentation~for~the~metacapture~package~on~how~to~use~footnotes.}}
}

% If the maketitle option is supplied, then \maketitle will be defined
Expand Down Expand Up @@ -903,7 +902,7 @@
\newcommand\METAC@atmaketitle{\METAC@jems@maketitle}
}
} {} {
\PackageError{metacapture}{Unknown~maketitle~argument}{}
\PkgErr{Unknown~maketitle~argument}
}

\if@twocolumn
Expand Down Expand Up @@ -1021,12 +1020,12 @@
\tl_if_eq:NnTF \g_metac_emailreq_tl {one}{%
% When we produce the final version we need at least one e-mail address
\ifnum\theMETAC@email@cnt<1\relax
\PackageError{metacapture}{At least one author must supply an e-mail address}
\PkgErr{At least one author must supply an e-mail address}
\fi
}{
\tl_if_eq:NnTF \g_metac_emailreq_tl {all}{%
\ifnum\theMETAC@email@cnt<\theMETAC@author@cnt\relax
\PackageError{metacapture}{All authors must supply an email address}{}%
\PkgErr{All authors must supply an email address}%
\fi
} {}
}
Expand All @@ -1046,7 +1045,7 @@

% We do not support \author, use \addauthor instead
\renewcommand\author[2][]{%
\PackageError{metacapture}{Do not use the \string\author\space macro: use the \string\addauthor\space macro instead}{}%
\PkgErr{Do not use the \string\author\space macro: use the \string\addauthor\space macro instead}%
}


Expand All @@ -1068,7 +1067,7 @@
\else
\appto\METAC@listofauthors{,\space #2}%
\fi
\ifx\@onlypreamble\@notprerr\PackageError{metacapture}{\string\addauthor\space may only be used before \string\begin{document}}{}\fi
\ifx\@onlypreamble\@notprerr\PkgErr{\string\addauthor\space may only be used before \string\begin{document}}\fi
\MathAllowedInCheckStringfalse
\checkstring{#2}{author names should not contain macros or math}%
% Some additional checks on the if addauthor is used correctly
Expand Down Expand Up @@ -1099,7 +1098,7 @@
% Check the orcid value
\prop_get:NnNTF \l_tmpa_prop {orcid} \l_tmpa_tl {
\regex_match:nVTF {^\d{4}-\d{4}-\d{4}-\d{3}[Xx\d]$} {\l_tmpa_tl} {} {
\PackageError{The provided ORCID in \string\addauthor\space does not look valid: \l_tmpa_tl. Did you forget a comma?}
\PkgErr{The provided ORCID in \string\addauthor\space does not look valid: \l_tmpa_tl. Did you forget a comma?}
}
} { % no orcid.
\if@metacapture@orcidreq\PkgErr{Every author must have an orcid set in \string\addauthor\space}\fi
Expand Down Expand Up @@ -1139,7 +1138,7 @@

% Define the \addfunding macro to capture funding meta-data
\newcommand{\addfunding}[2][\@empty]{%
\ifx\@onlypreamble\@notprerr\PackageError{metacapture}{\string\addfunding\space may only be used before \string\begin{document}}{}\fi
\ifx\@onlypreamble\@notprerr\PkgErr{\string\addfunding\space may only be used before \string\begin{document}}\fi
\MathAllowedInCheckStringfalse
\checkstring{#2}{Funder name should not contain macros or math}%
\keys_set:nn { metacapture / funding } { name={#2}, #1 }
Expand Down Expand Up @@ -1168,9 +1167,6 @@
% listofitems: Grab items in lists using user-specified sep char
\RequirePackage{listofitems}

% Just a shortcut for Errors
\newcommand\PkgErr[1]{\PackageError{metacapture}{#1}{}}

% TODO: Check if this is neccesary with new fixes.
% Check if a token macro (in pdflatex) is a UTF-8 char
\ExplSyntaxOn
Expand Down Expand Up @@ -1264,10 +1260,11 @@
% Provide the title of the paper with its various options. Note that this must be used in the preamble.
\ExplSyntaxOn
\renewcommand\title[2][]{%
\ifx\@onlypreamble\@notprerr\PackageError{metacapture}{\string\title\space may only be used before \string\begin{document}}{}\fi
\ifx\@onlypreamble\@notprerr\PkgErr{\string\title\space may only be used before \string\begin{document}}\fi
\ifdefined\inputencodingname\IfStrEq{\inputencodingname}{utf8}{}{\PkgErr{Only~utf8~is~allowed~for~input~encoding}}\fi
\if@metacapture@notitlefootnote%
\saveexpandmode\noexpandarg % set \noexpandarg locally
\IfSubStr{#2}{\footnote}{\PackageError{metacapture}{The \string\footnote\space macro is disabled in the title}}
\IfSubStr{#2}{\footnote}{\PkgErr{The \string\footnote\space macro is disabled in the title}}
\restoreexpandmode % restore the previous mode
\fi
\tl_set:Nn \g_metac_titleraw_tl {#2}
Expand Down Expand Up @@ -1310,7 +1307,7 @@
\let\store@title\title% Save macro away to check if it was changed.

\newcommand\addaffiliation[2][]{
\ifx\@onlypreamble\@notprerr\PackageError{metacapture}{\string\addaffiliation\space may only be used before \string\begin{document}}{}\fi
\ifx\@onlypreamble\@notprerr\PkgErr{\string\addaffiliation\space may only be used before \string\begin{document}}\fi
\stepcounter{METAC@affil@cnt}%
% If a affiliation name is provided does some basic sanity checking on the string
\MathAllowedInCheckStringfalse
Expand All @@ -1323,12 +1320,16 @@
\prop_map_inline:Nn \l_tmpa_prop {
\@writemeta{\META@CSS ##1: ##2}%
}
% Check for a country
\prop_get:NnNTF \l_tmpa_prop {country} \l_tmpa_tl {} {
\ifcsstring{@METACversion}{final}{%
\PkgErr{Specify a country for each affiliation for the final version}%
}{}
}
\if@metacapture@cityrequired{%
\prop_if_in:NnTF \l_tmpa_prop {city} {} {%
\PkgErr{A~city~is~required~for~each~affiliation}
}
}\fi
\if@metacapture@countryrequired{%
\prop_if_in:NnTF \l_tmpa_prop {country} {} {%
\PkgErr{A~country~is~required~for~each~affiliation}
}%
}\fi
}
\ExplSyntaxOff

Expand Down Expand Up @@ -1357,7 +1358,7 @@
\fi
}

\AtEndPreamble{%
\AddToHook{begindocument/before}{
\@ifpackageloaded{babel}{%
% Ensure the bookmark for the reference points to the section header
% Insert a PDF anchor into the beginning of \refname
Expand Down Expand Up @@ -1390,7 +1391,7 @@
}{}
\global\def\METAC@license{\text_uppercase:n {\l_tmpa_str}}
% We delay setting the license until hyperref has been loaded.
\AtEndPreamble{
\AddToHook{begindocument/before}{
\str_case_e:nnTF {\METAC@license} {
{CC-BY-4.0} {
\RequirePackage[type={CC},modifier={by},version={4.0},hyperxmp=false]{doclicense}
Expand Down Expand Up @@ -1503,6 +1504,7 @@
% authenticated ORCID logo, and \OrcidLink{0000-1111-2222-3333}[unauth] for
% the unauthenticated logo.
\NewDocumentCommand{\OrcidLink}{mO{auth}}{%
\@ifpackageloaded{hyperref}{}{\PkgErr{The hyperref package is required for ORCIDs}}
\IfStrEqCase{#2}{%
{auth}{\href{https://orcid.org/#1}{\XeTeXLinkBox{\AuthOrcidLogo[.8]}}}%
{unauth}{\href{https://orcid.org/#1}{\XeTeXLinkBox{\UnauthOrcidLogo[.8]}}}%
Expand Down
Binary file modified metacapture/metadoc.pdf
Binary file not shown.
Loading