Graphics, Figures & Tables ⇒ Why do people insert @{} in table preamble?
Why do people insert @{} in table preamble?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Why do people insert @{} in table preamble?
@{code}
stands for a command which inserts code
between columns, also before the first column and after the last one. So you could insert a \hspace
you like, a symbol, or nothing. {}
means nothing, as the code is empty. The consequence is, that the default space between columns is removed. This can be desirable, for example to align left and right side of a table with a horizontal separation line.Take a look:
Code: Select all
\documentclass{article}
\begin{document}
Text
\begin{tabular}{ll}
1 & 2 \\
3 & 4
\end{tabular}
Text
\bigskip
Text
\begin{tabular}{@{}l@{}l@{}}
1 & 2 \\
3 & 4
\end{tabular}
Text
\end{document}
Code: Select all
\documentclass{article}
\pagestyle{empty}
\begin{document}
\begin{tabular}{lcr}
One & Two & Three \\
\hline
yes & maybe & or no
\end{tabular}
\bigskip
\begin{tabular}{@{}lcr@{}}
One & Two & Three \\
\hline
yes & maybe & or no
\end{tabular}
\end{document}