You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The LaTeX source code currently represents each row of a table as a single row of text. This makes it easy to read the source, but it actually complicates some automatic tooling. Even if only a single character is changed in one cell, diff considers the entire row to be different. Since the rows are very long this makes interpreting diffs – and thus git output – very hard. It also makes the data harder to parse since a program has to know quite a bit about LaTeX table syntax to pick apart the individual cells in each row.
An alternative format is to put each cell on its own line in the LaTeX source. A line like
cell 0 & cell 1 & cell 2\\
would instead be something like
cell 0
& cell 1
& cell 2\\
So that each cell is on a separate line. A change made to a single cell would be seen in a diff by the change of a single line. Parsing a row would be reading each line up to one ending with \\ and then filtering the LaTeX cruft like &. Since each cell is on its own line, the count of lines in a block would track the number of cells in a row and thus make indexing simpler.
The text was updated successfully, but these errors were encountered:
jcrippen
changed the title
Reformat LaTeX source of tables for better parsing/diffing
Reformat LaTeX source of tables for better parsing and diffing
Jul 10, 2020
The LaTeX source code currently represents each row of a table as a single row of text. This makes it easy to read the source, but it actually complicates some automatic tooling. Even if only a single character is changed in one cell,
diff
considers the entire row to be different. Since the rows are very long this makes interpreting diffs – and thusgit
output – very hard. It also makes the data harder to parse since a program has to know quite a bit about LaTeX table syntax to pick apart the individual cells in each row.An alternative format is to put each cell on its own line in the LaTeX source. A line like
would instead be something like
So that each cell is on a separate line. A change made to a single cell would be seen in a diff by the change of a single line. Parsing a row would be reading each line up to one ending with
\\
and then filtering the LaTeX cruft like&
. Since each cell is on its own line, the count of lines in a block would track the number of cells in a row and thus make indexing simpler.The text was updated successfully, but these errors were encountered: