darioteixeira / lambdoc

Lambdoc is a library providing support for semantically complex documents in Ocsigen web applications
GNU General Public License v2.0
17 stars 1 forks source link

Tabular formatting should be specified as a style parameter #29

Closed darioteixeira closed 8 years ago

darioteixeira commented 9 years ago

In Lambtex, the formatting/alignment for tabular environments is specified à la LaTeX, ie, \begin{tabular}{ccc} (for example). This syntax was chosen for LaTeX compatibility, but is anomalous within Lambtex. For the sake of language consistency, the column formatting/alignment should be specified as a style parameter, ie, \begin<format=ccc>{tabular}.

Unfortunately this will break existing docs out there, though the migration should be a simple matter of search & replace. What do you think @edwintorok?

edwintorok commented 9 years ago

Are you going to change the advanced cell syntax too? Previously the {2c_} was consistent with {ccc}, not sure how that should look after using style parameters. Perhaps \col<format=2c_>{ ... contents of multicolumn span ..}?

darioteixeira commented 9 years ago

Yes, for consistency sake the cell syntax would need to to change too. Since the angle brackets < > are the universal syntax for style/formatting, |{2c_} would be changed to |<f=2c_>. Note that the cell formatting would be specified as a key/value pair with f as the key (the name for the key is open for discussion, of course). This would allow for specifying classname styles also for individual cells. For instance: |<fancy>.

This revised syntax has the disadvantage of being slightly more verbose. Nevertheless, I think it's worth considering because it makes the style syntax uniform across the entire Lambtex language.