2

I have a word document containing tables. The columns have different column width. Attached here. enter image description here

I want to translate the word table into LaTex. The new table in LaTeX looks quite bad. The alignment of text are bad. In addition, I am getting warning from Overleaf as 'Overfull' \hbox. I'm not sure why am I getting warning regarding the width of the table. The new table is here. enter image description here

\documentclass[a4paper,landscape]{article}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[nottoc]{tocbibind}
\usepackage[margin=24mm,
        bottom= 5mm,%
        footskip=4\baselineskip,
        includefoot,
        % showframe
        ]{geometry}
\usepackage{tikz}
\usetikzlibrary{backgrounds, positioning, scopes}
\tikzset{FOOT/.style = {
every node/.append style = {font=\sffamily\bfseries,
                        text=white,
                        align=center,
                        minimum height=15mm,
                        outer sep=0pt,
                        },
           sx/.style = {xshift=##1mm}
                    }
    }
\usepackage{color,soul}
\usepackage[usestackEOL]{stackengine}
\usepackage{caption}
\usepackage{placeins}
\usepackage{subcaption}
\usepackage{tcolorbox}
\usepackage{amssymb}
\usepackage{enumitem}
\usepackage{csquotes}
\usepackage[normalem]{ulem}
\usepackage{multirow}
% To add URL of website
\usepackage{url}
% Set line spacing using the following package
\usepackage{setspace}
\usepackage{lastpage}
%% Useful packages
\usepackage{amsmath}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{2pt}

\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}
\definecolor{darkgoldenrod}{rgb}{0.72, 0.53, 0.04}
\usepackage{cleveref}

\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\usepackage[normalem]{ulem}
\useunder{\uline}{\ul}{}
% \fancyhead{} % clear all header fields
\fancyhead[RO]{Development Action Plan}
\fancyfoot{} % clear all footer fields

%%========================= Footer template ============================
\fancyfoot[O]{% odd pages
\begin{tikzpicture}[FOOT,
remember picture, overlay,
node distance=0pt]
\node (O1) [minimum width=25mm,
        above right=of current page.south west]
        {};
\node (O2) [minimum width=0.5\textwidth, align=left,
        right=of O1]
        { Continuing Professional Development\\
            \footnotesize
          January 2019};
\node (O3) [minimum width=0.5\textwidth,
        align=center,
        right=of O2]
        { LarCoS\\
            \footnotesize
        Membership no. 123456\qquad};
\node (O4) [minimum width=25mm, font=\sffamily\bfseries,
        right=of O3]
        {\thepage~of~\pageref*{LastPage}};
\begin{scope}[on background layer]
\fill[teal] (O1.south west) |- ([sx= 3] O3.north east)
                        -- ([sx=-3] O3.south east)
                         -- cycle;
\fill[black] ([sx=-3] O2.south east) -- ([sx= 3] O2.north east) -|
        (O4.south east) -- cycle;
\path[white, line width=1mm, shorten >=-0.5mm, shorten < =-0.5mm]
        ([sx=-3] O2.south east) edge ([sx=3] O2.north east)
        ([sx=-3] O4.south west) edge ([sx=3] O4.north west);
\end{scope}
\end{tikzpicture}
            } %odd page
%%%%==========================================
%%========================= Footer template ============================
\begin{document}

\begin{table}[tbh]
\begin{tabular}{|C{0.75cm}|C{0.7cm}|L{3cm}|L{3.25cm}|L{3cm}|L{2.7cm}|L{3cm}|L{2.45cm}|L{2.1cm}|}
\hline
\multicolumn{9}{|l|}{\textbf{Job role and responsibilities:}}       \\ \hline
\multicolumn{5}{|c|}{\textbf{Review of learning needs}} & \multicolumn{4}{c|}{\textbf{Development plan}}\\ \hline
\textbf{Date} & \textbf{Ref} & \textbf{\begin{tabular}[c]{@{}l@{}}In what area do \\  I need to improve \\ my  performance?\end{tabular}} & \textbf{\begin{tabular}[c]{@{}l@{}}How does this link\\ to other objectives\\  (eg employer, ICE,\\  etc)?\end{tabular}} & \textbf{\begin{tabular}[c]{@{}l@{}}What do I need\\  to learn in\\  order to \\ achieve this?\end{tabular}} & \textbf{\begin{tabular}[c]{@{}l@{}}What will I do\\  to achieve this?\end{tabular}} & \textbf{\begin{tabular}[c]{@{}l@{}}What are the \\ likely resources \\ and support \\ that I will need?\end{tabular}} & \textbf{\begin{tabular}[c]{@{}l@{}}How will I\\ evaluate a\\ successful \\ outcome?\end{tabular}} & \textbf{\begin{tabular}[c]{@{}l@{}}What are\\ my \\ deadlines \\for meeting \\this target?\end{tabular}} \\ \hline

