1

I have some code (see below) that outputs two tables like below. How can I remove the red area and make the term "nomenclature" flush left like the word "contents"?

\minitoc
\begin{table}[htbp]
    \centering
    %\begin{tabularx}{\textwidth}{| X | X | X |}
    \begin{tabularx}{\textwidth}{sb}
        %\hline
        \large\textbf{Nomenclature}  \normalsize   &      \\ \hline
        0         & 2        \\ 
        1         & 3        \\ \hline
    \end{tabularx}
\end{table}

enter image description here

3
  • 2
    Welcome to TeX:SE! By adding @{} at begin (and end) of column specification: \begin{tabularx}{\textwidth}{@{} X X X @{}}. However, your code fragment is not very clear. Please extend it to complete small document that context of your table will be more clear.
    – Zarko
    Commented Nov 16, 2021 at 9:56
  • Thanks you that worked a treat. First time writing a report in LaTeX so communities like this are a fantastic help!
    – Ben Watson
    Commented Nov 16, 2021 at 10:03
  • You are welcome. See answer below, and try to extend your code fragment to an MWE (an example you can see in answer), which reproduce your problem. Knowing it is more easy to help you and maybe give you some off-topic advice, how you can better/easy write your table (or whatever) .
    – Zarko
    Commented Nov 16, 2021 at 10:39

1 Answer 1

1

Let me extend my comment to answer, which contain two examples of how you can write your table. Examples are in form of MWE (Minimal Working Example, a small complete document), which can be compiled as it is:

\documentclass{article}
\usepackage{tabularray}
\usepackage{tabularx}

\begin{document}
with \verb+tabularx+:
    \begin{table}[ht]
    \setlength\extrarowheight{2pt}
\begin{tabularx}{\textwidth}{@{} X X @{}}
    \hline
\large\textbf{Nomenclature} &   \\ 
    \hline
        0                   & 2 \\
        1                   & 3 \\ 
    \hline
    \end{tabularx}
\end{table}

with \verb+tabularray+:
    \begin{table}[ht]
\begin{tblr}{hline{1,2,Z},
             colspec = {@{} *{2}{X[l]} @{}},
             row{1} = {font=\large\bfseries,abovesep+=2pt},
             row{2-Z} = {rowsep=1pt}
             }
Nomenclature    &       \\ 
        0       & 2     \\
        1       & 3     \\ 
\end{tblr}
    \end{table}
\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 .