Skip to content

Commit

Permalink
remove verb key (#530)
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjr committed Nov 30, 2024
1 parent 1cefade commit d7a818c
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 123 deletions.
14 changes: 0 additions & 14 deletions manual/manual-3.tex
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,6 @@ \subsection{Hspan and Vspan Algorithms}
\end{tblr}
\end{demohigh}

\subsection{Use Verbatim Commands}

%With \verb!verb! key, you can write \verb!\verb! commands in the cell text:
%
%\begin{demohigh}
%\begin{tblr}{hlines,verb}
% 20 & 30 & \verb!\hello{world}!40 \\
% 50 & \verb!\hello!60 & 70 \\
%\end{tblr}
%\end{demohigh}

The inner key \verb!verb! is obsolete from version 2023A, and will be removed in the future.
Instead you can use more reliable \verb!\fakeverb! command (see Section \ref{sec:fakeverb}).

\subsection{Set Baseline for the Table}

With \verb!baseline! key, you can set baseline for the table.
Expand Down
6 changes: 3 additions & 3 deletions manual/manual-6.tex
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ \section{Control Horizontal Alignment}
\section{Use Safe Verbatim Commands}%
\label{sec:fakeverb}

Due to the limitation of TeX, even if you have passed \texttt{verb} option to a
\texttt{tabularray} table, you still could not use some special characters in a
\verb!\verb! command. As an replacement, you may use \verb|\fakeverb| command from \href{https://www.ctan.org/pkg/codehigh}{\texttt{codehigh}} package.
Due to the limitations of TeX,
we are not able to make \fakeverb{\verb} command behave well inside \texttt{tabularray} tables.
As a replacement, you may use \fakeverb{\fakeverb} command from \href{https://www.ctan.org/pkg/codehigh}{\texttt{codehigh}} package.

The \verb|\fakeverb| command will remove the backslashes in the following control symbols before
typesetting its content: \fakeverb{\\\\}, \fakeverb{\\\{}, \fakeverb{\\\}}, \fakeverb{\\\#}, \fakeverb{\\\^} and \texttt{\textbackslash\textvisiblespace}, \fakeverb{\\\%}.
Expand Down
32 changes: 4 additions & 28 deletions tabularray.sty
Original file line number Diff line number Diff line change
Expand Up @@ -3056,7 +3056,6 @@
}
\tl_new:N \l__tblr_inner_spec_measure_tl
\tl_new:N \l__tblr_inner_spec_verb_tl
\cs_new_protected:Npn \__tblr_init_table_inner_spec:
{
Expand Down Expand Up @@ -3105,7 +3104,6 @@
{ [\int_eval:n { \c@colcount + 1}] / ##1 } {##2}
}
\tl_clear:N \l__tblr_inner_spec_measure_tl
\tl_clear:N \l__tblr_inner_spec_verb_tl
\keys_set:nv { tblr } { l__tblr_default_ \l__tblr_env_name_tl _inner_tl }
}
Expand All @@ -3119,7 +3117,7 @@
colspec, rowspec, column, row, cell, hline, vline, hborder, vborder, width,
rowhead, rowfoot, columns, rows, cells, hlines, vlines, % hborders, vborders,
leftsep, rightsep, colsep, abovesep, belowsep, rowsep, rulesep,
baseline, hspan, vspan, stretch, verb, delimiter
baseline, hspan, vspan, stretch, delimiter
}
\keys_define:nn { tblr }
Expand All @@ -3130,8 +3128,6 @@
hspan .code:n = \__tblr_keys_gput:nn { hspan } {#1},
vspan .code:n = \__tblr_keys_gput:nn { vspan } {#1},
stretch .code:n = \__tblr_keys_gput:nn { stretch } {#1},
verb .tl_set:N = \l__tblr_inner_spec_verb_tl,
verb .default:n = lite,
columns .code:n = \__tblr_set_every_column_aux:n {#1},
rows .code:n = \__tblr_set_every_row_aux:n {#1},
cells .code:n = \__tblr_set_every_cell_aux:n {#1},
Expand Down Expand Up @@ -3782,7 +3778,7 @@
\begin{tblrNoHyper}
\begin{varwidth}{\paperwidth}
\l__tblr_f_tl
\__tblr_rescan_cell_tokens:N \l__tblr_c_tl
\l__tblr_c_tl
\end{varwidth}
\end{tblrNoHyper}
}
Expand All @@ -3801,7 +3797,7 @@
\hbox_set:Nn \l_tmpa_box
{
\l__tblr_f_tl
\__tblr_rescan_cell_tokens:N \l_tmpa_tl
\l_tmpa_tl
}
\tl_set:Nx \l__tblr_w_tl
{ \dim_max:nn { \l__tblr_w_tl } { \box_wd:N \l_tmpa_box } }
Expand Down Expand Up @@ -3864,27 +3860,7 @@
\TblrParboxRestore
\cs:w __tblr_halign_command_ \g__tblr_cell_halign_tl : \cs_end:
\__tblr_leave_vmode:
\bool_if:NTF \l__tblr_cell_math_mode_bool
{ #1 }
{ \__tblr_rescan_cell_tokens:N #1 }
}
%% When using verb option, there is an end-of-line character at the end.
%% This character causes extra horizontal space at the end when "measure=hbox",
%% or causes extra vertical space at the end with "measure=vbox".
%% Therefore we have to use an \empty to remove it.
%% See https://tex.stackexchange.com/q/213659
\cs_new_protected:Npn \__tblr_rescan_cell_tokens:N #1
{
\tl_if_empty:NTF \l__tblr_inner_spec_verb_tl
{ #1 }
{
%% insert space characters after some control sequences first (issue #112)
\regex_replace_all:nnN { (\c{[A-Za-z]*}) ([A-Za-z]) } { \1 \ \2 } #1
\regex_replace_all:nnN { . } { \c{string} \0 } #1
\tl_set:Nx #1 { #1 \noexpand \empty }
\exp_args:NV \tex_scantokens:D #1
}
#1
}
%% #1: total height dimension; #2: head dimension; #3: foot dimension;
Expand Down
20 changes: 3 additions & 17 deletions tabularray.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1525,20 +1525,6 @@ \subsection{Hspan and Vspan Algorithms}
\end{tblr}
\end{demohigh}
\subsection{Use Verbatim Commands}
%With \verb!verb! key, you can write \verb!\verb! commands in the cell text:
%
%\begin{demohigh}
%\begin{tblr}{hlines,verb}
% 20 & 30 & \verb!\hello{world}!40 \\
% 50 & \verb!\hello!60 & 70 \\
%\end{tblr}
%\end{demohigh}
The inner key \verb!verb! is obsolete from version 2023A, and will be removed in the future.
Instead you can use more reliable \verb!\fakeverb! command (see Section \ref{sec:fakeverb}).
\subsection{Set Baseline for the Table}
With \verb!baseline! key, you can set baseline for the table.
Expand Down Expand Up @@ -3125,9 +3111,9 @@ \section{Control Horizontal Alignment}
\section{Use Safe Verbatim Commands}%
\label{sec:fakeverb}
Due to the limitation of TeX, even if you have passed \texttt{verb} option to a
\texttt{tabularray} table, you still could not use some special characters in a
\verb!\verb! command. As an replacement, you may use \verb|\fakeverb| command from \href{https://www.ctan.org/pkg/codehigh}{\texttt{codehigh}} package.
Due to the limitations of TeX,
we are not able to make \fakeverb{\verb} command behave well inside \texttt{tabularray} tables.
As a replacement, you may use \fakeverb{\fakeverb} command from \href{https://www.ctan.org/pkg/codehigh}{\texttt{codehigh}} package.
The \verb|\fakeverb| command will remove the backslashes in the following control symbols before
typesetting its content: \fakeverb{\\\\}, \fakeverb{\\\{}, \fakeverb{\\\}}, \fakeverb{\\\#}, \fakeverb{\\\^} and \texttt{\textbackslash\textvisiblespace}, \fakeverb{\\\%}.
Expand Down
1 change: 0 additions & 1 deletion testfiles/verb-001.md5

This file was deleted.

Binary file removed testfiles/verb-001.png
Binary file not shown.
40 changes: 0 additions & 40 deletions testfiles/verb-001.tex

This file was deleted.

20 changes: 0 additions & 20 deletions testfiles/verb-001.tlg

This file was deleted.

0 comments on commit d7a818c

Please sign in to comment.