9

I have a large table which represents a calendar (produced by yplan) and I'm trying to typeset the cell in the top left corner without any rules at all. I've all but solved the rules, but I'm left with a small dot in the bottom right corner of the cell. I'm using hhrule for my horizontal rules as it is suggested by the colortbl manual which I am using to fill cells. (Colour not represented in minimal example below).

This is a minimal example of what my problem is:

\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}

Which produces output that looks like (note the small dot): minimal example image

I've tried countless combinations of rule options and just can't get it right. Can anyone help?

3
  • This is definitely the wrong tool for the purpose as you are not able to achieve such a layout with \hhline for its restricted commands. Would you accept a solution without hhline?
    – TeXnician
    Commented Jan 2, 2018 at 18:29
  • @TeXnician I would, but it would need to be compatible with clrtable and also permit missing hlines (not shown, but present elsewhere in the table). The default output of yplan uses clines, which I replaced with these hhlines.
    – Richard
    Commented Jan 2, 2018 at 18:35
  • @TeXnician hmpf Commented Jan 2, 2018 at 18:51

2 Answers 2

11

enter image description here

this adds a ; which is like : but different.

\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}
3
  • Wow! Do you intend to incorporate it to the package?
    – Bernard
    Commented Jan 2, 2018 at 18:53
  • And what about the counterpart on the bottom? How can one improve \cline{1-1}\hhline{~;:=}? Commented Jan 2, 2018 at 19:00
  • Just a semantic observation: why not use ! and ¡?
    – Bernard
    Commented Jan 2, 2018 at 19:09
6

The probelm comes from a\hhline which mixes simple and doublerule. A solution consists in making two simple \hhmines with a vertical space in-between:

\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} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .