我使用 pandoc 和一些自定义 LaTeX 模板来生成 PDF 表格。因此,我无法轻易影响 Pandoc 生成表格代码的方式,但我可以更改 Latex 文档中的配置。
当我使用 Pandoc 创建包含长链接的表格时,列数数溢出了。我该如何防止这种情况发生?
Pandoc 的 Markdown
#### Adblock Findings
The Adblock findings summarise requests that would have been detected and blocked by the Adblock list [easyprivacy.txt](https://easylist.to/easylist/easyprivacy.txt) from <https://easylist.to/>.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
sample count
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -----------------------------------
<http://www.google-analytics.com/analytics.js> 1
<http://www.google-analytics.com/r/collect?v=1&_v=j68&a=1570329088&t=pageview&_s=1&dl=http%3A%2F%2Fwww.eba.europa.eu%2F&ul=en-us&de=UTF-8&dt=Home%20-%20European%20Banking%20Authority&sd=24-bit&sr=1366x768&vp=1356x694&je=0&_u=IEBAAEAB~&jid=799733851&gjid=1328499242&cid=1310586057.1530548844&tid=UA-41571870-1&_gid=670816676.1530548844&_r=1&z=1576148449> 2
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
LaTeX(简体)
\documentclass[12pt,DIV=14,a4paper,parskip=true,titlepage=true]{scrartcl}
% \usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[scaled=0.90]{helvet}
\usepackage[lining]{ebgaramond}
\else % if luatex or xelatex
\ifxetex
\usepackage{mathspec}
\else
\usepackage{fontspec}
\fi
\setsansfont{TeX Gyre Heros}
\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase,Mapping=tex-text}
\setromanfont[Numbers=Lining]{EB Garamond}
\fi
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
% use microtype if available
\IfFileExists{microtype.sty}{%
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref
\usepackage[usenames,dvipsnames]{xcolor} % color is loaded by hyperref
\usepackage[unicode=true,draft]{hyperref}
\hypersetup{%
pdftitle={},
pdfsubject={},
colorlinks=true,
linkcolor=darkblue,
citecolor=Red,
urlcolor=darkblue,
breaklinks=true,
pdfpagemode=UseNone,
pageanchor=true,
pdfpagemode=UseOutlines,
}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[shorthands=off,main=british]{babel}
\else
\usepackage{polyglossia}
\setmainlanguage[variant=uk]{english}
\fi
\usepackage{longtable}
\usepackage{booktabs}
\usepackage[style=british]{csquotes}
\begin{document}
\hypertarget{adblock-findings}{%
\paragraph{Adblock Findings}\label{adblock-findings}}
The Adblock findings summarise requests that would have been detected and blocked by the Adblock list \href{https://easylist.to/easylist/easyprivacy.txt}{easyprivacy.txt} from \url{https://easylist.to/}.
\mbox{}
\begin{longtable}[]{@{}ll@{}}
\toprule
\begin{minipage}[b]{0.90\columnwidth}\raggedright
sample\strut
\end{minipage} & \begin{minipage}[b]{0.04\columnwidth}\raggedright
count\strut
\end{minipage}\tabularnewline
\midrule
\endhead
\begin{minipage}[t]{0.90\columnwidth}\raggedright
\url{http://www.google-analytics.com/analytics.js}\strut
\end{minipage} & \begin{minipage}[t]{0.04\columnwidth}\raggedright
1\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.90\columnwidth}\raggedright
\url{http://www.google-analytics.com/r/collect?v=1\&_v=j68\&a=1570329088\&t=pageview\&_s=1\&dl=http\%3A\%2F\%2Fwww.eba.europa.eu\%2F\&ul=en-us\&de=UTF-8\&dt=Home\%20-\%20European\%20Banking\%20Authority\&sd=24-bit\&sr=1366x768\&vp=1356x694\&je=0\&_u=IEBAAEAB~\&jid=799733851\&gjid=1328499242\&cid=1310586057.1530548844\&tid=UA-41571870-1\&_gid=670816676.1530548844\&_r=1\&z=1576148449}\strut
\end{minipage} & \begin{minipage}[t]{0.04\columnwidth}\raggedright
2\strut
\end{minipage}\tabularnewline
\bottomrule
\end{longtable}
\end{document}