Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support spreadtab block #535

Closed
Hzbeta opened this issue Apr 16, 2024 · 4 comments
Closed

Feature Request: Support spreadtab block #535

Hzbeta opened this issue Apr 16, 2024 · 4 comments
Labels
align-at-ampersand-routine the align at ampersand; documented in lookForAlignDelims enhancement enhancement which might be to an existing feature or the development of a new feature feature-request user-centred feature request for an enhancement to an existing feature, or for a new feature implemented implemented tag means that either an enhancement or feature request has been implemented, or bugfix

Comments

@Hzbeta
Copy link

Hzbeta commented Apr 16, 2024

Spreadtab allows us to construct tables in a manner similar to a spreadsheet. The cells of a table have row and column indices and these can be used in formulas to generate values in other cells. Detailed instructions can be found here.

image

I hope latexindent.pl can support formatting of the table content in spreadtab block, just like normal tabular block!

For example, no yaml setting, original .tex code

\begin{spreadtab}{{tabular}{r*6c}} % or \spreadtab{{tabular}{r*6c}}
@Ages & 10 & 11 & 12 & 13 & 14 & 15\\
@Number & 5 & 8 & 20 & 55 & 9 & 3\\\hline
@Average&\multicolumn{6}{l}{:={sumprod(b1:g1;b2:g2)/sum(b2:g2)}}
\end{spreadtab} % or \endspreadtab

actual/given output

\begin{spreadtab}{{tabular}{r*6c}} % or \spreadtab{{tabular}{r*6c}}
    @Ages & 10 & 11 & 12 & 13 & 14 & 15\\
    @Number & 5 & 8 & 20 & 55 & 9 & 3\\\hline
    @Average&\multicolumn{6}{l}{:={sumprod(b1:g1;b2:g2)/sum(b2:g2)}}
\end{spreadtab} % or \endspreadtab 

desired or expected output

\begin{spreadtab}{{tabular}{r*6c}} % or \spreadtab{{tabular}{r*6c}}
    @Ages    & 10                                                      & 11 & 12 & 13 & 14 & 15 \\
    @Number  & 5                                                       & 8  & 20 & 55 & 9  & 3  \\\hline
    @Average & \multicolumn{6}{l}{:={sumprod(b1:g1;b2:g2)/sum(b2:g2)}}
\end{spreadtab} % or \endspreadtab 

anything else

Thanks for such a great LaTeX formatting tool! :)

@cmhughes cmhughes added feature-request user-centred feature request for an enhancement to an existing feature, or for a new feature align-at-ampersand-routine the align at ampersand; documented in lookForAlignDelims labels Apr 16, 2024
@cmhughes
Copy link
Owner

Great, thanks, will do :)

@cmhughes cmhughes added the enhancement enhancement which might be to an existing feature or the development of a new feature label Apr 16, 2024
@cmhughes
Copy link
Owner

If anyone wants to take this on, it should just be adding spreadtab to the lookForAlignDelims field. Should be a nice way to get started on contributing.

@cmhughes
Copy link
Owner

This is implemented as of 8e089c5

It'll be part of the next release. Please leave this issue open until I've made the release, hopefully coming soon...

@cmhughes cmhughes added the implemented implemented tag means that either an enhancement or feature request has been implemented, or bugfix label Apr 28, 2024
@cmhughes
Copy link
Owner

implemented and released at https://github.com/cmhughes/latexindent.pl/releases/tag/V3.24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
align-at-ampersand-routine the align at ampersand; documented in lookForAlignDelims enhancement enhancement which might be to an existing feature or the development of a new feature feature-request user-centred feature request for an enhancement to an existing feature, or for a new feature implemented implemented tag means that either an enhancement or feature request has been implemented, or bugfix
Projects
None yet
Development

No branches or pull requests

2 participants