Improve PDF readability and appendix layout

This commit is contained in:
saymrwulf 2026-03-29 15:28:32 +02:00
parent 4729082938
commit 65be4dd7aa
4 changed files with 30 additions and 10 deletions

View file

@ -1308,6 +1308,7 @@ def render_latex(args: argparse.Namespace, assessment: HistoricalAssessment) ->
r"\usepackage{fancyhdr}", r"\usepackage{fancyhdr}",
r"\usepackage{titlesec}", r"\usepackage{titlesec}",
r"\usepackage[most]{tcolorbox}", r"\usepackage[most]{tcolorbox}",
r"\usepackage{pdflscape}",
r"\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}", r"\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}",
r"\setmainfont{Palatino}", r"\setmainfont{Palatino}",
r"\setsansfont{Avenir Next}", r"\setsansfont{Avenir Next}",
@ -1319,14 +1320,18 @@ def render_latex(args: argparse.Namespace, assessment: HistoricalAssessment) ->
r"\hypersetup{colorlinks=true,linkcolor=Accent,urlcolor=Accent,pdfauthor={CertTransparencySearch},pdftitle={Historical Certificate Lineage Analysis}}", r"\hypersetup{colorlinks=true,linkcolor=Accent,urlcolor=Accent,pdfauthor={CertTransparencySearch},pdftitle={Historical Certificate Lineage Analysis}}",
r"\setlength{\parindent}{0pt}", r"\setlength{\parindent}{0pt}",
r"\setlength{\parskip}{6pt}", r"\setlength{\parskip}{6pt}",
r"\setlength{\emergencystretch}{4em}",
r"\setlength{\headheight}{16pt}", r"\setlength{\headheight}{16pt}",
r"\setlength{\tabcolsep}{4.2pt}",
r"\renewcommand{\arraystretch}{1.12}",
r"\raggedbottom",
r"\setcounter{tocdepth}{2}", r"\setcounter{tocdepth}{2}",
r"\pagestyle{fancy}", r"\pagestyle{fancy}",
r"\fancyhf{}", r"\fancyhf{}",
r"\renewcommand{\headrulewidth}{0pt}", r"\renewcommand{\headrulewidth}{0pt}",
r"\fancyfoot[C]{\sffamily\footnotesize \thepage}", r"\fancyfoot[C]{\sffamily\footnotesize \thepage}",
r"\titleformat{\section}{\sffamily\bfseries\LARGE\color{Ink}}{\thesection}{0.8em}{}", r"\titleformat{\section}{\sffamily\bfseries\LARGE\color{Ink}\raggedright}{\thesection}{0.8em}{}",
r"\titleformat{\subsection}{\sffamily\bfseries\Large\color{Ink}}{\thesubsection}{0.8em}{}", r"\titleformat{\subsection}{\sffamily\bfseries\Large\color{Ink}\raggedright}{\thesubsection}{0.8em}{}",
r"\tcbset{panel/.style={enhanced,breakable,boxrule=0.55pt,arc=3pt,left=9pt,right=9pt,top=8pt,bottom=8pt,colback=white,colframe=Line}}", r"\tcbset{panel/.style={enhanced,breakable,boxrule=0.55pt,arc=3pt,left=9pt,right=9pt,top=8pt,bottom=8pt,colback=white,colframe=Line}}",
r"\newcommand{\SummaryBox}[1]{\begin{tcolorbox}[panel,colback=Panel]#1\end{tcolorbox}}", r"\newcommand{\SummaryBox}[1]{\begin{tcolorbox}[panel,colback=Panel]#1\end{tcolorbox}}",
r"\begin{document}", r"\begin{document}",

View file

@ -614,14 +614,18 @@ def render_latex(path: Path, report: dict[str, object]) -> None:
r"\hypersetup{colorlinks=true,linkcolor=Accent,urlcolor=Accent,pdfauthor={CertTransparencySearch},pdftitle={Consolidated CT, Certificate, and DNS Report}}", r"\hypersetup{colorlinks=true,linkcolor=Accent,urlcolor=Accent,pdfauthor={CertTransparencySearch},pdftitle={Consolidated CT, Certificate, and DNS Report}}",
r"\setlength{\parindent}{0pt}", r"\setlength{\parindent}{0pt}",
r"\setlength{\parskip}{6pt}", r"\setlength{\parskip}{6pt}",
r"\setlength{\emergencystretch}{4em}",
r"\setlength{\headheight}{16pt}", r"\setlength{\headheight}{16pt}",
r"\setlength{\tabcolsep}{4.2pt}",
r"\renewcommand{\arraystretch}{1.12}",
r"\raggedbottom",
r"\setcounter{tocdepth}{2}", r"\setcounter{tocdepth}{2}",
r"\pagestyle{fancy}", r"\pagestyle{fancy}",
r"\fancyhf{}", r"\fancyhf{}",
r"\renewcommand{\headrulewidth}{0pt}", r"\renewcommand{\headrulewidth}{0pt}",
r"\fancyfoot[C]{\sffamily\footnotesize \thepage}", r"\fancyfoot[C]{\sffamily\footnotesize \thepage}",
r"\titleformat{\section}{\sffamily\bfseries\LARGE\color{Ink}}{\thesection}{0.8em}{}", r"\titleformat{\section}{\sffamily\bfseries\LARGE\color{Ink}\raggedright}{\thesection}{0.8em}{}",
r"\titleformat{\subsection}{\sffamily\bfseries\Large\color{Ink}}{\thesubsection}{0.8em}{}", r"\titleformat{\subsection}{\sffamily\bfseries\Large\color{Ink}\raggedright}{\thesubsection}{0.8em}{}",
r"\tcbset{panel/.style={enhanced,breakable,boxrule=0.55pt,arc=3pt,left=9pt,right=9pt,top=8pt,bottom=8pt,colback=white,colframe=Line}}", r"\tcbset{panel/.style={enhanced,breakable,boxrule=0.55pt,arc=3pt,left=9pt,right=9pt,top=8pt,bottom=8pt,colback=white,colframe=Line}}",
r"\newcommand{\SummaryBox}[1]{\begin{tcolorbox}[panel,colback=Panel]#1\end{tcolorbox}}", r"\newcommand{\SummaryBox}[1]{\begin{tcolorbox}[panel,colback=Panel]#1\end{tcolorbox}}",
r"\begin{document}", r"\begin{document}",

