Skip to content

Allow 'parseArgs' and 'numOptArgs' in environments#14

Merged
xemlock merged 5 commits intoxemlock:masterfrom
larsgw:patch-2
Jan 12, 2026
Merged

Allow 'parseArgs' and 'numOptArgs' in environments#14
xemlock merged 5 commits intoxemlock:masterfrom
larsgw:patch-2

Conversation

@larsgw
Copy link
Contributor

@larsgw larsgw commented Dec 7, 2024

Close #13

@larsgw
Copy link
Contributor Author

larsgw commented Dec 7, 2024

Would there be potential issues with this? If no, I can enable it for the tabular environ.

@stale stale bot added the stale Automatically closed due to inactivity label Jan 9, 2025
@xemlock xemlock removed the stale Automatically closed due to inactivity label Jan 9, 2025
Repository owner deleted a comment from stale bot Jan 9, 2025
@stale
Copy link

stale bot commented Feb 9, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Automatically closed due to inactivity label Feb 9, 2025
@xemlock xemlock removed the stale Automatically closed due to inactivity label Feb 9, 2025
@stale
Copy link

stale bot commented Mar 13, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Automatically closed due to inactivity label Mar 13, 2025
@stale
Copy link

stale bot commented Mar 21, 2025

Closing this issue after a prolonged period of inactivity.

@stale stale bot closed this Mar 21, 2025
@xemlock xemlock reopened this Mar 21, 2025
@stale stale bot removed the stale Automatically closed due to inactivity label Mar 21, 2025
@stale
Copy link

stale bot commented Apr 20, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Automatically closed due to inactivity label Apr 20, 2025
@stale
Copy link

stale bot commented Apr 27, 2025

Closing this issue after a prolonged period of inactivity.

@stale stale bot closed this Apr 27, 2025
@xemlock xemlock reopened this May 1, 2025
@xemlock xemlock removed the stale Automatically closed due to inactivity label May 1, 2025
@stale
Copy link

stale bot commented May 31, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Automatically closed due to inactivity label May 31, 2025
@larsgw
Copy link
Contributor Author

larsgw commented Jun 3, 2025

Commenting to keep it open.

@stale stale bot removed the stale Automatically closed due to inactivity label Jun 3, 2025
@stale
Copy link

stale bot commented Jul 3, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Automatically closed due to inactivity label Jul 3, 2025
@larsgw
Copy link
Contributor Author

larsgw commented Jul 3, 2025

Commenting to keep it open.

@stale stale bot removed the stale Automatically closed due to inactivity label Jul 3, 2025
@stale
Copy link

stale bot commented Aug 2, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Automatically closed due to inactivity label Aug 2, 2025
@larsgw
Copy link
Contributor Author

larsgw commented Aug 3, 2025

Commenting to keep it open.

@stale stale bot removed the stale Automatically closed due to inactivity label Aug 3, 2025
@stale
Copy link

stale bot commented Sep 2, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Automatically closed due to inactivity label Sep 2, 2025
@larsgw
Copy link
Contributor Author

larsgw commented Sep 2, 2025

Commenting to keep it open.

@stale
Copy link

stale bot commented Sep 10, 2025

Closing this issue after a prolonged period of inactivity.

@stale stale bot closed this Sep 10, 2025
@larsgw
Copy link
Contributor Author

larsgw commented Sep 11, 2025

?

@xemlock xemlock reopened this Jan 12, 2026
@stale stale bot removed the stale Automatically closed due to inactivity label Jan 12, 2026
@xemlock
Copy link
Owner

xemlock commented Jan 12, 2026

Hi @larsgw, apologies for the delayed response. Thanks for your contribution!
Unfortunately the proposed changes work incorrectly. For the following (valid) input:

\begin{tabular}[t]{|c|c|c|}
 cell1 & cell2 & cell3
\end{tabular}

we get garbled result:

\begin{tabular}{{[}}
t{]}{|c|c|c|} cell1 & cell2 & cell3
\end{tabular}

when rendering via PhpLatex_Renderer_Abstract::toLatex, which suggests that something is wrong with building the document tree.

@larsgw
Copy link
Contributor Author

larsgw commented Jan 12, 2026

Part of this is because I have not updated the tabular environ yet in library/PhpLatex/Utils/environs.php, so that's the behavior without numOptArgs. With, it becomes the following, which still isn't ideal:

\begin{tabular}
[{t}]{|c|c|c|} cell1 & cell2 & cell3 
\end{tabular}

@larsgw
Copy link
Contributor Author

larsgw commented Jan 12, 2026

I'll update environs.php as best I can, and take a look at the document tree.

@xemlock
Copy link
Owner

xemlock commented Jan 12, 2026

Part of this is because I have not updated the tabular environ yet.

Yes, you're right! I didn't catch that.

As for failing tests, just add single space before cell1 in the expected output (so that it matches other environment tests) and we're good to go.

@larsgw
Copy link
Contributor Author

larsgw commented Jan 12, 2026

Not sure why I didn't run it again after the last changes... Also, apparently there should be a space afterwards too.

@larsgw
Copy link
Contributor Author

larsgw commented Jan 12, 2026

That's strange, this passes the tests locally (php 8.2).

@xemlock
Copy link
Owner

xemlock commented Jan 12, 2026

There shouldn't be space after any more (because of commit f4d3604). Not sure what commit your PR branch originates from, but if you'd rebase it (or merge) from master, it should start working.

@xemlock
Copy link
Owner

xemlock commented Jan 12, 2026

You can pull recent changes with the following commands in your terminal:

git remote add xemlock git@github.com:xemlock/php-latex.git
git fetch xemlock master
git merge xemlock/master

@larsgw
Copy link
Contributor Author

larsgw commented Jan 12, 2026

Oh, that makes sense, thank you.

@xemlock xemlock merged commit dd83568 into xemlock:master Jan 12, 2026
6 checks passed
@xemlock
Copy link
Owner

xemlock commented Jan 12, 2026

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to parse optional arguments of environments

2 participants