% ============================================================
% PHILOSOPHY OF PHYSICS
% Journal Document Class (CLS)
% ============================================================

%% philphys.cls
%% LaTeX class for Philosophy of Physics articles
%% Created by Bryan W Roberts
%% With code support from ChatGPT
%% And initial testing support from Alex Niederklapfer and Jim Weatherall
%%
%% VERSION 1.0.1 (2026-10-14)
%% Copyright 2026 Bryan W Roberts.
%% Distributed and/or modified under LPPL 1.3c or any later version.
%% Maintained by Bryan W Roberts; contact: philphyssociety@gmail.com.
%% See LICENSE.txt for the licence and the files constituting this LPPL work.
%%
%% Maintenance: geometry/typography lengths control the fixed title page and
%% asymmetric body column; pop@ifblindreview gates identifying output; natbib
%% settings control citation punctuation; poplastpagefooter uses the kernel's
%% last-page hook (rerun after pagination changes). Reference entry formatting
%% belongs to philphys.bst. See philphys-documentation.tex.
%% Requires LaTeX 2022-11-01 or newer and the packages listed below.
%%
%% Usage:
%%   \documentclass[blindreview]{philphys} % For journal submissions
%%
%%   \title{Article title}
%%   \poprunningauthor{Author surname}
%%   \popdoi{10.xxxx/xxxxx}
%%
%%   \popauthor{Name}{Affiliation}{0000-0000-0000-0000}
%%   \popauthor{Name}{Affiliation}{} % ORCID may be empty
%%
%%   \popabstract{Abstract text}
%%
%%   \popcorrespondingauthor{Name}
%%   \popcorrespondingauthoraddress{Postal address}
%%   \popcorrespondingauthoremail{name@example.com}
%%
%%   \poptocite{Citation text}
%%   \popsubmitted{Day Month Year}
%%   \popaccepted{Day Month Year}
%%   \poppublished{Day Month Year}
%%   \popcopyrightyear{Year}
%%
%%   \popacknowledgements{Acknowledgements text} % Optional
%%   \popcompetinginterests{Competing interests text}
%%
%%   \begin{document}
%%   \maketitle
%%
%%   Article text...
%%
%%   \popbackmatter
%%   \bibliographystyle{philphys}
%%   \bibliography{yourbibfile}
%%   \poplastpagefooter % Defined below; keep immediately before \end{document}
%%   \end{document}

% ============================================================
% CLASS DECLARATION AND BASE CLASS
% ============================================================
\NeedsTeXFormat{LaTeX2e}[2022-11-01]
\ProvidesClass{philphys}[2026/10/14 v1.0.1 Philosophy of Physics article class]

% Modes: manuscript is the default; blindreview suppresses article identity in
% manuscript mode; published supplies journal metadata and publication history.
% published takes precedence over manuscript/blindreview if combined. This is
% a production option: do not combine it with blindreview for submission.
% Anonymity covers class-generated identity only, not prose, references, images,
% PDF attachments, user-added metadata, or the source files sent to an editor.
\newif\ifpopmanuscript
\popmanuscripttrue

\newif\ifpopblindreview
\popblindreviewfalse

\DeclareOption{manuscript}{\popmanuscripttrue}
\DeclareOption{published}{\popmanuscriptfalse}
\DeclareOption{blindreview}{\popblindreviewtrue}

% Pass any other class options on to article.
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
\ifpopmanuscript\else
  \ifpopblindreview
    \ClassWarningNoLine{philphys}{published overrides blindreview; author identity will be visible}
  \fi
\fi
\LoadClass[10pt]{article}

% ============================================================
% PACKAGE LOADING
% ============================================================
\RequirePackage[paperwidth=175mm,paperheight=250mm]{geometry}
\RequirePackage{calc}
\RequirePackage{ifthen}
\RequirePackage{xcolor} 
\RequirePackage{tikz}
\RequirePackage{graphicx}
\RequirePackage[authoryear,round]{natbib}
\RequirePackage{adjustbox}
\RequirePackage{changepage}
\RequirePackage{etoolbox}
\RequirePackage{setspace}
\RequirePackage{fancyhdr}
\RequirePackage{titlesec}
\RequirePackage{caption}
\RequirePackage[rightcaption,wide]{sidecap}
\RequirePackage{zref-savepos} % Locate margin captions after float placement.
\RequirePackage{zref-abspage}
\RequirePackage{xstring}  % For testing whether ORCID fields are empty.
\RequirePackage{url}
\RequirePackage{booktabs} % For tabular style
\RequirePackage{enumitem} % Journal spacing and label fonts for ordinary lists.
% Hyperref is loaded at the end of the preamble to respect package load order.

% ============================================================
% FONTS AND GLOBAL DOCUMENT DEFAULTS
% ============================================================
\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}
\RequirePackage{stix2} % Journal text and math fonts; includes AMS symbols.

\raggedbottom
\singlespacing

% ============================================================
% COLOURS
% ============================================================
\definecolor{lsered}{HTML}{ED1C2E}
\definecolor{popDark}{HTML}{222833}

\definecolor{popBarOne}{HTML}{FFE8C3}
\definecolor{popBarTwo}{HTML}{F9B879}
\definecolor{popBarThree}{HTML}{82BAB3}
\definecolor{popBarFour}{HTML}{079DAC}
\definecolor{popBarFive}{HTML}{F07F43}
\definecolor{popBarSix}{HTML}{E94E2C}

\definecolor{popAbstractGrey}{rgb}{0.957,0.958,0.960}
\definecolor{popOAOrange}{HTML}{f68212}
\definecolor{popORCIDGreen}{HTML}{A6CE39}

% ============================================================
% INTERNAL COMMAND NAMES
% ============================================================
% The following internal commands use @; class files already permit it.
% The explicit makeatletter/makeatother pair also supports maintenance excerpts.

\makeatletter

% Journal sizes measured from the supplied PDFs (TeX pt; PDF points are 72/72.27
% times these values). STIX Two Text body: 8pt; notes/sidebar: 7pt; title: 23pt.
\let\pop@originalnormalsize\normalsize
\renewcommand{\normalsize}{\pop@originalnormalsize\fontsize{8pt}{12.5pt}\selectfont}
\let\pop@originalsmall\small
\renewcommand{\small}{\pop@originalsmall\fontsize{7.500000pt}{9.166667pt}\selectfont}
\let\pop@originalfootnotesize\footnotesize
\renewcommand{\footnotesize}{\pop@originalfootnotesize\fontsize{7pt}{8.5pt}\selectfont}
\let\pop@originalscriptsize\scriptsize
\renewcommand{\scriptsize}{\pop@originalscriptsize\fontsize{5.833333pt}{6.666667pt}\selectfont}
\let\pop@originaltiny\tiny
\renewcommand{\tiny}{\pop@originaltiny\fontsize{4.166667pt}{5.000000pt}\selectfont}
\let\pop@originallarge\large
\renewcommand{\large}{\pop@originallarge\fontsize{10.000000pt}{11.666667pt}\selectfont}
\let\pop@originalLarge\Large
\renewcommand{\Large}{\pop@originalLarge\fontsize{12.000000pt}{15.000000pt}\selectfont}
\let\pop@originalLARGE\LARGE
\renewcommand{\LARGE}{\pop@originalLARGE\fontsize{14.400000pt}{18.333333pt}\selectfont}
\let\pop@originalhuge\huge
\renewcommand{\huge}{\pop@originalhuge\fontsize{17.283333pt}{20.833333pt}\selectfont}
\let\pop@originalHuge\Huge
\renewcommand{\Huge}{\pop@originalHuge\fontsize{20.733333pt}{25.000000pt}\selectfont}
\normalsize

% We define a helper for blind review, which is active only in manuscript mode. In published mode, the blindreview option deliberately does nothing.
\newcommand{\pop@ifblindreview}[2]{%
  \ifpopmanuscript
    \ifpopblindreview
      #1%
    \else
      #2%
    \fi
  \else
    #2%
  \fi
}

