Background: Up to recently, I was the only one that read the sources of my LaTeX
document. However, I now need to collaborate with others for co-authoring papers, as well as with journals editors.
I noticed very different layouts in .tex
files for what concerns tables.
The basic structure I currently use to format my tables is:
\begin{tabular}{<columns-definitions>}
\toprule
<cell content>
&
<cell content>
&
<cell content>
\\\midrule
<cell content>
&
<cell content>
&
<cell content>
\\
<cell content>
&
<cell content>
&
<cell content>
\\\bottomrule
\end{tabular}
Even if it's easy to find this or that cell content, the code spans over numerous lines. If there are many cells in a row, it is also uneasy to switch from one cell to the one under it.
Thus, I'd like to know how to format my .tex
source-code in order to make easy for others to edit my tables?
Of course, I know this question can be seen as opinion based. However, I don't want to know what you do or you prefer, but rather what is the most efficient.
(I here neglected all refinement using other environment for tables (e.g., tabularx
), formating it nicely using the booktabs
package, etc. These advices do not fall into the frame of this question.)
\tabularnewline
instead of `\\` to emphasize the newline, and I place any rule command in the next line, but this very opinion-based\\
rather than\\\toprule
) but for data tables with moderate numbers of columns I'd set each row on one line, with the&
lined up so it looks like a table.