0

I am trying to add a little distance between the words of the sentences in the right column and the vertical line of the table. The table has exactly the same width that the document has, thus the table should not get wider. This makes another problem which is splitting the words with an - and continue in the next line. See the picture I added: picture

I guess the configuration for the tabular I wrote in latex is not the optimal one for the table.

Is there a better configuration I can use for this table, to not split the words at the end of the column, and make space for the text in the right column without passing the limits of the documents? Thanks a lot in avance for the help!

(PS: The code below has the same code but I added only TEXT instead of the content that I have in the table and the picture)

\documentclass[ngerman,12pt,a4paper,oneside,listof=totoc,plainfootsepline]{scrbook}
\addtokomafont{disposition}{\rmfamily} 
\addtokomafont{captionlabel}{\bfseries}
\RedeclareSectionCommand[beforeskip=-.5\baselineskip,afterskip=.25\baselineskip]{subsubsection}
\usepackage{tabularray}
\usepackage{tabularx}
\usepackage{float}
\begin{document}
\begin{table}[H]
    \caption[Distances of RFID Systems]{Distances of RFID Systems~\cite{Internetquelle2}}
    \label{Tab:Distances of RFID Systems}
    \begin{tabularx}{\textwidth}{|@{} l| X @{} |}
        %   \scriptsize 
        %   {\textwidth}{!}{%
        %       \begin{tabularx}{@{}|l|X|@{}}
        \toprule[1pt]   
        \textbf{Distances of RFID Systems} & \textbf{Meaning} \\ 
        \midrule[1pt]   
        \textbf{Close Coupling} & TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT \qty{0} TEXT \qty{1}{\centi\meter}. UTEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT . ITEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT .\\ 
        \midrule    
        \textbf{Remote Coupling} & TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT. Ihr Frequenzbereich liegt unter \qty{135}{\kilo\hertz} oder \qty{13,56}{\mega\hertz}. TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT\qty{6,75}{\mega\hertz}, und \qty{27,125}{\mega\hertz}.
        TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT .\\ 
        \midrule    
        \textbf{Long Range} & TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT .\\
        \bottomrule[1pt]    
    \end{tabularx}
\end{table}
\end{document}
4
  • 3
    there is normally a space there but you have added @{} to remove it. Note you are using booktabls (midrule etc) booktabs is explicitly incompatible wit having verticla rules so the intended use here would be to remove the |. Commented Sep 28, 2021 at 14:30
  • 2
    please always provide the example in a form that can be run to see the issue. this has no \documentclass and doesn't seem to load bookatbs but uses its commands. It uses a [H] float placement without defining it, Commented Sep 28, 2021 at 14:33
  • 1
    ! Undefined control sequence. <inserted text> {|@{} l| X @{} |} \toprule Commented Sep 28, 2021 at 14:46
  • 1
    Your code doesn't even compile: There's no \documentclass statement, necessary pacakages (such as booktabs and siunitx) aren't being loaded, and several \usepackage directives occur after, not before \begin{document}. The directive \qty{0} is syntactically incorrect. What exactly are you trying to achieve by littering your code with mistakes? Please fix.
    – Mico
    Commented Sep 28, 2021 at 15:04

1 Answer 1

3

Since you already load tabularray package (note: it had to be loaded in preamble of document), I would use it. For space at begin and end of table just remove @{} as is mentioned in @DavidCarlisle comment:

\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}


\begin{document}
\begin{table}[htb]
    \caption[Distances of RFID Systems]{Distances of RFID Systems~\cite{Internetquelle2}}
    \label{Tab:Distances of RFID Systems}
\begin{tblr}{hline{1,2,Z} = 1pt, hline{3-Y}=0.6pt,
             vlines,
             colspec={X[1,l] X[3,j]},
             column{1} = {font=\bfseries},
             row{1} = {font=\bfseries}
             }
\SetCell[c=1]{m}    Distances of RFID Systems
    &   Meaning     \\
Close Coupling
& TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT \qty{0} TEXT \qty{1}{\centi\meter}. UTEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT . ITEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT .\\ %
Remote Coupling
    & TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT. Ihr Frequenzbereich liegt unter \qty{135}{\kilo\hertz} oder \qty{13,56}{\mega\hertz}. TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT\qty{6,75}{\mega\hertz}, und \qty{27,125}{\mega\hertz}. TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT .\\
Long Range
    & TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT .\\
\end{tblr}
    \end{table}
\end{document}

enter image description here

6
  • Thanks a lot for your Solution. I just do not know what I am doing wrong. I could not compile your code. I get the error "Missing number, treated as zero. \end", "Missing = inserted for \ifnum. \end" and "Undefined color `j'. \end"
    – ramles
    Commented Sep 28, 2021 at 15:17
  • @ramles, which compiler you use? Do you have installed recent version of tabularray (2021N)?
    – Zarko
    Commented Sep 28, 2021 at 16:25
  • I use TexStudio. I should check if it needs an update.
    – ramles
    Commented Sep 28, 2021 at 16:26
  • 1
    @ramlesm TeXStudie is just editor. You need to update your LaTeX installation. For this use supporting tools of used distribution. For example MiKTeX console, if you have MiKTeX.
    – Zarko
    Commented Sep 28, 2021 at 16:36
  • 1
    @ramles, just write so may rows and columns as you needed :-). However, if table becomes bigger then page, you need to consider to use long table: longtblr and maybe to rotate pages with it in the landscape orientation. Search for similar tables on the site and read package documentation.
    – Zarko
    Commented Sep 29, 2021 at 0:25

You must log in to answer this question.

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