% ============================================================
% USER INTERFACE: METADATA COMMANDS
% ============================================================
\newcommand{\poprunningauthor}[1]{\gdef\@poprunningauthor{#1}}
\newcommand{\popdoi}[1]{\gdef\@popdoi{#1}}
\newcommand{\popabstract}[1]{\gdef\@popabstract{#1}}
\newcommand{\keywords}[1]{\gdef\@popkeywords{#1}}
\newcommand{\popacknowledgements}[1]{\gdef\@popacknowledgements{#1}}
\newcommand{\popcompetinginterests}[1]{\gdef\@popcompetinginterests{#1}}

% Corresponding-author metadata.
% Split into separate fields so the title-page Article Info Column
% can style the name, address, and email differently.
\newcommand{\popcorrespondingauthor}[1]{\gdef\@popcorrespondingauthor{#1}}
\newcommand{\popcorrespondingauthoraddress}[1]{\gdef\@popcorrespondingauthoraddress{#1}}
\newcommand{\popcorrespondingauthoremail}[1]{\gdef\@popcorrespondingauthoremail{#1}}

\newcommand{\poptocite}[1]{\gdef\@poptocite{#1}}
% Publication dates.
\newcommand{\popsubmitted}[1]{\gdef\@popsubmitted{#1}}
\newcommand{\popaccepted}[1]{\gdef\@popaccepted{#1}}
\newcommand{\poppublished}[1]{\gdef\@poppublished{#1}}
\newcommand{\popcopyrightyear}[1]{\gdef\@popcopyrightyear{#1}}


% Multiple-author storage using \popauthor.
% Usage: \popauthor{Name}{Affiliation}{ORCID}
% The third argument may be empty, like so:
%   \popauthor{Name}{Affiliation}{}
%   In that case no ORCID icon or ORCID link will be printed.
\newcounter{popauthorcount}
\newcommand{\@popauthorlist}{}
\newcommand{\@popauthoraffiliationlist}{}
% Protected comma-separated author list for PDF/XMP metadata
\newcommand{\@popmetaauthorlist}{}

\newcommand{\popauthor}[3]{%
  \stepcounter{popauthorcount}%
  % Protected comma-separated author list for PDF/XMP metadata; braces keep
  % commas within an individual author's name from separating authors.
  \ifnum\value{popauthorcount}=1
    \gdef\@popmetaauthorlist{{#1}}%
  \else
    \gappto\@popmetaauthorlist{,{#1}}%
  \fi

  % Title-page author list.
  % Uses the existing title-page style: bold, uppercase, with ORCID icon.
  \gappto\@popauthorlist{%
    \pop@printauthor{#1}{#3}%
    \par\vspace{\popAuthorLineGap}%
  }%

  % Backmatter author-affiliation list.
  % Uses ordinary body typography: author name bold but not uppercased,
  % then ORCID icon and printed ORCID link if supplied, followed by
  % the affiliation on the next line.
  \gappto\@popauthoraffiliationlist{%
    \pop@printauthoraffiliation{#1}{#2}{#3}%
  }%
}

% ============================================================
% INTERNAL DEFAULTS
% ============================================================
% Empty metadata stays empty until supplied by the author or production editor.
\newcommand{\@poprunningauthor}{}
\newcommand{\@popdoi}{}
\newcommand{\@popabstract}{}
\newcommand{\@popkeywords}{}
\newcommand{\@popacknowledgements}{}
\newcommand{\@popcompetinginterests}{}
\newcommand{\@popcorrespondingauthor}{}
\newcommand{\@popcorrespondingauthoraddress}{}
\newcommand{\@popcorrespondingauthoremail}{}
\newcommand{\@poptocite}{}
\newcommand{\@popsubmitted}{}
\newcommand{\@popaccepted}{}
\newcommand{\@poppublished}{}
\newcommand{\@popcopyrightyear}{\the\year}
\newcommand{\@poporcid}{}

% ============================================================
% TITLE PAGE GEOMETRY
% ============================================================
\newlength{\popTopMargin}
\newlength{\popBottomMargin}
\newlength{\popInnerMargin}
\newlength{\popOuterMargin}
\newlength{\popMarginParWidth}
\newlength{\popMarginParSep}

\setlength{\popTopMargin}{3.333333cm}
\setlength{\popBottomMargin}{3.333333cm}
\setlength{\popInnerMargin}{1.666667cm}
\setlength{\popOuterMargin}{0.833333cm}
\setlength{\popMarginParWidth}{4.166667cm}
\setlength{\popMarginParSep}{-27ex}

\geometry{
  top=\popTopMargin,
  bottom=\popBottomMargin,
  left=\popInnerMargin,
  right=\popOuterMargin,
  marginparwidth=\popMarginParWidth,
  marginparsep=\popMarginParSep
}

% ============================================================
% BODY PAGE GEOMETRY
% ============================================================

%MARGINS
\newlength{\popBodyTopMargin}
\newlength{\popBodyBottomMargin}
\newlength{\popBodyLeftMargin}
\newlength{\popBodyRightMargin}
%PAGE NUMBER LOCATION
\newlength{\popPageNumberRight}
% RUNNING HEAD
\newlength{\popRunningHeadGap}
\newlength{\popRunningHeadWidth}
\newlength{\popRunningHeadFontSize}
\newlength{\popRunningHeadBaselineSkip}

%MARGINS
\setlength{\popBodyTopMargin}{14.833333mm}
\setlength{\popBodyBottomMargin}{14.083333mm}
\setlength{\popBodyLeftMargin}{14.833333mm}  
\setlength{\popBodyRightMargin}{53.25mm}
%PAGE NUMBER LOCATION
\setlength{\popPageNumberRight}{8.5mm}
% RUNNING HEAD
\setlength{\popRunningHeadGap}{8.083333mm}
\setlength{\popRunningHeadWidth}{33.5mm}    
\setlength{\popRunningHeadFontSize}{7pt}  
\setlength{\popRunningHeadBaselineSkip}{9pt}

% Applied after the title page, so title-page positioning remains
% governed by the title-page measurements above.
\newcommand{\popBodyGeometry}{%
  \newgeometry{
    top=\popBodyTopMargin,
    bottom=\popBodyBottomMargin,
    left=\popBodyLeftMargin,
    right=\popBodyRightMargin,
    marginparwidth=\popRunningHeadWidth,
    marginparsep=\popRunningHeadGap
  }
}

% ============================================================
% LAST PAGE GEOMETRY
% ============================================================

% Last-page bottom area.
\newlength{\popLastPageBottomMargin}
\newlength{\popLastPageLogoLeft}
\newlength{\popLastPageLogoBottom}
\newlength{\popLastPageLogoGap}
\newlength{\popLastPageOAHeight}
\newlength{\popLastPageOARaise}

\setlength{\popLastPageBottomMargin}{28.25mm} % Sets the page margin high enough that text won't hit the LSE press and orange lock logo
\setlength{\popLastPageLogoLeft}{14.833333mm} % LSE Press left alignment
\setlength{\popLastPageLogoBottom}{14.833333mm} % LSE Press and lock vertical alignment 
\setlength{\popLastPageLogoGap}{2.083333mm} % Distance between LSE press logo and orange OA icon
\setlength{\popLastPageOAHeight}{5.666667mm} % Adjustable size for orange OA icon
\setlength{\popLastPageOARaise}{2.5mm} % Bumps the orange lock logo up vertically

% Last-page Article Info Column.
\newlength{\popLastPageArticleInfoGap}
\newlength{\popLastPageArticleInfoWidth}
\newlength{\popLastPageArticleInfoBottom}
\newlength{\popLastPageArticleInfoPartGap}

\setlength{\popLastPageArticleInfoGap}{8.083333mm} % Same as for title page column
\setlength{\popLastPageArticleInfoWidth}{31.666667mm} % Same as for title page column
\setlength{\popLastPageArticleInfoBottom}{14.833333mm} % Bottom-aligned with logos
\setlength{\popLastPageArticleInfoPartGap}{7.5mm} % Vertical gap separating second `Submitted/Accepted/Published' text from other parts.

% ============================================================
% VISUAL ASSETS: LOGOS AND ICONS
% ============================================================

% Open Access icon.
\newlength{\popOAheight}

\newcommand{\popOA}[1]{%
  \setlength{\popOAheight}{#1}%
  \raisebox{-0.40\popOAheight}{\resizebox{\popOAheight}{!}{%
    \begin{tikzpicture}[x=1pt,y=1pt]
      \begin{scope}[draw=popOAOrange,line width=10pt]
        \draw (10,68) -- (10,72) arc (180:0:21) -- (52,46);
        \draw (31,31) circle (26);
      \end{scope}
      \path[fill=popOAOrange](31,31)circle(8.8);
    \end{tikzpicture}%
  }}%
}

% White Open Access icon for the title box.
\newcommand{\popOAwhite}[1]{%
  \setlength{\popOAheight}{#1}%
  \raisebox{-0.40\popOAheight}{\resizebox{\popOAheight}{!}{%
    \begin{tikzpicture}[x=1pt,y=1pt]
      \begin{scope}[draw=white,line width=10pt]
        \draw (10,68) -- (10,72) arc (180:0:21) -- (52,46);
        \draw (31,31) circle (26);
      \end{scope}
      \path[fill=white](31,31)circle(8.8);
    \end{tikzpicture}%
  }}%
}

% ORCID icon.
% This draws the green circular iD mark in TikZ.
\newlength{\popORCIDidunit}

\newcommand{\popORCIDicon}{%
  % Set an approximate visual height for the ORCID icon.
  % We no longer use \ratio here, because that caused an
  % undefined-control-sequence error in some LaTeX setups.
  \setlength{\popORCIDidunit}{0.012625mm}%

  % Raise the icon slightly so that it aligns visually with
  % the author name rather than sitting too low on the baseline.
  \raisebox{0.1ex}{%
    \begin{tikzpicture}[x=\popORCIDidunit, y=\popORCIDidunit, inner sep=0pt, outer sep=0pt]%
      \fill[popORCIDGreen] (128,128) circle (128);
      \fill[white] (70,177) rectangle (86,70);
      \fill[white] (78,200) circle (10);
      \fill[white] (109,177) -- (150,177)%
      .. controls (190,177) and (208,149)%
      .. (208,123)%
      .. controls (208,96) and (186,70)%
      .. (150,70)%
      -- (109,70)%
      -- (109,177) -- cycle%
      (124,84)%
      -- (150,84)%
      .. controls (186,84) and (192,110)%
      .. (192,123)%
      .. controls (192,145) and (178,163)%
      .. (150,163) -- (124,163)%
      -- (124,84) -- cycle;
    \end{tikzpicture}%
  }%
}

% Philosophy of Physics coloured bar mark.
\newcommand{\popColourBars}[1][4.8]{%
  \begin{tikzpicture}[scale=#1]
    \fill[popBarOne]   (0,0)          rectangle (0.91mm,6.60mm);
    \fill[popBarTwo]   (1.5mm,2.25mm) rectangle (2.41mm,6.60mm);
    \fill[popBarThree] (3.0mm,2.25mm) rectangle (3.91mm,6.60mm);
    \fill[popBarFour]  (4.5mm,2.25mm) rectangle (5.41mm,6.60mm);
    \fill[popBarFive]  (6.0mm,0)      rectangle (6.91mm,6.60mm);
    \fill[popBarSix]   (7.5mm,2.25mm) rectangle (8.41mm,6.60mm);
  \end{tikzpicture}%
}

% Philosophy of Physics combined journal logo.
% This combines the coloured Philosophy of Physics bar mark defined above
% with the journal name. The text is set in sans serif following the
% journal logo design rather than the main STIX text font.
\newcommand{\popJournalLogo}{%
  \begingroup
    \sffamily
    \fontsize{\popJournalLogoFontSize}{\popJournalLogoBaselineSkip}\selectfont
    \parbox{\popJournalLogoWidth}{%
      \centering
      \resizebox{\popJournalLogoWidth}{!}{Philosophy of Physics}\par
      \vspace{\popJournalLogoBarGap}%
      \popColourBars[\popJournalLogoBarScale]\par
    }%
  \endgroup
}

% LSE Press logo.
% This is a TikZ reconstruction of the LSE Press logo.
% Usage: \LSEPressLogo or \LSEPressLogo[0.35] for a scaled version.
\newcommand{\LSEPressLogo}[1][0.15]{%
\begin{tikzpicture}[x=#1mm,y=-#1mm,baseline=(current bounding box.south)]
  % Red square
  \fill[lsered] (0,0) rectangle (130.15,130.15);

  % White L
  \fill[white]
    (45.73,105.15) -- (24.45,105.15) -- (24.45,24.95)
    -- (33.01,24.95) -- (33.01,96.29)
    -- (45.73,96.29) -- cycle;

  % White S, transcribed from the SVG Bézier path
  \fill[white]
    (75.01,88.40)
    .. controls (73.16,100.09) and (64.19,105.27) .. (55.88,105.12)
    -- (53.20,105.12)
    -- (53.20,96.34)
    -- (55.88,96.34)
    .. controls (59.40,96.31) and (65.36,93.86) .. (66.24,88.31)
    .. controls (67.09,82.93) and (66.46,79.04) .. (59.55,67.24)
    -- (59.46,67.04)
    .. controls (54.65,59.20) and (50.09,52.35) .. (51.79,41.60)
    .. controls (53.64,29.92) and (62.78,24.77) .. (71.09,24.92)
    -- (73.77,24.92)
    -- (73.77,33.69)
    -- (71.09,33.69)
    .. controls (67.57,33.72) and (61.44,36.13) .. (60.56,41.68)
    .. controls (59.71,47.06) and (60.30,50.53) .. (67.03,62.18)
    -- (67.21,62.48)
    .. controls (72.21,70.53) and (76.71,77.64) .. (75.01,88.40)
    -- cycle;

  % White E
  \fill[white]
    (105.84,33.70) -- (92.76,33.70) -- (92.76,59.41)
    -- (104.98,59.41) -- (104.98,68.77)
    -- (92.76,68.77) -- (92.76,96.28)
    -- (105.84,96.28) -- (105.84,105.15)
    -- (84.19,105.15) -- (84.19,24.96)
    -- (105.84,24.96) -- cycle;

  % Press text
  \begin{scope}[shift={(155,45)},scale=0.75]
    \path[fill=lsered,even odd rule]
      (7.87,28.48) -- (7.87,45.27) -- (0,45.27) -- (0,0)
      -- (17.32,0)
      .. controls (22.38,0) and (26.39,1.32) .. (29.37,3.95)
      .. controls (32.34,6.59) and (33.83,10.07) .. (33.83,14.41)
      .. controls (33.83,18.75) and (32.37,22.31) .. (29.46,24.78)
      .. controls (26.55,27.25) and (22.47,28.48) .. (17.23,28.48)
      -- cycle
      (7.87,22.14) -- (17.32,22.14)
      .. controls (20.12,22.14) and (22.25,21.48) .. (23.72,20.17)
      .. controls (25.19,18.86) and (25.93,16.95) .. (25.93,14.46)
      .. controls (25.93,11.97) and (25.18,10.06) .. (23.69,8.60)
      .. controls (22.20,7.14) and (20.15,6.39) .. (17.53,6.35)
      -- (7.87,6.35) -- cycle;

    \path[fill=lsered]
      (56.75,18.53)
      .. controls (55.75,18.36) and (54.73,18.28) .. (53.67,18.28)
      .. controls (50.21,18.28) and (47.88,19.61) .. (46.67,22.26)
      -- (46.67,45.27) -- (39.12,45.27) -- (39.12,11.63)
      -- (46.33,11.63) -- (46.52,15.39)
      .. controls (48.34,12.47) and (50.87,11.01) .. (54.11,11.01)
      .. controls (55.19,11.01) and (56.08,11.16) .. (56.78,11.45)
      -- cycle;

    \path[fill=lsered,even odd rule]
      (75.51,45.89)
      .. controls (70.72,45.89) and (66.84,44.38) .. (63.87,41.37)
      .. controls (60.90,38.35) and (59.41,34.34) .. (59.41,29.32)
      -- (59.41,28.39)
      .. controls (59.41,25.03) and (60.06,22.03) .. (61.35,19.39)
      .. controls (62.64,16.75) and (64.46,14.69) .. (66.81,13.22)
      .. controls (69.15,11.75) and (71.76,11.01) .. (74.64,11.01)
      .. controls (79.22,11.01) and (82.76,12.47) .. (85.26,15.39)
      .. controls (87.76,18.31) and (89.01,22.45) .. (89.01,27.80)
      -- (89.01,30.85) -- (67.03,30.85)
      .. controls (67.26,33.63) and (68.19,35.82) .. (69.81,37.44)
      .. controls (71.44,39.06) and (73.48,39.86) .. (75.95,39.86)
      .. controls (79.41,39.86) and (82.23,38.46) .. (84.41,35.66)
      -- (88.48,39.55)
      .. controls (87.13,41.56) and (85.33,43.12) .. (83.09,44.23)
      .. controls (80.84,45.34) and (78.32,45.89) .. (75.51,45.89)
      -- cycle
      (74.61,17.07)
      .. controls (72.54,17.07) and (70.86,17.80) .. (69.59,19.25)
      .. controls (68.32,20.70) and (67.50,22.72) .. (67.15,25.31)
      -- (81.54,25.31) -- (81.54,24.75)
      .. controls (81.37,22.22) and (80.70,20.31) .. (79.52,19.01)
      .. controls (78.34,17.72) and (76.70,17.07) .. (74.61,17.07)
      -- cycle;

    \path[fill=lsered]
      (112.89,36.13)
      .. controls (112.89,34.78) and (112.34,33.76) .. (111.23,33.05)
      .. controls (110.12,32.35) and (108.28,31.72) .. (105.71,31.18)
      .. controls (103.14,30.64) and (101.00,29.96) .. (99.27,29.13)
      .. controls (95.50,27.31) and (93.61,24.66) .. (93.61,21.20)
      .. controls (93.61,18.30) and (94.83,15.87) .. (97.28,13.93)
      .. controls (99.73,11.98) and (102.83,11.01) .. (106.61,11.01)
      .. controls (110.63,11.01) and (113.88,12.01) .. (116.36,13.99)
      .. controls (118.84,15.97) and (120.08,18.56) .. (120.08,21.73)
      -- (112.53,21.73)
      .. controls (112.53,20.28) and (111.99,19.07) .. (110.91,18.11)
      .. controls (109.83,17.15) and (108.40,16.66) .. (106.62,16.66)
      .. controls (104.96,16.66) and (103.61,17.04) .. (102.56,17.81)
      .. controls (101.51,18.58) and (100.99,19.60) .. (100.99,20.89)
      .. controls (100.99,22.05) and (101.48,22.95) .. (102.45,23.60)
      .. controls (103.42,24.24) and (105.39,24.89) .. (108.36,25.54)
      .. controls (111.32,26.19) and (113.65,26.97) .. (115.34,27.87)
      .. controls (117.03,28.77) and (118.28,29.86) .. (119.10,31.12)
      .. controls (119.92,32.38) and (120.33,33.92) .. (120.33,35.72)
      .. controls (120.33,38.75) and (119.08,41.20) .. (116.57,43.07)
      .. controls (114.06,44.94) and (110.78,45.88) .. (106.71,45.88)
      .. controls (103.95,45.88) and (101.50,45.38) .. (99.34,44.39)
      .. controls (97.18,43.39) and (95.51,42.03) .. (94.30,40.29)
      .. controls (93.09,38.55) and (92.50,36.67) .. (92.50,34.66)
      -- (99.84,34.66)
      .. controls (99.94,36.44) and (100.62,37.82) .. (101.86,38.78)
      .. controls (103.10,39.74) and (104.75,40.23) .. (106.80,40.23)
      .. controls (108.85,40.23) and (110.30,39.85) .. (111.34,39.10)
      .. controls (112.38,38.34) and (112.89,37.35) .. (112.89,36.13)
      -- cycle;

    \path[fill=lsered]
      (144.93,36.13)
      .. controls (144.93,34.78) and (144.38,33.76) .. (143.27,33.05)
      .. controls (142.16,32.35) and (140.32,31.72) .. (137.75,31.18)
      .. controls (135.18,30.64) and (133.04,29.96) .. (131.31,29.13)
      .. controls (127.54,27.31) and (125.65,24.66) .. (125.65,21.20)
      .. controls (125.65,18.30) and (126.87,15.87) .. (129.32,13.93)
      .. controls (131.77,11.98) and (134.87,11.01) .. (138.65,11.01)
      .. controls (142.67,11.01) and (145.92,12.01) .. (148.40,13.99)
      .. controls (150.88,15.97) and (152.12,18.56) .. (152.12,21.73)
      -- (144.57,21.73)
      .. controls (144.57,20.28) and (144.03,19.07) .. (142.95,18.11)
      .. controls (141.87,17.15) and (140.44,16.66) .. (138.66,16.66)
      .. controls (137.00,16.66) and (135.65,17.04) .. (134.60,17.81)
      .. controls (133.55,18.58) and (133.03,19.60) .. (133.03,20.89)
      .. controls (133.03,22.05) and (133.52,22.95) .. (134.49,23.60)
      .. controls (135.46,24.24) and (137.43,24.89) .. (140.40,25.54)
      .. controls (143.36,26.19) and (145.69,26.97) .. (147.38,27.87)
      .. controls (149.07,28.77) and (150.32,29.86) .. (151.14,31.12)
      .. controls (151.96,32.38) and (152.37,33.92) .. (152.37,35.72)
      .. controls (152.37,38.75) and (151.12,41.20) .. (148.61,43.07)
      .. controls (146.10,44.94) and (142.82,45.88) .. (138.75,45.88)
      .. controls (135.99,45.88) and (133.54,45.38) .. (131.38,44.39)
      .. controls (129.22,43.39) and (127.55,42.03) .. (126.34,40.29)
      .. controls (125.13,38.55) and (124.54,36.67) .. (124.54,34.66)
      -- (131.88,34.66)
      .. controls (131.98,36.44) and (132.66,37.82) .. (133.90,38.78)
      .. controls (135.14,39.74) and (136.79,40.23) .. (138.84,40.23)
      .. controls (140.89,40.23) and (142.34,39.85) .. (143.38,39.10)
      .. controls (144.42,38.34) and (144.93,37.35) .. (144.93,36.13)
      -- cycle;
  \end{scope}
\end{tikzpicture}%
}

% Article type label.
% Published articles say RESEARCH; manuscripts say UNPUBLISHED MANUSCRIPT; and blind review manuscripts say UNPUBLISHED MANUSCRIPT FOR REVIEW.
\newcommand{\popResearchLabel}{%
  \begingroup
    \normalfont
    \bfseries
    \fontsize{\popResearchFontSize}%
             {\popResearchBaselineSkip}\selectfont
    \pop@ifblindreview{%
      \shortstack[l]{UNPUBLISHED\\[1.5mm]MANUSCRIPT\\[1.5mm]FOR REVIEW}%
    }{%
      \ifpopmanuscript
        \shortstack[l]{UNPUBLISHED\\[1.5mm]MANUSCRIPT}%
      \else
        RESEARCH%
      \fi
    }%
  \endgroup
}

% ============================================================
% TITLE PAGE: MEASUREMENTS
% ============================================================
% Publisher page size: 175mm x 250mm (approximately 496 x 709 PDF points).
% Geometry follows the measured coloured blocks and asymmetric text column.
% Individual font sizes follow the publisher PDFs rather than a uniform scale.

\newlength{\popTitleBlockLeftMargin}
\newlength{\popTitleBoxWidth}
\newlength{\popTitleBoxHeight}

\newlength{\popTitlePadLeft}
\newlength{\popTitlePadRight}
\newlength{\popTitlePadTop}
\newlength{\popTitlePadBottom}

\newlength{\popTitleLockWidth}
\newlength{\popTitleLockTopPad}

\newlength{\popAbstractBoxLeft}
\newlength{\popAbstractBoxWidth}
\newlength{\popAbstractPadLeft}
\newlength{\popAbstractPadRight}
\newlength{\popAbstractPadTop}
\newlength{\popAbstractPadBottom}
\newlength{\popAbstractTextWidth}
\newlength{\popAbstractHeadingFontSize}
\newlength{\popAbstractHeadingBaselineSkip}
\newlength{\popAbstractBodyFontSize}
\newlength{\popAbstractBodyBaselineSkip}
\newlength{\popAbstractHeadingGap}
\newlength{\popTextRightIndent}

% Lengths for the Article Info column to the right of the abstract block.
\newlength{\popArticleInfoGap}
\newlength{\popArticleInfoWidth}
\newlength{\popArticleInfoTopPad}
\newlength{\popArticleInfoBottomPad}
\newlength{\popArticleInfoFontSize}
\newlength{\popArticleInfoBaselineSkip}
\newlength{\popArticleInfoNameGap}
\newlength{\popArticleInfoRuleGap}
\newlength{\popArticleInfoRuleThickness}

% Journal logo lengths.
\newlength{\popJournalLogoX}
\newlength{\popJournalLogoY}
\newlength{\popJournalLogoWidth}
\newlength{\popJournalLogoFontSize}
\newlength{\popJournalLogoBaselineSkip}
\newlength{\popJournalLogoBarGap}
\newcommand{\popJournalLogoBarScale}{1.1} % Command, not length, for insertion in TikZ.

% Article Type ('RESEARCH') lengths.
\newlength{\popResearchX}
\newlength{\popResearchY}
\newlength{\popResearchFontSize}
\newlength{\popResearchBaselineSkip}

\newlength{\popTitleFontSize}
\newlength{\popTitleBaselineSkip}

\newlength{\popAuthorX}
\newlength{\popAuthorGapBelowTitle}
\newlength{\popAuthorFontSize}
\newlength{\popAuthorLineGap}
\newlength{\popAuthorWordSpace}
\newlength{\popOrcidGap}
\newlength{\popAuthorBlockWidth}

% Lengths for the Title Block, i.e. the blue rectangle and associated structures.
\setlength{\popTitleBlockLeftMargin}{14.833333mm}
\setlength{\popTitleBoxWidth}{106.916667mm}      
\setlength{\popTitleBoxHeight}{87.833333mm}     

\setlength{\popTitlePadLeft}{6mm}         
\setlength{\popTitlePadRight}{9.25mm}        
\setlength{\popTitlePadTop}{10.25mm}         
\setlength{\popTitlePadBottom}{2.666667mm}       

\setlength{\popTitleLockWidth}{8.5mm}      
\setlength{\popTitleLockTopPad}{11.666667mm}

% Lengths for the Abstract Block, i.e. the grey rectangle below.
\setlength{\popTextRightIndent}{0cm}
\setlength{\popAbstractBoxLeft}{14.833333mm}
\setlength{\popAbstractBoxWidth}{106.916667mm}
\setlength{\popAbstractPadLeft}{5.666667mm}
\setlength{\popAbstractPadTop}{6.083333mm}
\setlength{\popAbstractPadRight}{5.666667mm}
\setlength{\popAbstractPadBottom}{14.833333mm}
\setlength{\popAbstractTextWidth}{%
  \dimexpr
    \popAbstractBoxWidth
    - \popAbstractPadLeft
    - \popAbstractPadRight
  \relax
}

% Lengths for the Article Info Column.
\setlength{\popArticleInfoGap}{7.409167mm}
\setlength{\popArticleInfoWidth}{31.048333mm}
\setlength{\popArticleInfoTopPad}{6mm}
\setlength{\popArticleInfoBottomPad}{14.833333mm}
\setlength{\popArticleInfoFontSize}{7pt}
\setlength{\popArticleInfoBaselineSkip}{10pt}
\setlength{\popArticleInfoNameGap}{1.25mm}
\setlength{\popArticleInfoRuleGap}{4mm}
\setlength{\popArticleInfoRuleThickness}{0.705833mm}

% PoP Journal Logo lengths: coloured bars and text.
\setlength{\popJournalLogoX}{129.166667mm}
\setlength{\popJournalLogoY}{4.166667mm}
\setlength{\popJournalLogoWidth}{30.833333mm}
\setlength{\popJournalLogoFontSize}{10pt}
\setlength{\popJournalLogoBaselineSkip}{0pt}
\setlength{\popJournalLogoBarGap}{0.833333mm}
\renewcommand{\popJournalLogoBarScale}{3.333333}

% Article Type ('RESEARCH') lengths.
\setlength{\popResearchX}{129.166667mm}
\setlength{\popResearchFontSize}{9.5pt}
\setlength{\popResearchBaselineSkip}{12.5pt}
\setlength{\popResearchY}{%
  \dimexpr
    \popTitleBoxHeight
    - 6mm % Research-label position is independent of title-text padding.
  \relax
}

% Abstract typography.
\setlength{\popAbstractHeadingFontSize}{12pt}
\setlength{\popAbstractHeadingBaselineSkip}{0pt}
\setlength{\popAbstractBodyFontSize}{8pt}
\setlength{\popAbstractBodyBaselineSkip}{12.5pt}
\setlength{\popAbstractHeadingGap}{2.5mm}

% Author position.
% Author position rescaled to the publisher page dimensions.
\setlength{\popAuthorX}{21.169167mm}
\setlength{\popAuthorGapBelowTitle}{7mm}

% Author typography.
\setlength{\popAuthorFontSize}{10pt}
\setlength{\popAuthorLineGap}{2.5mm}
\setlength{\popAuthorWordSpace}{1.5mm}
\setlength{\popOrcidGap}{1mm}
\setlength{\popAuthorBlockWidth}{91.666667mm}

% Title font and line height.
\setlength{\popTitleFontSize}{23pt}
\setlength{\popTitleBaselineSkip}{28pt}

% ============================================================
% TITLE PAGE: COMPONENTS
% ============================================================

% Author-list typesetting.
\newcommand{\pop@printauthor}[2]{%
  \begingroup
    % Author names use the same main font family as the title.
    % They are bold and uppercased to match the journal style.
    \fontsize{\popAuthorFontSize}{1.2\popAuthorFontSize}\selectfont
    \bfseries

    % Widen spacing between words in author names if needed.
    \spaceskip=\popAuthorWordSpace
    \xspaceskip=\popAuthorWordSpace

    % Keep the author name and its ORCID icon together on one line.
    % This prevents TeX from breaking the line between the name and
    % the icon inside the fixed-width title-page author block.
    \mbox{%
      \MakeUppercase{#1}%
      \IfStrEq{#2}{}{}{% 
        \hspace{\popOrcidGap}%
        \href{https://orcid.org/#2}{\popORCIDicon}%
      }%
    }%
  \endgroup
}

% Print the full author block.
% If \popauthor has been used, this prints all stored authors.
% Otherwise it falls back to standard \author (without an ORCID).
% Use \popauthor to obtain affiliations and published PDF author metadata.
\newcommand{\pop@authorblockcontents}{%
  \ifnum\value{popauthorcount}>0
    \@popauthorlist
    \ifnum\value{popauthorcount}>1
      % This affiliation note appears only for multi-author papers.
      % It is 7.5pt and normal weight, following the supplied examples.
      {\fontsize{7.5pt}{9.166667pt}\selectfont
       \normalfont
       \textsuperscript{*}Author affiliations can be found in the back matter of this article\par}%
    \fi
  \else
    % Backwards-compatible single-author fallback.
    \pop@printauthor{\@author}{\@poporcid}%
  \fi
}

% Print one author-affiliation entry for the backmatter.
% Author name is bold, but not uppercased. The ORCID icon and
% printed ORCID link are kept together with the name whenever possible.
\newcommand{\pop@printauthoraffiliation}[3]{%
  \begingroup
    \normalfont
    \fontsize{8pt}{\the\popBodyBaselineSkip}\selectfont
    \setlength{\parindent}{0pt}%
    \setlength{\parskip}{0pt}%

    \leavevmode
    \textbf{#1}%
    \IfStrEq{#3}{}{}{%
      \nobreak\hspace{\popOrcidGap}%
      \mbox{%
        \href{https://orcid.org/#3}{\popORCIDicon}%
        \hspace{0.4em}%
        \href{https://orcid.org/#3}{orcid.org/#3}%
      }%
    }%
    \par
    #2\par
  \endgroup
  \par\addvspace{\popAuthorAffiliationEntryGap}%
}

\newcommand{\popTitleBlock}{%
  % Draw at shipout in page-local coordinates, without saved TikZ positions.
  % This keeps the title page correct on the first run and after mode changes.
  \AddToHookNext{shipout/foreground}{%
    \put(0,0){%
    \begin{tikzpicture}[overlay]
      \node[anchor=north west,inner sep=0pt,outer sep=0pt,
            minimum width=\paperwidth,minimum height=\paperheight]
        (popTitlePage) at (0,0) {};

    % Main blue title box.
    \node[
      anchor=north west,
      minimum width=\popTitleBoxWidth,
      minimum height=\popTitleBoxHeight,
      draw=none,
      fill=popDark,
      inner sep=0pt
    ] (titlebox) at
      ([xshift=\popTitleBlockLeftMargin]popTitlePage.north west) {};

    % White Open Access icon in the title box.
    \node[
      anchor=north east,
      inner sep=0pt
    ] (oa) at
      ([xshift=-6.25mm,
        yshift=-\popTitleLockTopPad]titlebox.north east)
      {\popOAwhite{\popTitleLockWidth}};

    % Article title text.
    \node[
      anchor=south west,
      inner sep=0pt,
      align=left
    ] (titletext) at
      ([xshift=\popTitlePadLeft,
        yshift=\popTitlePadBottom]titlebox.south west)
      {%
        \parbox{\dimexpr
          \popTitleBoxWidth
          -\popTitlePadLeft
          -\popTitlePadRight
        \relax}{%
          \raggedright
          \fontsize{\the\popTitleFontSize}{\the\popTitleBaselineSkip}\selectfont
          % A fixed final-line depth keeps the baseline independent of whether
          % the final word contains a descender (e.g. Equivalence/Cosmology).
          \textcolor{white}{\@title\rule[-5pt]{0pt}{5pt}}\par
        }%
      };

    % Author name.
    % Hidden in blind-review manuscript mode.
    \pop@ifblindreview{}{%
      \node[
        anchor=north west,
        inner sep=0pt,
        text width=\popAuthorBlockWidth,
        align=left
      ] (author) at
        ([xshift=\popAuthorX,
          yshift={-\dimexpr\popTitleBoxHeight+\popAuthorGapBelowTitle\relax}]
         popTitlePage.north west)
        {\pop@authorblockcontents};
    }%

    % Philosophy of Physics journal logo.
    \node[
      anchor=north west,
      inner sep=0pt
    ] (journal-logo) at
      ([xshift=\popJournalLogoX,
        yshift=-\popJournalLogoY]
       popTitlePage.north west)
      {\popJournalLogo};

    % Article type label: RESEARCH.
    \node[
      anchor=base west,
      inner sep=0pt
    ] (research-label) at
      ([xshift=\popResearchX,
        yshift=-\popResearchY]
       popTitlePage.north west)
      {\popResearchLabel};

    % LSE Press logo.
    \node[
      anchor=north west,
      inner sep=0pt
    ] (lse-press-logo) at
      ([xshift=\popResearchX,
        yshift={-\dimexpr\popTitleBoxHeight+\popAuthorGapBelowTitle\relax}]
       popTitlePage.north west)
      {\LSEPressLogo[0.08]};
      
  \end{tikzpicture}%
    }%
  }%

  % The title page graphics are overlaid and therefore take up no
  % normal vertical space. This reserves space so that later material
  % begins below the title box.
  \vspace*{\dimexpr\popTitleBoxHeight-\popTopMargin\relax}%
}

% Abstract block + Article Info Column.
\newsavebox{\popAbstractContentBox}
\newsavebox{\popArticleInfoBox}
\newlength{\popAbstractContentHeight}
\newlength{\popArticleInfoHeight}
\newlength{\popAbstractFinalHeight}

\newcommand{\popAbstractBlock}{%
  % First build the abstract content in a box so we can measure it.
  \sbox{\popAbstractContentBox}{%
    \parbox{\popAbstractTextWidth}{%
      {\fontsize{\the\popAbstractHeadingFontSize}
        {\the\popAbstractHeadingBaselineSkip}
        \selectfont
        \bfseries
        ABSTRACT\par}%
      \vspace{\popAbstractHeadingGap}%
      {\fontsize{\the\popAbstractBodyFontSize}
        {\the\popAbstractBodyBaselineSkip}
        \selectfont
        \@popabstract\par}%
    }%
  }%

  % Build the Article Info Column in a box so its height can also
  % be measured. The abstract grey box will then grow if this column
  % is taller than the abstract text.
  \pop@ifblindreview{\sbox{\popArticleInfoBox}{}}{%
  \sbox{\popArticleInfoBox}{%
    \parbox{\popArticleInfoWidth}{%
      \fontsize{\popArticleInfoFontSize}{\popArticleInfoBaselineSkip}\selectfont
      \raggedright

      \textbf{CORRESPONDING AUTHOR:}\par

      \vspace{\popArticleInfoNameGap}%
      \textbf{\@popcorrespondingauthor}\par
      \vspace{\popArticleInfoNameGap}%

      \@popcorrespondingauthoraddress\par
      \vspace{\popArticleInfoNameGap}%

      \href{mailto:\@popcorrespondingauthoremail}{\@popcorrespondingauthoremail}\par

      \vspace{\popArticleInfoRuleGap}%
      \noindent\rule{\popArticleInfoWidth}{\popArticleInfoRuleThickness}\par
      \vspace{\popArticleInfoRuleGap}%

      \textbf{TO CITE THIS ARTICLE:}\par
      \@poptocite\par
    }%
  }%

  }% End non-blind article-info construction.

  % Measure total required heights.
  \setlength{\popAbstractContentHeight}{%
    \dimexpr
      \ht\popAbstractContentBox
      + \dp\popAbstractContentBox
      + \popAbstractPadTop
      + \popAbstractPadBottom
    \relax
  }%

  % Total height needed by the Article Info Column.
  % We include both top and bottom padding so that, when this column is taller than the abstract text, the grey block grows enough to leave visible space below the column as well.
  % The column in its entirety is hidden in blind-review mode.
  \pop@ifblindreview{%
    \setlength{\popArticleInfoHeight}{0pt}%
  }{%
    \setlength{\popArticleInfoHeight}{%
      \dimexpr
        \ht\popArticleInfoBox
        + \dp\popArticleInfoBox
        + \popArticleInfoTopPad
        + \popArticleInfoBottomPad
      \relax
    }%
  }%

  % Choose the larger height, so the grey abstract block grows
  % whenever the Article Info Column is taller than the abstract.
  \setlength{\popAbstractFinalHeight}{\popAbstractContentHeight}%
  \ifdim\popArticleInfoHeight>\popAbstractFinalHeight
    \setlength{\popAbstractFinalHeight}{\popArticleInfoHeight}%
  \fi

  % Draw at shipout in page-local coordinates, without saved TikZ positions.
  % This keeps the title page correct on the first run and after mode changes.
  \AddToHookNext{shipout/foreground}{%
    \put(0,0){%
    \begin{tikzpicture}[overlay]
      \node[anchor=north west,inner sep=0pt,outer sep=0pt,
            minimum width=\paperwidth,minimum height=\paperheight]
        (popTitlePage) at (0,0) {};

    % Grey abstract rectangle.
    % Its height is measured dynamically from the larger of:
    %   • abstract text + padding
    %   • Article Info Column + top and bottom padding
    \node[
      anchor=south west,
      inner sep=0pt,
      draw=none,
      fill=popAbstractGrey,
      minimum width=\popAbstractBoxWidth,
      minimum height=\popAbstractFinalHeight
    ] (abstractbox) at
      ([xshift=\popAbstractBoxLeft]popTitlePage.south west) {};

    % Abstract content inside the grey box.
    \node[
      anchor=north west,
      inner sep=0pt
    ] at
      ([xshift=\popAbstractPadLeft,
        yshift=-\popAbstractPadTop]abstractbox.north west)
      {\usebox{\popAbstractContentBox}};

    % Article Info Column.
    % Hidden in blind-review manuscript mode.
    \pop@ifblindreview{}{%
      \node[
        anchor=north west,
        inner sep=0pt
      ] at
        ([xshift=\popArticleInfoGap,
          yshift=-\popArticleInfoTopPad]abstractbox.north east)
        {\usebox{\popArticleInfoBox}};
    }%

  \end{tikzpicture}%
    }%
  }%
}

% ============================================================
% MAIN BODY STYLE
% ============================================================

% Body-text paragraph style.
% The article body uses the measured 8pt size, with explicit
% controls for line height and paragraph spacing.
\newlength{\popBodyBaselineSkip}
\newlength{\popBodyParagraphGap}
\setlength{\popBodyBaselineSkip}{12.5pt} % Adjustable body line height.
\setlength{\popBodyParagraphGap}{6.666667pt}  % Adjustable gap between paragraphs.
% Apply body paragraph settings. This is called after the title page, not at \AtBeginDocument, so it does not interfere with title-page typography.
\newcommand{\popApplyBodyTextStyle}{%
  \fontsize{8pt}{\the\popBodyBaselineSkip}\selectfont
  \setlength{\parindent}{0pt}%
  \setlength{\parskip}{\popBodyParagraphGap}%
}

% Itemised and enumerated lists: use the ordinary environments, without
% manual spacing or bold commands. Items and paragraphs within an item follow
% the current line spacing, with no extra vertical gap. The journal examples
% reviewed during development have about 9pt of extra space above and below
% each list. LaTeX already adds the surrounding paragraph's \parskip, so the
% outermost list adds only 2.333333pt to the 6.666667pt body paragraph gap.
% Zero partopsep makes this independent of blank lines in the author's source.
% Nested lists add no surrounding gap. Preserve the standard labels and
% indentation; these settings do not change descriptions or the bibliography.
\newlength{\popListTopSep}
\setlength{\popListTopSep}{2.333333pt} % Added to the surrounding paragraph gap.
\setlist[itemize,enumerate]{itemsep=0pt,parsep=0pt,topsep=0pt,partopsep=0pt}
\setlist[itemize,enumerate,1]{topsep=\popListTopSep}
% Only enumeration labels are bold; item text and \ref values keep their
% surrounding font. This also covers nested labels and explicit \item[label].
\setlist*[enumerate]{font=\bfseries}

% Section headings.
\titleformat{\section}
  {\Large\bfseries\uppercase}
  {\thesection \;}
  {0.25em}
  {}

\titleformat{\subsection}
  {\large\bfseries\uppercase}
  {\thesubsection \;}
  {0.25em}
  {}

\titlespacing*{\section}{0pt}{4.166667mm}{0mm}
\titlespacing*{\subsection}{0pt}{2.083333mm}{0mm}

% Footnote style.
\newlength{\popFootnoteFontSize}
\newlength{\popFootnoteBaselineSkip}
\newlength{\popFootnoteNumberGap}
\newlength{\popFootnoteItemGap}

\setlength{\popFootnoteFontSize}{7pt}       % Adjustable footnote font size.
\setlength{\popFootnoteBaselineSkip}{8.5pt}  % Adjustable footnote line height.
\setlength{\popFootnoteNumberGap}{2em}    % Gap after footnote number.
\setlength{\popFootnoteItemGap}{5pt}        % Gap between separate footnotes.

% Space between the main text and the footnote block.
\setlength{\skip\footins}{6.666667pt plus 1.666667pt minus 0.833333pt}

% Keep LaTeX's own inter-footnote mechanism neutral, and add the visible gap directly in \@makefntext below.
\setlength{\footnotesep}{0pt}

% Remove the default footnote rule and replace with a custom one that spans the page
\renewcommand{\footnoterule}{%
  \kern -1pt
  \hrule width \columnwidth height 0.5pt
  \kern 2.6pt
}

% Footnote marker in the body text.
\renewcommand{\@makefnmark}{%
  \textsuperscript{\@thefnmark}%
}

% Footnote text at the bottom of the page. The label uses the note-text size,
% not superscript, followed by an adjustable gap before the note text.
\renewcommand{\@makefntext}[1]{%
  \vspace{\popFootnoteItemGap}%
  \begingroup
    \fontsize{\the\popFootnoteFontSize}%
    {\the\popFootnoteBaselineSkip}\selectfont
    \raggedright
    \setlength{\parindent}{0pt}%
    \setlength{\parskip}{0pt}%
    \noindent
    \makebox[0pt][l]{\@thefnmark}%
    \hspace{\popFootnoteNumberGap}%
    #1%
    \par
  \endgroup
}

% Spacing between authors in affiliation list at the end of the article
\newlength{\popAuthorAffiliationEntryGap}
\setlength{\popAuthorAffiliationEntryGap}{5pt}

% Shared running-head contents: measure the same box used at shipout rather
% than assuming two lines. Published articles with a DOI have a third line.
\newcommand{\pop@runningheadcontents}{%
  \begingroup
    % Use explicit line boxes with local font and paragraph settings.
    % This prevents body-text spacing from affecting the running head.
    \normalfont
    \fontsize{\the\popRunningHeadFontSize}%
             {\the\popRunningHeadBaselineSkip}\selectfont
    \setlength{\parindent}{0pt}%
    \setlength{\parskip}{0pt}%

    \vtop{%
      \hsize=\popRunningHeadWidth
      % Normal TeX interline glue sets the configured baseline spacing.
      % Extra vertical skips here would increase it beyond that setting.
      \hbox{\@poprunningauthor}%
      \ifpopmanuscript
        \hbox{\emph{Unpublished Manuscript}}%
      \else
        \hbox{\textit{Philosophy of Physics}}%
        \IfStrEq{\@popdoi}{}{%
          % No DOI supplied: do not substitute manuscript text.
        }{%
          \hbox{\href{https://doi.org/\@popdoi}{DOI: \@popdoi}}%
        }%
      \fi
    }%
  \endgroup%
}

% ============================================================
% FIGURES AND CAPTIONS
% ============================================================

% To make figure captions appear to the right of the figure (rather than above or below) we use SCfigure / SCtable. But, we make a few adjustments to match the journal style.
% First, images/tables are automatically left-aligned in a full body-width area, even when their natural width is much smaller.
% Second, the caption starts at the running head's left edge, has exactly \popRunningHeadWidth of space, and normally aligns with the image/table top.
% There's a tricky thing though, that when the figure is at the top of the page, the caption would overlap the running header. So, near the page top only, the caption is lowered to clear the running head. Blind review has no head and needs no offset though.

% Usage (no manual padding, minipage, or \centering is required):
%   \begin{SCfigure}[1][tbp]
%     \includegraphics[width=0.5\textwidth]{your-figure}
%     \caption{Explain the figure.}\label{fig:example}
%   \end{SCfigure}
%   A TikZ picture or a tabular can replace the graphic.

\captionsetup{format=plain,font=footnotesize,labelfont=bf,labelsep=space,
  justification=raggedright,singlelinecheck=false}
\DeclareCaptionFont{popmargin}{%
  \fontsize{\popRunningHeadFontSize}{\popRunningHeadBaselineSkip}\selectfont}
\captionsetup[SCfigure]{font=popmargin}
\captionsetup[SCtable]{font=popmargin}
\renewcommand{\sidecaptionsep}{\popRunningHeadGap}
\renewcommand*{\SC@justify@body}{\raggedright}
\let\pop@originalSCcalcwidths\SC@calcwidths
\renewcommand*{\SC@calcwidths}[1]{%
  \isSC@WIDE{%
    \SC@BOXWD=\textwidth
    \SC@CAPWD=\popRunningHeadWidth
    \SC@tempdimb=\dimexpr
      \textwidth+\popRunningHeadGap+\popRunningHeadWidth\relax
  }{\pop@originalSCcalcwidths{#1}}%
}

% Save the unshifted caption top, not its text position after padding. This keeps the adjustment stable on later passes and leaves all image coordinates unchanged. The padding is inside the caption minipage, so even a very short image reserves enough float height for the lowered caption:
\newlength{\popMarginCaptionHeadGap}
\setlength{\popMarginCaptionHeadGap}{2\popRunningHeadBaselineSkip}
\newsavebox{\pop@runningheadmeasure}
\newdimen\pop@captionclearance
\zref@addprop{savepos}{abspage}
\newcommand{\pop@marginCaptionClearance}{%
  \isSC@WIDE{%
    \edef\pop@captionposition{pop-caption-\SC@IDENT}%
    \zsavepos{\pop@captionposition}%
    \pop@ifblindreview{}{%
      \zref@refused{\pop@captionposition}%
      \ifnum\zref@extractdefault{\pop@captionposition}{abspage}{0}>1\relax
        % Include TikZ's text-node paragraph box, just as in the actual head.
        \sbox{\pop@runningheadmeasure}{%
          \tikz{\node[inner sep=0pt,text width=\popRunningHeadWidth,align=left]
            {\pop@runningheadcontents};}}%
        % Positions are stored in scaled points measured up from the page
        % bottom. Subtract the maximum safe y from the unshifted caption y.
        \pop@captionclearance=\dimexpr
          \zposy{\pop@captionposition}sp-\paperheight+\popBodyTopMargin
          +\ht\pop@runningheadmeasure+\dp\pop@runningheadmeasure
          +\popMarginCaptionHeadGap\relax
        \ifdim\pop@captionclearance>0pt
          \vskip\pop@captionclearance
        \fi
      \fi
    }%
  }{}%
}
% Insert after the caption minipage's zero-height anchor rule (sidecap 1.6f).
% Leave SC@justify itself unchanged: caption uses it to choose justification:
\patchcmd{\endSC@FLOAT}{\SC@justify}%
  {\pop@marginCaptionClearance\SC@justify}{}{%
  \ClassError{philphys}{Cannot install margin caption clearance}%
    {The sidecap layout hooks have changed; update philphys.cls.}%
}

% Right-margin floats must be anchored left on both odd and even pages;
% sidecap's default wide alignment can otherwise alternate in twoside mode:
\renewcommand*{\isSC@ODD}[2]{#1}
\sidecaptionvpos{figure}{t}
\sidecaptionvpos{table}{t}

% ============================================================
% BIBLIOGRAPHY AND CITATIONS
% ============================================================

% Bibliography / references style.
\renewcommand{\refname}{References}

\setcitestyle{authoryear,round,aysep={ },notesep={, }}
% Published reference lists use 12pt leading, a 6.15mm hanging indent,
% and no extra blank gap between entries (measured across all four PDFs).
% Prefer breaks between entries. LaTeX's list machinery resets clubpenalty
% from @clubpenalty at each item; protect that first line as well as natbib's
% last-line penalty so a short entry moves intact when footer space is reserved.
\renewcommand{\bibfont}{\fontsize{8pt}{12pt}\selectfont
  \@clubpenalty10000\interlinepenalty6000}
\setlength{\bibhang}{6.15mm}
\setlength{\bibsep}{0pt}

% Natbib uses \bibsection for the bibliography heading. We format it manually rather than relying on \section*, since bibliography headings can otherwise bypass the class section style.
\renewcommand{\bibsection}{%
  % References should behave like an ordinary unnumbered section.
  % Do not insert negative space here; let \section* use the same
  % spacing as the other backmatter headings.
  \section*{References}%
}

% ============================================================
% HEADERS AND FOOTERS
% ============================================================

\pagestyle{empty}
% Title-page style: set to blank.
\fancypagestyle{poptitlepage}{%
  \fancyhead{}%
  \fancyfoot{}%
  \renewcommand{\headrulewidth}{0pt}%
  \renewcommand{\footrulewidth}{0pt}%
}

% Absolute running-head and page-number placement.
% Printed only from page 2 onward. The title page counts as page 1
% but remains visually unnumbered.

\AddToHook{shipout/foreground}{%
  \ifnum\value{page}>1\relax
    \begin{tikzpicture}[remember picture,overlay]

      % Running head.
      % This is typeset in its own local group so it does not inherit
      % the body-text baseline skip or paragraph spacing.
      % Hidden in blind-review mode.
      \pop@ifblindreview{}{%
      \node[
        anchor=north west,
        inner sep=0pt,
        text width=\popRunningHeadWidth,
        align=left
      ] at
        ([xshift={-\dimexpr\popBodyRightMargin-\popRunningHeadGap\relax},
          yshift=-\popBodyTopMargin]current page.north east)
                  {%
          \pop@runningheadcontents
        };
        }%

      % Page number.
      \node[
        anchor=north east,
        inner sep=0pt
      ] at
        ([xshift=-\popPageNumberRight,
          yshift=-\popBodyTopMargin]current page.north east)
        {\normalfont\bfseries\thepage};

    \end{tikzpicture}%
  \fi
}

% ============================================================
% BACKMATTER STYLE
% ============================================================
\newcommand{\popbackmatter}{%
  \pop@ifblindreview{}{%

    \IfStrEq{\@popacknowledgements}{}{%
    }{%
      \section*{Acknowledgements}
      \@popacknowledgements
    }%

    \section*{Competing Interests}
    \@popcompetinginterests

    \ifnum\value{popauthorcount}>0
      \section*{Author Affiliations}
      \vspace{5.833333pt}%
      \@popauthoraffiliationlist
    \fi
  }%
}

% ============================================================
% LAST PAGE STYLE
% ============================================================

% Last-page Article Info Column:
% Printed only on the final page, using the same typography as the title-page Article Info Column.
% Default notice for journal article content; the package licence is in LICENSE.txt.
\newcommand{\popArticleCopyrightNotice}{%
    \copyright \@popcopyrightyear\ The Author(s). This is an
    open-access article distributed under the terms of the
    Creative Commons Attribution 4.0 International Licence
    (CC-BY 4.0), which permits unrestricted use, distribution,
    and reproduction in any medium, provided the original author
    and source are credited. See
    \url{https://creativecommons.org/licenses/by/4.0/}.%
}

\newcommand{\popLastPageArticleInfoColumn}{%
  \begingroup
    \normalfont
    \fontsize{\popArticleInfoFontSize}
             {\popArticleInfoBaselineSkip}\selectfont
    \raggedright
    \setlength{\parindent}{0pt}
    \setlength{\parskip}{0pt}

    % Citation
    % ------------------------------------------------------------

    \textbf{TO CITE THIS ARTICLE:}\par
    \@poptocite\par

    \ifpopmanuscript
      \vspace{\popLastPageArticleInfoPartGap}
    \else
      \vspace{\popLastPageArticleInfoPartGap}

      % Publication history
      % ------------------------------------------------------------
      % Horizontally compressed slightly so full month names fit.
      \begingroup
      \def\popDateLine##1##2{%
        \noindent\scalebox{0.94}[1]{%
          \textbf{##1:} ##2%
        }\par
      }%
      \popDateLine{Submitted}{\@popsubmitted}%
      \popDateLine{Accepted}{\@popaccepted}%
      \popDateLine{Published}{\@poppublished}%
      \endgroup

      \vspace{\popLastPageArticleInfoPartGap}
    \fi

    % Copyright
    % ------------------------------------------------------------

    \textbf{COPYRIGHT:}\par

    \popArticleCopyrightNotice

    \par

    \emph{Philosophy of Physics} is a peer-reviewed open access
    journal published by LSE Press.

  \endgroup
}

% LAST PAGE FOOTER
% Generates all the material for the special footer on the final page.
%
% Strategy:
%   1. Do not reserve logo space using an invisible rule in the main text.
%      That does not protect against footnotes, because LaTeX places
%      footnotes in a separate bottom insertion area.
%
%   2. Reserve the logo strip when end matter starts (popbackmatter or the
%      bibliography), before references and footnotes are committed to a page.
%      Reduce both the current page goal and LaTeX's column heights; a late
%      enlargethispage cannot reconsider the page builder's earlier choices.
%
%   3. Keep the larger bottom margin throughout end matter, including any
%      following pages. This gives a stable break when reserving the strip
%      causes references to move onto another page. Earlier body pages retain
%      their normal margins. Never insert an empty page solely for the logos.
%
%   4. Anchor the footer in local physical-page coordinates, not remembered
%      TikZ positions. Adding/moving a TikZ figure changes picture IDs; stale
%      auxiliary positions must never move logos over that figure.
%
%   5. The LSE Press and OA logos are always printed, including in
%      blind-review mode. Only the article-info column is suppressed in
%      blind-review mode.
%
% shipout/lastpage receives an ordinary box at the engine's output origin,
% unlike shipout/foreground, whose picture origin is the page's upper left.
% Undo that origin here before drawing. pdfTeX/LuaTeX expose their origins;
% XeTeX uses the standard 1in origin. No PGF position labels are needed.
\newcommand{\pop@lastpageoverlay}[1]{%
  \begingroup
    \ifdefined\pdfvariable
      \dimen@=\pdfvariable horigin\relax
      \@tempdima=\pdfvariable vorigin\relax
    \else
      \dimen@=1in
      \@tempdima=1in
      \ifdefined\pdfhorigin \dimen@=\pdfhorigin\relax \fi
      \ifdefined\pdfvorigin \@tempdima=\pdfvorigin\relax \fi
    \fi
    \kern-\dimen@
    \raise\@tempdima\hbox{%
      \begin{tikzpicture}[overlay]
        \node[anchor=north west,inner sep=0pt,outer sep=0pt,
              minimum width=\paperwidth,minimum height=\paperheight]
          (popFooterPage) at (0,0) {};
        #1%
      \end{tikzpicture}%
    }%
  \endgroup
}

% Reserve the footer strip at the start of end matter, while page breaking
% can still account for the references and footnote insertion. Keep the shorter
% height on subsequent end-matter pages so the last-page choice cannot oscillate.
\newif\ifpop@footerzonereserved
\pop@footerzonereservedfalse
\newcommand{\pop@reservefooterzone}{%
  \ifpop@footerzonereserved\else
    \par
    \global\pop@footerzonereservedtrue
    \dimen@=\dimexpr\popLastPageBottomMargin-\popBodyBottomMargin\relax
    \ifdim\dimen@>0pt
      % \textheight governs later pages; the other registers govern the
      % current column, including space already reserved for top floats/notes.
      \global\advance\textheight-\dimen@
      \global\advance\@colht-\dimen@
      \global\advance\@colroom-\dimen@
      \global\advance\vsize-\dimen@
      \ifdim\pagegoal<\maxdimen
        \global\pagegoal=\dimexpr\pagegoal-\dimen@\relax
      \fi
    \fi
  \fi
}
% Optional for an article without back matter or a bibliography: call
% \popreservefooter before its final section (while that page still has room).
% The standard template needs no extra command; reservation starts automatically.
% Keep \poplastpagefooter at the end to install the actual last-page graphics.
\newcommand{\popreservefooter}{\pop@reservefooterzone}
\pretocmd{\popbackmatter}{\pop@reservefooterzone}{}{%
  \ClassError{philphys}{Cannot install footer reservation}{Update philphys.cls.}%
}
\BeforeBeginEnvironment{thebibliography}{\pop@reservefooterzone}

\newcommand{\pop@lastpagefooter}{%
  \pop@reservefooterzone

  % Use the kernel's actual last-page hook so deferred floats cannot strand
  % the footer on an earlier page. Like cross-references this needs a rerun
  % whenever pagination changes. Footer coordinates themselves are independent
  % of earlier runs. Float-only pages centre their content; the
  % author should inspect any unusually tall final float for logo clearance.
  % Run the overlay before hyperxmp: its metadata hook can leave horizontal
  % glue in this box. Give class code its own label rather than appending it
  % to the document's top-level hook, which always runs last.
  \DeclareHookRule{shipout/lastpage}{philphys/footer}{before}{hyperxmp}%
  \AddToHook{shipout/lastpage}[philphys/footer]{%
    \pop@lastpageoverlay{%

      % LSE Press logo and Open Access icon.
      % These appear even in blind-review mode.
      \node[
        anchor=south west,
        inner sep=0pt
      ] at
        ([xshift=\popLastPageLogoLeft,
          yshift=\popLastPageLogoBottom]
         popFooterPage.south west)
        {%
          \LSEPressLogo[0.071667]%
          \hspace{\popLastPageLogoGap}%
          \raisebox{\popLastPageOARaise}{%
            \popOA{\popLastPageOAHeight}%
          }%
        };

      % Last-page Article Info Column.
      % Hidden in blind-review manuscript mode.
      \pop@ifblindreview{}{%
        \node[
          anchor=south west,
          inner sep=0pt,
          text width=\popLastPageArticleInfoWidth,
          align=left
        ] at
          ([xshift={
              -\dimexpr
              \popBodyRightMargin
              - \popLastPageArticleInfoGap
              \relax},
            yshift=\popLastPageArticleInfoBottom]
           popFooterPage.south east)
          {%
            \popLastPageArticleInfoColumn
          };
      }%

    }%
  }%

  % Do not add a null box or force a page break: the document already has
  % real page material, and the kernel hook targets its actual last shipout.
}

% Public final-page footer command.
% Users should place \poplastpagefooter after the bibliography and any backmatter, right before \end{document}.
% Required in all modes: installs the final-page logos. Their space has normally
% already been reserved by popbackmatter or the bibliography; calling this
% command supplies a fallback for a short document with neither.
% In blind-review mode, the identifying article-info column is suppressed.
% With thanks to Alex for pointing out that trying my previous hack that hooked it in at enddocument was less stable.
\newif\ifpop@endmatterprinted
\pop@endmatterprintedfalse

\newcommand{\poplastpagefooter}{%
  \ifpop@endmatterprinted
    % Do nothing: already printed.
  \else
    \global\pop@endmatterprintedtrue
    \pop@lastpagefooter
  \fi
}

% Backwards-compatible alias for older drafts.
\let\popendmatter\poplastpagefooter

% Warn if the user forgets the explicit final-page footer, when users inevitably accidentally delete it.
\AtEndDocument{%
  \ifpop@endmatterprinted
  \else
    \ClassWarningNoLine{philphys}
      {No \string\poplastpagefooter\space command was used; final-page footer was not printed}%
  \fi
}

% ============================================================
% MAKETITLE
% ============================================================
\renewcommand{\maketitle}{%
  \thispagestyle{poptitlepage}%
  \begin{adjustwidth}{0cm}{\popTextRightIndent}%
    \popTitleBlock
    \vfill
    \popAbstractBlock
    \clearpage
  \end{adjustwidth}%
  % Switch to the Philosophy of Physics body-page margins immediately after the unnumbered title page. Since the title page has already shipped out as page 1, the next page is numbered 2.
  \popBodyGeometry
  \popApplyBodyTextStyle
}

% ============================================================
% HYPERREF AND PDF METADATA SUPPORT
% ============================================================
% Load hyperref late. Only published mode loads hyperxmp: its automatic
% title/author inference otherwise adds metadata to anonymous manuscripts.
\AtEndPreamble{%
  \@ifpackageloaded{hyperref}{}{%
    \RequirePackage[breaklinks]{hyperref}%
  }%
  \ifpopmanuscript\else
    \@ifpackageloaded{hyperxmp}{}{\RequirePackage{hyperxmp}}%
  \fi
  \hypersetup{
    pdftoolbar=false,
    pdfmenubar=true,
    pdffitwindow=false,
    pdfstartview={FitH},
    unicode=true,
    pdfnewwindow=true,
    colorlinks=true,
    linkcolor=black,
    citecolor=black,
    filecolor=black,
    urlcolor=black
  }%
}

% ============================================================
% PDF METADATA
% ============================================================

% Adds descriptive PDF/XMP metadata only in published mode.
% Manuscripts clear title/author/subject/keywords; technical PDF metadata remains.
% Do not load hyperxmp or add identifying metadata yourself for blind review.
\newcommand{\pop@setpdfmetadata}{%
  \ifpopmanuscript
    % Clear descriptive identity fields, including author-supplied preamble
    % hypersetup values. Technical producer/date metadata may remain.
    \hypersetup{pdftitle={},pdfauthor={},pdfsubject={},pdfkeywords={}}%
  \else
    \hypersetup{
      pdftitle={\@title},
      pdfauthor={\@popmetaauthorlist},
      pdfsubject={Philosophy of Physics Research Article},
      pdfkeywords={\@popkeywords},
      pdfcreator={LaTeX with philphys.cls},
      pdfpublisher={LSE Press},
      pdfpublication={Philosophy of Physics},
      pdftrapped={False},
      pdfdoi={\@popdoi},
      pdfidentifier={doi:\@popdoi},
      pdfcopyright={Copyright \@popcopyrightyear\space The Author(s). Published by LSE Press.},
      pdflicenseurl={https://creativecommons.org/licenses/by/4.0/}
    }%
  \fi
}

\AtBeginDocument{%
  \pop@setpdfmetadata
}



% Return @ to its ordinary LaTeX meaning.
\makeatother

% ============================================================
% END OF CLASS
% ============================================================