Jul 2006 &   RB-DAP-01   &~Understanding structural steel detail drawings and preparing design drawing using AutoCAD~&~Knowledge of load transfer thorough proper detailing and to be represented in drawings  &  Several structural components and their behaviour under loading; for AutoCAD, needed to learn the commands  &  Rigorous study of design drawings and draw the details using AutoCAD  &  Drawings from previous projects and the software AutoCAD and its manuals & I shall be able to prepare structural detailing using AutoCAD & Sep 2006 \\ \hline



              &              &                                                                                                           &                                                                                                                          &                                                                                                             &                                                                                     &                                                                                                                       &                                                                                                      &                                                                                                          \\ \hline



              &              &                                                                                                           &                                                                                                                          &                                                                                                             &                                                                                     &                                                                                                                       &                                                                                                      &                                                                                                          \\ \hline



              &              &                                                                                                           &                                                                                                                          &                                                                                                             &                                                                                     &                                                                                                                       &                                                                                                      &                                                                                                          \\ \hline
\end{tabular}
\end{table}

\end{document}
  • Your table cannot be compiled as is. What are the C` and L column specifiers? – Bernard Dec 9 '18 at 23:15
  • Sorry for the inconveniences. Uploaded the correct one. – LarCos Dec 9 '18 at 23:39
  • in your columns definitions replace m{...} with p{...}. – Zarko Dec 9 '18 at 23:48
3

like this?

enter image description here

(red lines indicate text area)

i reduce your mwe to the part concerning only table. for it i add three packages: ragged2e (for nicer hyphenation of text in table's cells) makecell (for more vertical space around cells' contents) and tabularx (for multi line cells with equal width):

\documentclass[a4paper,landscape]{article}
\usepackage[T1]{fontenc}
\usepackage[margin=24mm,
        bottom= 5mm,%
        footskip=4\baselineskip,
        includefoot,
        % showframe
        ]{geometry}
\usepackage{caption}
\usepackage{ragged2e} % <---

\usepackage{array, makecell, multirow, tabularx}  % <---

\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{}
\newcolumntype{L}{>{\RaggedRight\hspace{0pt}}X}
\newcolumntype{C}{>{\Centering  \arraybackslash}X}

\begin{document}

    \begin{table}[htb]
    \setcellgapes{5pt}
    \makegapedcells
    \setlength\tabcolsep{4pt}
\begin{tabularx}{\linewidth}{|c|c|*{7}{L|}}
\hline
\multicolumn{9}{|l|}{\textbf{Job role and responsibilities:}}   \\
    \hline
\multicolumn{5}{|c|}{\textbf{Review of learning needs}}
    & \multicolumn{4}{c|}{\textbf{Development plan}}            \\
    \hline
\textbf{Date}
    & \textbf{Ref} & \textbf{In what area do  I need to improve my  performance?}
        & \textbf{How does this link to other objectives  (eg employer, ICE,  etc)?}
            & \textbf{What do I need to learn in order to achieve this?}
                & \textbf{What will I do to achieve this?}
                    & \textbf{What are the likely resources and support that I will need?}
                        & \textbf{How will I evaluate a successful  outcome?}
                            & \textbf{What are my deadlines for meeting this target?}   \\
    \hline
Jul 2006 & \makecell[tl]{RB-\\DAP-\\01}
    & Understanding structural steel detail drawings and preparing design drawing using AutoCAD
        & Knowledge of load transfer thorough proper detailing and to be represented in drawings
            &  Several structural components and their behaviour under loading; for AutoCAD, needed to learn the commands
                &  Rigorous study of design drawings and draw the details using AutoCAD
                    &  Drawings from previous projects and the software AutoCAD and its manuals
                        & I shall be able to prepare structural detailing using AutoCAD
                            & Sep 2006                      \\
    \hline
    &   &   &   &   &   &   &   &                           \\                                                                                                 &   &   &   &   &   &   &   &                           \\
    &   &   &   &   &   &   &   &                           \\
    \hline
\end{tabularx}
    \end{table}

remarks:

  • for better fitting texts in cells you should consider to use smaller font size. for example \small or even footnotesize
  • for column head try to use shorter name. for example, for the lat solumn instead of Deadline for meeting this target? rather us simply Deadlines (in for column type of this column use c or l)

addendum: from your comment below can be understand, that your table will spam many (at least two) pages. in this case you need:

  • remove float environment table for using tabularx you should replace it (or just add) the package ltablex, which combine properties of the longtable and tabularx packages
  • for preserving standard tabularx features (which is slightly changed with the ltablex package
  • define the first and other table headers (if you like to repeat them on the each page), table foots and the last table foot (see mwe below)

    \documentclass[a4paper,landscape]{article}
    \usepackage[T1]{fontenc}
    \usepackage[margin=24mm,
                bottom= 5mm,%
                footskip=4\baselineskip,
                includefoot,
                % showframe
                ]{geometry}
    \usepackage{caption}
    \usepackage{ragged2e}
    
    \usepackage{array, ltablex, makecell, multirow}
    \keepXColumns
    \renewcommand\theadfont{\bfseries}
    \renewcommand\theadgape{}
    \newcolumntype{L}{>{\RaggedRight}X}
    \newcolumntype{C}{>{\Centering  \arraybackslash}X}
    
    \begin{document}
    
        \begingroup
        \setcellgapes{5pt}
        \makegapedcells
        \setlength\tabcolsep{4pt}
        \small
    \begin{tabularx}{\linewidth}{|c|c|*{6}{L|}>{\raggedright\arraybackslash}p{6em}|}
    \hline
    \multicolumn{9}{|l|}{\textbf{Job role and responsibilities:}}   \\
        \hline
    \multicolumn{5}{|c|}{\textbf{Review of learning needs}}
        & \multicolumn{4}{c|}{\textbf{Development plan}}            \\
        \hline
    \textbf{Date}
        & \textbf{Ref} & \textbf{In what area do  I need to improve my  performance?}
            & \textbf{How does this link to other objectives  (eg employer, ICE,  etc)?}
                & \textbf{What do I need to learn in order to achieve this?}
                    & \textbf{What will I do to achieve this?}
                        & \textbf{What are the likely resources and support that I will need?}
                            & \textbf{How will I evaluate a successful  outcome?}
                                & \textbf{Deadline for meeting this target?}   \\
        \hline
    \endfirsthead
    \hline
    \multicolumn{9}{|l|}{\textbf{Job role and responsibilities (cont.):}}   \\
        \hline
    \multicolumn{5}{|c|}{\textbf{Review of learning needs}}
        & \multicolumn{4}{c|}{\textbf{Development plan}}            \\
        \hline
    \textbf{Date}
        & \textbf{Ref} & \textbf{In what area do  I need to improve my  performance?}
            & \textbf{How does this link to other objectives  (eg employer, ICE,  etc)?}
                & \textbf{What do I need to learn in order to achieve this?}
                    & \textbf{What will I do to achieve this?}
                        & \textbf{What are the likely resources and support that I will need?}
                            & \textbf{How will I evaluate a successful  outcome?}
                                & \textbf{Deadlines for meeting this target?}   \\
        \hline
    \endhead
    \multicolumn{9}{r}{\textit{Continue on the next page:}}   \\
    \endfoot
    \endlastfoot
    Jul 2006 & \makecell[tl]{RB-\\DAP-\\01}
        & Understanding structural steel detail drawings and preparing design drawing using AutoCAD
            & Knowledge of load transfer thorough proper detailing and to be represented in drawings
                &  Several structural components and their behaviour under loading; for AutoCAD, needed to learn the commands
                    &  Rigorous study of design drawings and draw the details using AutoCAD
                        &  Drawings from previous projects and the software AutoCAD and its manuals
                            & I shall be able to prepare structural detailing using AutoCAD
                                & Sep 2006  \\
        \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\  \hline
        &   &   &   &   &   &   &   &           \\
        \hline
    \end{tabularx}
    \endgroup
    
    \end{document}
    

note: \begingroup and \endgroup is used for limiting some settings (font size, additional vertical space) of table only to this table

enter image description here enter image description here

  • Thanks @Zarko!! But I want to use it as 'longtable'. When I try to use the 'longtable' I'm getting error message. What should I change? The 'tabularx' ? – LarCos Dec 10 '18 at 3:07
  • @LaCos, where is this mentioned in your question? how should i know this? please edit your question and clarify what you like to have (table over many pages). – Zarko Dec 10 '18 at 7:01
  • @LarCos, see edited answer. – Zarko Dec 10 '18 at 7:39

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.