我有一张代表日历的大表(由 制作yplan
),我正尝试在没有任何规则的情况下排版左上角的单元格。我几乎解决了规则,但单元格的右下角却留下了一个小点。我按照hhrule
手册的建议使用colortbl
它来填充单元格。(下面的最小示例中未显示颜色)。
这是我的问题的一个最小例子:
\documentclass{article}
\usepackage{hhline}
\begin{document}
\begin{tabular}{|c||p{2.5cm}|}
\hhline{~|-}
\multicolumn{1}{c|}{} & \multicolumn{1}{c|}{\textbf{JANUARY}} \\[0.75ex]
\hhline{-::=}
\textbf{Su} & \\[0.75ex]
\end{tabular}
\end{document}
我尝试了无数种规则选项组合,但就是无法找到正确的答案。有人能帮忙吗?
答案1
这增加了一个;
类似:
但不同的。
\documentclass{article}
\usepackage{hhline,colortbl}
\makeatletter
\AtBeginDocument{%
\def\HH@loop{%
\ifx\@tempb`\def\next##1{\the\toks@\cr}\else\let\next\HH@let
\ifx\@tempb|\if@tempswa
\ifx\CT@drsc@\relax
\HH@add{\hskip\doublerulesep}%
\else
\HH@add{{\CT@drsc@\vrule\@width\doublerulesep}}%
\fi
\fi\@tempswatrue
\HH@add{{\CT@arc@\vline}}\else
\ifx\@tempb:\if@tempswa
\ifx\CT@drsc@\relax
\HH@add{\hskip\doublerulesep}%
\else
\HH@add{{\CT@drsc@\vrule\@width\doublerulesep}}%
\fi
\fi\@tempswatrue
\HH@add{\@tempc\HH@box\arrayrulewidth\arrayrulewidth\@tempc}\else
\ifx\@tempb;\if@tempswa
\ifx\CT@drsc@\relax
\HH@add{\hskip\doublerulesep}%
\else
\HH@add{{\CT@drsc@\vrule\@width\doublerulesep}}%
\fi
\fi\@tempswatrue
\HH@add{\@tempc\HH@box\z@\arrayrulewidth\@tempc}\else
\ifx\@tempb##\if@tempswa\HH@add{\hskip\doublerulesep}\fi\@tempswatrue
\HH@add{{\CT@arc@\vline\copy\@ne\@tempc\vline}}\else
\ifx\@tempb~\@tempswafalse
\if@firstamp\@firstampfalse\else\HH@add{&\omit}\fi
\ifx\CT@drsc@\relax
\HH@add{\hfil}\else
\HH@add{{%
\CT@drsc@\leaders\hrule\@height\HH@height\hfil}}%
\fi
\else
\ifx\@tempb-\@tempswafalse
\gdef\HH@height{\arrayrulewidth}%
\if@firstamp\@firstampfalse\else\HH@add{&\omit}\fi
\HH@add{{%
\CT@arc@\leaders\hrule\@height\arrayrulewidth\hfil}}%
\else
\ifx\@tempb=\@tempswafalse
\gdef\HH@height{\dimen\thr@@}%
\if@firstamp\@firstampfalse\else\HH@add{&\omit}\fi
\HH@add
{\rlap{\copy\@ne}\leaders\copy\@ne\hfil\llap{\copy\@ne}}\else
\ifx\@tempb t\HH@add{%
\def\HH@height{\dimen\thr@@}%
\HH@box\doublerulesep\z@}\@tempswafalse\else
\ifx\@tempb b\HH@add{%
\def\HH@height{\dimen\thr@@}%
\HH@box\z@\doublerulesep}\@tempswafalse\else
\ifx\@tempb>\def\next##1##2{%
\HH@add{%
{\baselineskip\p@\relax
##2%
\global\setbox\@ne\HH@box\doublerulesep\doublerulesep}}%
\HH@let!}\else
\PackageWarning{hhline}%
{\meaning\@tempb\space ignored in \noexpand\hhline argument%
\MessageBreak}%
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
\next}
}
\makeatother
\begin{document}
\begin{tabular}{|c||p{2.5cm}|}
\hhline{~|-}
\multicolumn{1}{c|}{} & \multicolumn{1}{c|}{\textbf{JANUARY}} \\[0.75ex]
\hhline{-;:=}
\textbf{Su} & \\[0.75ex]
\end{tabular}
\end{document}
答案2
问题来自\hhline
混合了简单和双重规则的 。解决方案是制作两个简单的\hhmine
s ,中间有一个垂直空间:
\documentclass{article}
\usepackage{hhline}
\begin{document}
\begin{tabular}{|c||p{2.5cm}|}
\hhline{~|-}
\multicolumn{1}{c|}{}& {\textbf{JANUARY}} \\[0.75ex]
\hhline{~|-}\noalign{\vspace*{\doublerulesep}}
\hhline{-||-}
\textbf{Su} & \\[0.75ex]
\end{tabular}
\end{document}