Skip to content

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

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

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

Conversation

@larsgw

@larsgw larsgw commented Dec 7, 2024

Copy link
Copy Markdown
Contributor

Close #13

@larsgw

larsgw commented Dec 7, 2024

Copy link
Copy Markdown
Contributor Author

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

stale Bot commented Feb 9, 2025

Copy link
Copy Markdown

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

stale Bot commented Mar 13, 2025

Copy link
Copy Markdown

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

stale Bot commented Mar 21, 2025

Copy link
Copy Markdown

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

stale Bot commented Apr 20, 2025

Copy link
Copy Markdown

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

stale Bot commented Apr 27, 2025

Copy link
Copy Markdown

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

stale Bot commented May 31, 2025

Copy link
Copy Markdown

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

larsgw commented Jun 3, 2025

Copy link
Copy Markdown
Contributor Author

Commenting to keep it open.

@stale stale Bot removed the stale Automatically closed due to inactivity label Jun 3, 2025
@stale

stale Bot commented Jul 3, 2025

Copy link
Copy Markdown

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

larsgw commented Jul 3, 2025

Copy link
Copy Markdown
Contributor Author

Commenting to keep it open.

@stale stale Bot removed the stale Automatically closed due to inactivity label Jul 3, 2025
@stale

stale Bot commented Aug 2, 2025

Copy link
Copy Markdown

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

larsgw commented Aug 3, 2025

Copy link
Copy Markdown
Contributor Author

Commenting to keep it open.

@stale stale Bot removed the stale Automatically closed due to inactivity label Aug 3, 2025
@stale

stale Bot commented Sep 2, 2025

Copy link
Copy Markdown

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

larsgw commented Sep 2, 2025

Copy link
Copy Markdown
Contributor Author

Commenting to keep it open.

@stale

stale Bot commented Sep 10, 2025

Copy link
Copy Markdown

Closing this issue after a prolonged period of inactivity.

@stale stale Bot closed this Sep 10, 2025
@larsgw

larsgw commented Sep 11, 2025

Copy link
Copy Markdown
Contributor Author

?

@xemlock xemlock reopened this Jan 12, 2026
@stale stale Bot removed the stale Automatically closed due to inactivity label Jan 12, 2026
@xemlock

xemlock commented Jan 12, 2026

Copy link
Copy Markdown
Owner

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

larsgw commented Jan 12, 2026

Copy link
Copy Markdown
Contributor Author

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

larsgw commented Jan 12, 2026

Copy link
Copy Markdown
Contributor Author

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

@xemlock

xemlock commented Jan 12, 2026

Copy link
Copy Markdown
Owner

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

larsgw commented Jan 12, 2026

Copy link
Copy Markdown
Contributor Author

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

@larsgw

larsgw commented Jan 12, 2026

Copy link
Copy Markdown
Contributor Author

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

@xemlock

xemlock commented Jan 12, 2026

Copy link
Copy Markdown
Owner

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

xemlock commented Jan 12, 2026

Copy link
Copy Markdown
Owner

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

larsgw commented Jan 12, 2026

Copy link
Copy Markdown
Contributor Author

Oh, that makes sense, thank you.

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

xemlock commented Jan 12, 2026

Copy link
Copy Markdown
Owner

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