From 351286c89a45aad05cf0d6b4e86c34d47eeedd05 Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Mon, 29 Jan 2024 11:45:23 +0800 Subject: [PATCH] pdf: implement automatic underscore wrapping table cells (#16389) (#16396) (#16404) --- templates/template.tex | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/templates/template.tex b/templates/template.tex index 508bb9224007..9f52e589cc3c 100644 --- a/templates/template.tex +++ b/templates/template.tex @@ -8,6 +8,8 @@ \usepackage{setspace} \setstretch{$linestretch$} $endif$ +\usepackage{etoolbox} +\usepackage{xstring} \usepackage{amssymb,amsmath} \usepackage{ifxetex,ifluatex} \usepackage{fixltx2e} % provides \textsubscript @@ -68,6 +70,7 @@ \usepackage{xcolor} \usepackage{listings} \lstset{ + literate={_}{\_}1, basicstyle=\ttfamily, keywordstyle=\color[rgb]{0.13,0.29,0.53}\bfseries, stringstyle=\color[rgb]{0.31,0.60,0.02}, @@ -92,6 +95,14 @@ $endif$ $if(tables)$ \usepackage{longtable,booktabs} +% set table to left-aligned +\setlength\LTleft{0pt} +\setlength\LTright{0pt} +% fill the columns to page width +\makeatletter +\patchcmd\LT@array{\tabskip\z@}{\extracolsep{\fill}} +\makeatletter + $endif$ $if(graphics)$ \usepackage{graphicx,grffile} @@ -113,8 +124,8 @@ \fi \hypersetup{breaklinks=true, bookmarks=true, - pdfauthor={$author-meta$}, - pdftitle={$title-meta$}, + pdfauthor={$author$}, + pdftitle={$title$}, colorlinks=true, citecolor=$if(citecolor)$$citecolor$$else$blue$endif$, urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$,