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
Hi @lvjr,
one of the features I have found missing in tabularray is columns that expand automatically to fit their contents without exceeding the declared maximum table width, the way tabulary columns work. (I am maintaining a technical specification document with a lot of tables formatted that way; right now the document is using a hack that combines tabulary with longtable, but I would gladly move to tabularray and get rid of all the hacks I have to use e.g. to get lists working in tables, as well as avoid rendering problems with cell backgrounds and adjacent lines.) So, I went ahead and, after several hours looking at the tabularray code, figured out a way to implement an option that makes X columns with negative coefficients behave the way I need.
Please note that this is my first attempt at writing LaTeX3 code, so it is quite likely some of it could have been written in a more efficient way ;-) Feel free to make it better.
As you can see, I have also added a subsection to the manual demonstrating the usage of the new option.
By the way, I am aware there has been a feature request (#97) open for some time to implement something that, if implemented, would also provide a way to fulfil my needs, however the idea presented there (taken from tabu) takes a different approach and is really more complicated than what I need. That said, I did take the liberty of borrowing the option key name spread from there, even though the interface is very different from the one used by tabu. If you would like a different name, that is no problem.
Also by the way, I implemented spread=coeff because it was quite easy to do and I figured some people might appreciate the control it gives over the distribution of the surplus horizontal space, not because I actually need it — my needs are fulfilled by spread=none.
@mgrzegor Sorry for the late reply. In fact there are two relevant issues to this pull request. The first issue is about how to distribute extra space for X columns which is discussed in #365 . The spread=coeff implementation is about the first issue. The second issue is about how to control the size of extra space for X columns which is discussed in #97 . The spread=none implementation is about the second issue.
By the way, I am aware there has been a feature request (#97) open for some time to implement something that, if implemented, would also provide a way to fulfil my needs, however the idea presented there (taken from tabu) takes a different approach and is really more complicated than what I need. That said, I did take the liberty of borrowing the option key name spread from there, even though the interface is very different from the one used by tabu. If you would like a different name, that is no problem.
Also by the way, I implemented spread=coeff because it was quite easy to do and I figured some people might appreciate the control it gives over the distribution of the surplus horizontal space, not because I actually need it — my needs are fulfilled by spread=none.
I haven't decided yet the final interfaces for the first issue (#365). And since you actually only need the feature in the second issue (#97), I think you could focus only on this issue. In issue #97, I suggest to use key name width+. And I am afraid you need to make the key accept any dimension rather than only width+=0pt (which is the same as spread=none in your code). Since the spreading approach in tabu is complicated, you could implement the feature only for the case when all columns have negative coefficients. Spreading negative columns is much simpler than spreading positive columns in tabu.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @lvjr,
one of the features I have found missing in
tabularrayis columns that expand automatically to fit their contents without exceeding the declared maximum table width, the waytabularycolumns work. (I am maintaining a technical specification document with a lot of tables formatted that way; right now the document is using a hack that combinestabularywithlongtable, but I would gladly move totabularrayand get rid of all the hacks I have to use e.g. to get lists working in tables, as well as avoid rendering problems with cell backgrounds and adjacent lines.) So, I went ahead and, after several hours looking at thetabularraycode, figured out a way to implement an option that makes X columns with negative coefficients behave the way I need.Please note that this is my first attempt at writing LaTeX3 code, so it is quite likely some of it could have been written in a more efficient way ;-) Feel free to make it better.
As you can see, I have also added a subsection to the manual demonstrating the usage of the new option.
By the way, I am aware there has been a feature request (#97) open for some time to implement something that, if implemented, would also provide a way to fulfil my needs, however the idea presented there (taken from
tabu) takes a different approach and is really more complicated than what I need. That said, I did take the liberty of borrowing the option key namespreadfrom there, even though the interface is very different from the one used bytabu. If you would like a different name, that is no problem.Also by the way, I implemented
spread=coeffbecause it was quite easy to do and I figured some people might appreciate the control it gives over the distribution of the surplus horizontal space, not because I actually need it — my needs are fulfilled byspread=none.