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

Avoid brace stripping in \__tblr_extract_table_commands:N #4

Open
muzimuzhi opened this issue Nov 19, 2024 · 0 comments · May be fixed by #6
Open

Avoid brace stripping in \__tblr_extract_table_commands:N #4

muzimuzhi opened this issue Nov 19, 2024 · 0 comments · May be fixed by #6

Comments

@muzimuzhi
Copy link
Owner

muzimuzhi commented Nov 19, 2024

Follow-up to 5d380e6 (feat: turn off step tracing by default, 2024-04-05). Found when preparing example used in lvjr/tabularray#501 (comment).

\__tblr_extract_table_commands:N converts {b} to b and {b}b to bb. The braces are stripped by use of

\exp_last_unbraced:NV \__tblr_extract_table_commands_next:n #1 \q_stop
\documentclass{article}
\usepackage{tabularray}

\begin{document}
\SetTblrTracing{+text}

\begin{tblr}{}
  a & \\
  {b} & {b}b \\
  {{c}} \\
\end{tblr}
\end{document}
> The spec list text_1 contains the pairs:.
>  {[1][1]}  =>  {a}.
>  {[1][2]}  =>  {}.
>  {[2][1]}  =>  {b}.
>  {[2][2]}  =>  {bb}.
>  {[3][1]}  =>  {c}.
>  {[4][1]}  =>  {}.

\cs_new_protected:Npn \__tblr_extract_table_commands:N #1
{
\tl_clear:N \l__tblr_saved_table_commands_before_cell_text_tl
\tl_clear:N \l__tblr_saved_cell_text_after_table_commands_tl
\exp_last_unbraced:NV \__tblr_extract_table_commands_next:n #1 \q_stop
\tl_if_empty:NF \l__tblr_saved_table_commands_before_cell_text_tl
{
\__tblr_prop_gput:neV { command }
{[\int_use:N \c@rownum][\int_use:N \c@colnum]}
\l__tblr_saved_table_commands_before_cell_text_tl
}
\tl_set_eq:NN #1 \l__tblr_saved_cell_text_after_table_commands_tl
}

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 a pull request may close this issue.

1 participant