以下是从一份精美、丰富多彩的执行摘要中剪辑出来的一段摘录。
文字处理器似乎非常擅长处理这类事情。通常有很多预设,您可以使用 GUI 浏览,选择一个主题,然后修改它,直到您满意为止。而 LaTeX 看起来有点普通:
别误会我的意思,它看起来不错。它非常合理。也许太合理了。相比之下,它只是无聊而已。这对于执行摘要来说并不理想。我该怎么做才能让我的 LateX 版本看起来更像第一个版本?看起来不完全一样也没关系,因为另一方面,避免这种情况总是好的“哎呀。微软 Word”美学,如果你明白我的意思。也许我们可以实现健康的平衡。我还在研究饼图、色彩鲜艳的图表和其他轻微的(有争议的)排版失误。无论如何,Lacklustre MWE 如下:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage{booktabs,array,arydshln}
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\huge\centering\noindent
10.0.0.8 \\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\large\phantom{|} \\\centering\noindent
\begin{tabular}{ccccc}
\toprule %%
11 & 83 & 110 & 8 & 0 \\
\midrule %%
CRITICAL & HIGH & MEDIUM & LOW & INFO \\
\bottomrule %%
\end{tabular}
\\ \phantom{|} \\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\small\centering\noindent
\begin{tabular}{llll}
\toprule %%
SEVERITY & CVSS & PLUGIN & NAME \\
\midrule %%
CRITICAL & 10.0 & 82138 & Debian DLA-155-1 : linux 2.6 security update \\\hdashline
CRITICAL & 10.0 & 82139 & Debian DLA-156-1 : samba security update \\\hdashline
CRITICAL & 10.0 & 82718 & Debian DLA-195-1 : libtasn1-3 security update \\\hdashline
CRITICAL & 10.0 & 84061 & Debian DLA-239-1 : cups security update \\\hdashline
CRITICAL & 10.0 & 85808 & Debian DLA-307-1 : php5 security update \\
\bottomrule %%
\end{tabular}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
答案1
只需阅读有关该包的使用说明即可xcolor
。它提供了您需要的工具。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage{booktabs,array,arydshln,xcolor}
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}
\newcommand\colbox[2]{\colorbox{#1}{\makebox[60pt]{\rule[-10pt]{0pt}{30pt}%
\textcolor{white}{\large\sffamily\bfseries#2}}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\huge\centering\sffamily
10.0.0.8 \\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\large\phantom{|} \\\centering\noindent
\begingroup\tabcolsep=0pt
\scriptsize
\begin{tabular}{ccccc}
\toprule %%
\colbox{red}{11} & \colbox{orange}{83} & \colbox{yellow!95!black}{110}
& \colbox{green}{8} & \colbox{blue!50}{0} \\
\midrule %%
CRITICAL & HIGH & MEDIUM & LOW & INFO \\
\bottomrule %%
\end{tabular}
\endgroup
\\ \phantom{|} \\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begingroup
\renewcommand\arraystretch{1.5}
\small\centering\noindent
\begin{tabular}{llll}
\toprule %%
SEVERITY & CVSS & PLUGIN & NAME \\
\midrule %%
\colorbox{red}{CRITICAL} & 10.0 & \textcolor{blue}{82138}
& Debian DLA-155-1 : linux 2.6 security update \\\hdashline
\colorbox{red}{CRITICAL} & 10.0 & \textcolor{blue}{82139}
& Debian DLA-156-1 : samba security update \\\hdashline
\colorbox{red}{CRITICAL} & 10.0 & \textcolor{blue}{82718}
& Debian DLA-195-1 : libtasn1-3 security update \\\hdashline
\colorbox{red}{CRITICAL} & 10.0 & \textcolor{blue}{84061}
& Debian DLA-239-1 : cups security update \\\hdashline
\colorbox{red}{CRITICAL} & 10.0 & \textcolor{blue}{85808}
& Debian DLA-307-1 : php5 security update \\
\bottomrule %%
\end{tabular}
\endgroup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%