View file

@ -932,6 +932,7 @@ def render_latex(
r"\usepackage{fancyhdr}", r"\usepackage{fancyhdr}",
r"\usepackage{titlesec}", r"\usepackage{titlesec}",
r"\usepackage[most]{tcolorbox}", r"\usepackage[most]{tcolorbox}",
r"\usepackage{pdflscape}",
r"\usepackage{pdfpages}", r"\usepackage{pdfpages}",
r"\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}", r"\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}",
r"\setmainfont{Palatino}", r"\setmainfont{Palatino}",
@ -945,14 +946,18 @@ def render_latex(
r"\hypersetup{colorlinks=true,linkcolor=Accent,urlcolor=Accent,pdfauthor={CertTransparencySearch},pdftitle={CT and DNS Monograph}}", r"\hypersetup{colorlinks=true,linkcolor=Accent,urlcolor=Accent,pdfauthor={CertTransparencySearch},pdftitle={CT and DNS Monograph}}",
r"\setlength{\parindent}{0pt}", r"\setlength{\parindent}{0pt}",
r"\setlength{\parskip}{6pt}", r"\setlength{\parskip}{6pt}",
r"\setlength{\emergencystretch}{4em}",
r"\setlength{\headheight}{16pt}", r"\setlength{\headheight}{16pt}",
r"\setlength{\tabcolsep}{4.2pt}",
r"\renewcommand{\arraystretch}{1.12}",
r"\raggedbottom",
r"\setcounter{tocdepth}{2}", r"\setcounter{tocdepth}{2}",
r"\pagestyle{fancy}", r"\pagestyle{fancy}",
r"\fancyhf{}", r"\fancyhf{}",
r"\renewcommand{\headrulewidth}{0pt}", r"\renewcommand{\headrulewidth}{0pt}",
r"\fancyfoot[C]{\sffamily\footnotesize \thepage}", r"\fancyfoot[C]{\sffamily\footnotesize \thepage}",
r"\titleformat{\section}{\sffamily\bfseries\LARGE\color{Ink}}{\thesection}{0.8em}{}", r"\titleformat{\section}{\sffamily\bfseries\LARGE\color{Ink}\raggedright}{\thesection}{0.8em}{}",
r"\titleformat{\subsection}{\sffamily\bfseries\Large\color{Ink}}{\thesubsection}{0.8em}{}", r"\titleformat{\subsection}{\sffamily\bfseries\Large\color{Ink}\raggedright}{\thesubsection}{0.8em}{}",
r"\tcbset{panel/.style={enhanced,breakable,boxrule=0.55pt,arc=3pt,left=9pt,right=9pt,top=8pt,bottom=8pt,colback=white,colframe=Line}}", r"\tcbset{panel/.style={enhanced,breakable,boxrule=0.55pt,arc=3pt,left=9pt,right=9pt,top=8pt,bottom=8pt,colback=white,colframe=Line}}",
r"\newcommand{\SummaryBox}[1]{\begin{tcolorbox}[panel,colback=Panel]#1\end{tcolorbox}}", r"\newcommand{\SummaryBox}[1]{\begin{tcolorbox}[panel,colback=Panel]#1\end{tcolorbox}}",
r"\begin{document}", r"\begin{document}",
@ -1278,6 +1283,7 @@ def render_latex(
[ [
r"\appendix", r"\appendix",
r"\section{Full Family Catalogue}", r"\section{Full Family Catalogue}",
r"\begin{landscape}",
r"\begin{longtable}{>{\raggedright\arraybackslash}p{0.08\linewidth} >{\raggedright\arraybackslash}p{0.38\linewidth} >{\raggedright\arraybackslash}p{0.15\linewidth} >{\raggedleft\arraybackslash}p{0.08\linewidth} >{\raggedleft\arraybackslash}p{0.08\linewidth} >{\raggedright\arraybackslash}p{0.15\linewidth}}", r"\begin{longtable}{>{\raggedright\arraybackslash}p{0.08\linewidth} >{\raggedright\arraybackslash}p{0.38\linewidth} >{\raggedright\arraybackslash}p{0.15\linewidth} >{\raggedleft\arraybackslash}p{0.08\linewidth} >{\raggedleft\arraybackslash}p{0.08\linewidth} >{\raggedright\arraybackslash}p{0.15\linewidth}}",
r"\toprule", r"\toprule",
r"ID & Basis & Type & Certs & CNs & Top Stacks \\", r"ID & Basis & Type & Certs & CNs & Top Stacks \\",
@ -1288,12 +1294,13 @@ def render_latex(
lines.append( lines.append(
rf"{latex_escape(row['group_id'])} & {latex_escape(row['basis'])} & {latex_escape(row['type'])} & {row['certificates']} & {row['subjects']} & {latex_escape(row['top_stacks'])} \\" rf"{latex_escape(row['group_id'])} & {latex_escape(row['basis'])} & {latex_escape(row['type'])} & {row['certificates']} & {row['subjects']} & {latex_escape(row['top_stacks'])} \\"
) )
lines.extend([r"\bottomrule", r"\end{longtable}"]) lines.extend([r"\bottomrule", r"\end{longtable}", r"\end{landscape}"])
lines.extend( lines.extend(
[ [
r"\section{Historical Red-Flag Detail}", r"\section{Historical Red-Flag Detail}",
r"This appendix keeps the detailed historical evidence inside the monograph so that the reader does not need a second report.", r"This appendix keeps the detailed historical evidence inside the monograph so that the reader does not need a second report.",
r"\begin{landscape}",
r"\subsection{Current Red-Flag Inventory}", r"\subsection{Current Red-Flag Inventory}",
] ]
) )
@ -1500,6 +1507,7 @@ def render_latex(
lines.extend( lines.extend(
[ [
r"\end{landscape}",
r"\section{Detailed Inventory Appendix}", r"\section{Detailed Inventory Appendix}",
r"This appendix reproduces the full issuer-first family inventory so that the publication remains complete rather than merely interpretive.", r"This appendix reproduces the full issuer-first family inventory so that the publication remains complete rather than merely interpretive.",
rf"\includepdf[pages=-,pagecommand={{}}]{{{latex_escape(appendix_pdf_path)}}}", rf"\includepdf[pages=-,pagecommand={{}}]{{{latex_escape(appendix_pdf_path)}}}",

View file

@ -1056,14 +1056,17 @@ def render_latex_report(
r"\setlength{\parskip}{6pt}", r"\setlength{\parskip}{6pt}",
r"\setlength{\emergencystretch}{3em}", r"\setlength{\emergencystretch}{3em}",
r"\setlength{\headheight}{16pt}", r"\setlength{\headheight}{16pt}",
r"\setlength{\tabcolsep}{4.2pt}",
r"\renewcommand{\arraystretch}{1.12}",
r"\raggedbottom",
r"\setcounter{tocdepth}{2}", r"\setcounter{tocdepth}{2}",
r"\pagestyle{fancy}", r"\pagestyle{fancy}",
r"\fancyhf{}", r"\fancyhf{}",
r"\renewcommand{\headrulewidth}{0pt}", r"\renewcommand{\headrulewidth}{0pt}",
r"\fancyfoot[C]{\sffamily\footnotesize \thepage}", r"\fancyfoot[C]{\sffamily\footnotesize \thepage}",
r"\titleformat{\section}{\sffamily\bfseries\LARGE\color{Ink}}{\thesection}{0.8em}{}", r"\titleformat{\section}{\sffamily\bfseries\LARGE\color{Ink}\raggedright}{\thesection}{0.8em}{}",
r"\titleformat{\subsection}{\sffamily\bfseries\Large\color{Ink}}{\thesubsection}{0.8em}{}", r"\titleformat{\subsection}{\sffamily\bfseries\Large\color{Ink}\raggedright}{\thesubsection}{0.8em}{}",
r"\titleformat{\subsubsection}{\sffamily\bfseries\normalsize\color{Ink}}{\thesubsubsection}{0.8em}{}", r"\titleformat{\subsubsection}{\sffamily\bfseries\normalsize\color{Ink}\raggedright}{\thesubsubsection}{0.8em}{}",
r"\tcbset{", r"\tcbset{",
r" panel/.style={enhanced,breakable,boxrule=0.55pt,arc=3pt,left=9pt,right=9pt,top=8pt,bottom=8pt,colback=white,colframe=Line},", r" panel/.style={enhanced,breakable,boxrule=0.55pt,arc=3pt,left=9pt,right=9pt,top=8pt,bottom=8pt,colback=white,colframe=Line},",
r" hero/.style={panel,colback=Ink,colframe=Ink,left=14pt,right=14pt,top=14pt,bottom=14pt},", r" hero/.style={panel,colback=Ink,colframe=Ink,left=14pt,right=14pt,top=14pt,bottom=14pt},",