1

I have a table like this at the moment:

enter image description here

Made up of the following LaTeX:

\begin{table} [htbp]
        \centering
        \begin{tabular}{p{2.50cm}|p{0.25cm}|p{0.25cm}|p{0.25cm}|p{0.25cm}}
            % \multirow{1}{*} {\textbf{Authors}} & & & & & & & & \textbf{Context and use of RSS} \\        &
            & \rotatebox{90}{Student 3} &
            \rotatebox{90}{Student 4} &
            \rotatebox{90}{Student 6} &
            \rotatebox{90}{Student 9} \\
            \thickhline
            Student 3 & & & & \\
            \hline
            Student 4 & \checkmark & & \\
            \hline
            Student 6 & \checkmark & \checkmark & \\
            \hline
            Student 9 & \checkmark & \checkmark & \checkmark & \\
            \thickhline
        \end{tabular}
        \caption{Averaging of correlations for RSS feed 140.}
        \label{tab:CorrelationAveraging}
    \end{table}

But would like to have the first vertical line as thick as either the first horizontal line or last horizontal line.

Can anyone advise how this can be done with the packages specified in the MWE below?

Instruction \thickhline is:

\newcommand{\thickhline}{%
    \noalign {\ifnum 0=`}\fi \hrule height 1.5pt
    \futurelet \reserved@a \@xhline
}

A full MWE is listed below:

\documentclass[a4paper,11pt]{article}

\usepackage{alltt}
\usepackage{anysize}
\usepackage{array}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{changepage}
\usepackage{color}
\usepackage{enumerate}
\usepackage{etoolbox}
\usepackage{fancyhdr}
\usepackage{fixltx2e}
\usepackage[hang,flushmargin]{footmisc}
% \usepackage{graphics}
\usepackage{longtable}
\usepackage{ragged2e}
\usepackage[numbers,sort]{natbib}
%\usepackage{url}
\usepackage[normalem]{ulem}
\usepackage{subcaption}
\usepackage{float}
\usepackage{makecell}
\usepackage{rotating}
\usepackage{multirow}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}

\marginsize{2.54cm}{2.54cm}{2.54cm}{2.54cm}

% Tables.
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{R}[1]{>{\RaggedLeft\arraybackslash}p{#1}}
\setlength\heavyrulewidth{0.25ex}
\setlength\lightrulewidth{0.25ex}

\renewcommand\theadfont{\bfseries}
\settowidth\rotheadsize{\theadfont pair}

\makeatletter
\newcommand{\thickhline}{%
   \noalign {\ifnum 0=`}\fi \hrule height 1.50pt
   \futurelet \reserved@a \@xhline
}
\newcolumntype{"}{@{\hskip\tabcolsep\vrule width 1pt\hskip\tabcolsep}}
\makeatother

\begin{document}

\title{Title}

\author{Author}

\maketitle

    \begin{table} [htbp]
    \centering
    \begin{tabular}{p{1.65cm}|p{0.25cm}|p{0.25cm}|p{0.25cm}|p{0.25cm}}
        % \multirow{1}{*} {\textbf{Authors}} & & & & & & & & \textbf{Context and use of RSS} \\        &
        & \rotatebox{90}{Student 3} &
        \rotatebox{90}{Student 4} &
        \rotatebox{90}{Student 6} &
        \rotatebox{90}{Student 9} \\
        \thickhline
        Student 3 & & & & \\
        \hline
        Student 4 & \checkmark & & \\
        \hline
        Student 6 & \checkmark & \checkmark & \\
        \hline
        Student 9 & \checkmark & \checkmark & \checkmark & \\
        \thickhline
    \end{tabular}
    \caption{Example of averaging of correlations for a sentiment for RSS feed 140.}
    \label{tab:CorrelationAveraging}
    \end{table}

\end{document}
  • You should create a minimal working example (MWE) that starts at \documentclass and ends at \end{document} including all the necessary packages to recreate your problem but not more. – Skillmon Apr 10 '18 at 16:27
  • MWE has been added. – Mr Morgan Apr 10 '18 at 16:45
  • Note that your example is far from minimal. You include many unrelated packages and add much unrelated code (\maketitle, \marginsize...). – Skillmon Apr 10 '18 at 16:59
2

Don't reinvent the wheel: it all exists with the \hlineB, clineB commands and the V column separator, defined in the boldline package, from the shipunov bundle. They all accept a number as an argument, which is a factor in front of \arrayrulewidth. Rules with 1.5pt thickness are approximately 4\arrayrulewidth:

\documentclass{article}
\usepackage[utf8]{inputenc} 
\usepackage{amssymb}
\usepackage{array, boldline, rotating}

\newcommand{\thickhline}{\hlineB{4}}

\begin{document}

\begin{table} [htbp]
    \centering
    \begin{tabular}{p{2.50cm}V{4}*{4}{p{0.25cm}|}}
        % \multirow{1}{*} {\textbf{Authors}} & & & & & & & & \textbf{Context and use of RSS} \\ &
        & \rotatebox{90}{Student 3} &
        \rotatebox{90}{Student 4} &
        \rotatebox{90}{Student 6} &
        \rotatebox{90}{Student 9} \\
        \thickhline
        Student 3 & & & & \\
        \hline
        Student 4 & \checkmark & & & \\
        \hline
        Student 6 & \checkmark & \checkmark & & \\
        \hline
        Student 9 & \checkmark & \checkmark & \checkmark & \\
        \thickhline
    \end{tabular}
    \caption{Averaging of correlations for RSS feed 140.}
    \label{tab:CorrelationAveraging}
\end{table}

\end{document} 

enter image description here

4

Since you have not provided the MWE, I have given you the freedom to do it with a different package (tabu) and this is the result:

enter image description here

Is it what you are looking for?

Here is the MWE code:

\documentclass{article}
\usepackage{tabu} % Nice tables package.
\usepackage{graphicx} % to rotate text
\usepackage{stix} %for checkmark
\usepackage[usenames,dvipsnames]{xcolor} % Allows the definition of hex colors
\usepackage{colortbl} % %just in case
\definecolor{tabu}{HTML}{002fa7} % define and name "tabu" Klein blue HTML
\begin{document}
\begin{table} [htbp]
    \tabulinesep = 2mm
    \taburulecolor{tabu}
    \tabulinestyle{3pt tabu!70}
    \centering
    \begin{tabu} to 4.5cm {X[9]|X|[.5pt]X|[.5pt]X|[.5pt]X|}  

        \multicolumn{1}{c|}{}& \rotatebox{90}{Student 3} &
        \rotatebox{90}{Student 4} &
        \rotatebox{90}{Student 6} &
        \rotatebox{90}{Student 9} \\ \tabucline-
        Student 3 & & & & \\ \tabucline[.5pt] -
        Student 4 & \checkmark & & & \\ \tabucline[.5pt] -
        Student 6 & \checkmark & \checkmark & &\\ \tabucline[.5pt] -
        Student 9 & \checkmark & \checkmark & \checkmark & \\ \tabucline-
    \end{tabu}
    \caption{Averaging of correlations for RSS feed 140.}
    \label{tab:CorrelationAveraging}
\end{table}

\end{document}

You dont need to make an aditional macros.

  • The MWE has been added to the end of original question. Can the vertical line be made thick using the packages apecified in the MWE? – Mr Morgan Apr 10 '18 at 16:49
  • Ok, I post this before that update, but nothing is missing that prevents it from compiling, it is not an MWE because it does not copy and paste and you give it to run; but if you add the necessary packages I do not think that it presents problems, except compatibilities with other packages that you have ... – J Leon V. Apr 10 '18 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.