-
Notifications
You must be signed in to change notification settings - Fork 17
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
Wish: Please let me set a table caption #86
Comments
Setting a caption throws an exception after creating a table with: Traceback (most recent call last): = = = Interestingly, I can set/get the caption as expected if I create the table in MacOs Numbers, set the caption and then open the Numbers file from Python:
Output is: |
I plan to implement captions for new tables, but this will take some time. When a new table is added, I don't delete most of the table's attributes to force Numbers to create them when the document is first loaded. Captions are one of those and they're surprisingly complicated compared to the table title. It's also why #84 happens. |
No rush on fixing this and #84. They are icing on the cake. I'm extracting documentation from 35K lines of C++ and creating a spreadsheet with six sheets, where each sheet contains two tables. This is already above and beyond what I had hoped for when I found the numbers-parser package. |
This now supported in v4.11.5. How captions are stored changed somewhere in the past few versions and I am relying upon recent data structures in Numbers files to set captions. It should be fine for new documents as the empty doc reference is generated with 14.1. |
One more observation. I removed my code to set the caption on table1. I reran the Python script and the caption from table0 still showed up! This makes sense from your previous comments about sharing attributes between tables. — Gerd —On Jun 19, 2024, at 1:46 AM, Jon Connell ***@***.***> wrote:
This now supported in v4.11.5. How captions are stored changed somewhere in the past few versions and I am relying upon recent data structures in Numbers files to set captions. It should be fine for new documents as the empty doc reference is generated with 14.1.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
You can add Numbers files zipped or just rename the |
Hi Jon, here's my template Numbers input file with .zip extension. It's created with Numbers 13.1 -- that's where the MacBook Air I use tops out. As I mentioned above I tried a template created with Number 14.1, but the result was the same. Using this "Template" pattern makes it much easier to crate the sheets, table columns, headings, colors, column widths, etc. I could create them all from code, but it's less convenient to change fonts/colors, etc. then. |
It wasn't so much version dependent as Numbers stores a dummy caption when one has yet to be created for a table so I needed to create the caption storage from scratch rather than patch it. Can you give 4.12.0 a try and see how well it works for you for new captions. |
Hi Jon, I tried version 4.12, but it doesn't work much better than your previous release. I've created a small Python program that demonstrates the issues -- I should have done that before. The program reads Template.numbers, which contains two sheets and one table in each sheet (Table0). The program creates a second table and adds one row to each table. The result is saved in Output.numbers. If you run it unmodified, it will set the caption of both tables in the first tab ("Train Inputs"). The top table caption works as expected. But the programmatically created table concatenates the captions of both tables and the caption is written over the table title: = = = Secondly, uncomment line 123 of main.py: The script now crashes. I believe the difference between the two sheets is that I've never set its caption from MacOS Numbers. Updated caption: Table0 Caption Process finished with exit code 1 = = = In case you are interested: I'm a retired C++ software developer. I've got a model railroad/automobile layout that's run by 15 Arduino processors. This Python script parses the C++ header files (from 35K lines of C+) and extract electrical input and output documentation. The documentation is written to the numbers spreadsheet. Thanks again for working on this issue. |
Spotted another missing attribute in new tables. Your script works for me now in v4.12.1. |
Thanks, Jon. v4.12.1 works in my full Python script as well. One remaining issue is that a new table is created with captions enabled. Seems like captions should be off by default. I thought perhaps that the enable/disable was being inherited from the previous table. Try commenting out line 71 in my sample script: The output from the script is: = = = Arduino's and Trains&Car System: I've got over 500 electrical inputs/outputs. Each Arduino can reasonably handle 40-60 I/O's from an electrical standpoint. I don't need the processing power of 15 processors. (But my friends tell me I'm crazy -- rightly so :-) ) = = = One more thing, possibly related to the table height issue... When I look at the created spreadsheet in MacOS Numbers, the second table gets created in the expected position: But, on longer tables (117 rows) File->Print overlaps the second table on the end of the first. This image is from the Print Preview (the actual print looks the same as the preview): A shorter first table does not have this issue: Would you like me to open a separate issue, or is this part of the previous Table Height issue? |
Worth a separate issue as not accounting for captions is a known limitation. But new tables are now created without captions enabled (v4.12.2). |
Thanks for fixing the captions default. Captions now work as expected. You may close this issue. I will characterize the printing overlap issue on tables without captions and create a separate issue. Thanks again for all your work on this. I thought a simple API accessor was needed to implement captions. But, nothing is ever simple in software! |
Yes captions are significantly more complex than titles and a lot of what could be done with them isn’t even available in the Numbers UI. |
Thanks for reopening his issue, Jon I’m seeing the same overlap in Print Preview when my first table spans several printed pages.
I was planning to characterize this defect last week and create a new issue. But, the rest of m life got in the way :-(
I’m happy to test a new version if you find something to fix.
…____
Gerd
On Jul 13, 2024, at 9:21 AM, Jon Connell ***@***.***> wrote:
Reopening this as I was looking at the caption overlap. I created 2 tables in a new Numbers document and added lots of rows. I also made the caption multiple lines and in print preview I get this:
Screenshot.2024-07-13.at.17.19.07.png (view on web) <https://github.com/user-attachments/assets/4ea8fb11-e193-4ed8-9e8b-d006ef5ef26e>
I'm wondering if it's a Numbers bug since this was created in Numbers.
The obvious workaround is to move the table so that the gap is larger. You can get the coordinates of tables to do this.
—
Reply to this email directly, view it on GitHub <#86 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BHXMFXGW4GY47YXYIQI42ULZMFH2LAVCNFSM6AAAAABJI57L76VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRWHE4DINRXHA>.
You are receiving this because you authored the thread.
|
Describe the bug
There is no way to add a caption at the bottom of a table.
Expected behavior
Please provide a way to add text to the table caption.
Additional information
python -m pip list
[ ... ]
numbers-parser 4.10.5
The text was updated successfully, but these errors were encountered: