longtable 正常,但 longtblr 对完全相同的内容给出错误。为什么?

longtable 正常,但 longtblr 对完全相同的内容给出错误。为什么?

我尝试了一下longtblr,发现它出现了错误。longtable在相同的输入下工作正常。

第一次尝试longtblr。是否需要执行某些操作才能longtblr处理相同的输入?

\documentclass[12pt]{book}
\usepackage{breqn}
\usepackage{amsmath}
\DeclareMathOperator{\arctanh}{arctanh}
\usepackage{tabularray}

\begin{document}

\begin{longtblr}{|p{0.4in}|p{2in}|p{4in}|}\hline
\# & ODE & solution \\\hline
92&
A
&
{\small 
\begin{dmath*}
-\ln \left(\frac{y \left(x \right)}{x}\right)+\arctanh \left(\frac{1}{\sqrt{\frac{y \left(x \right)^{2}}{x^{2}}+1}}\right)-\ln \left(x \right)-c_{1} = 0
\end{dmath*}
Verified OK. \verb|{0 < x}|
}\\ \hline
\end{longtblr}
\end{document}

现在

>lualatex foo.tex
.....
) (/usr/local/texlive/2022/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
! Missing } inserted.
<inserted text> 
}
l.46 \end
       {longtblr}
? 

比较一下,同一个文件,只是更改 longtblrlongtable,现在可以编译了

\documentclass[12pt]{book}
\usepackage{breqn}
\usepackage{amsmath}
\DeclareMathOperator{\arctanh}{arctanh}
\usepackage{longtable}
\begin{document}    
\begin{longtable}{|p{0.4in}|p{2in}|p{4in}|}\hline
\# & ODE & solution \\\hline
92&
A
&
{\small 
\begin{dmath*}
-\ln \left(\frac{y \left(x \right)}{x}\right)+\arctanh \left(\frac{1}{\sqrt{\frac{y \left(x \right)^{2}}{x^{2}}+1}}\right)-\ln \left(x \right)-c_{1} = 0
\end{dmath*}
Verified OK. \verb|{0 < x}|
}\\ \hline
\end{longtable}
\end{document}

现在

>lualatex foo.tex
(./foo.aux) (/usr/local/texlive/2022/texmf-dist/tex/latex/base/ts1cmr.fd)
(/usr/local/texlive/2022/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/local/texlive/2022/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
Overfull \hbox (108.52753pt too wide) in alignment at lines 35--47
 [][][] 
[1{/usr/local/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./foo.aux))
....
Output written on foo.pdf (1 page, 64594 bytes).
Transcript written on foo.log.
>

没问题。

Linux 上的 TL 2022。

答案1

在此处输入图片描述

与任何抓取环境主体的环境一样,您不能\verb直接使用。tblr有一个verb启用的键\verb,但这显然没有在长版本中设置,所以我\detokenize在这里使用

\documentclass[12pt]{book}
\usepackage{breqn}
\usepackage{amsmath}
\DeclareMathOperator{\arctanh}{arctanh}
\usepackage{tabularray}

\begin{document}


\begin{longtblr}{|p{0.4in}|p{2in}|p{4in}|}\hline
\# & ODE & solution \\\hline
92&
A
&
{\small 
\begin{dmath*}
-\ln \left(\frac{y \left(x \right)}{x}\right)+\arctanh \left(\frac{1}{\sqrt{\frac{y \left(x \right)^{2}}{x^{2}}+1}}\right)-\ln \left(x \right)-c_{1} = 0
\end{dmath*}
Verified OK. \texttt{\detokenize{{0 < x}}}
}\\ \hline
\end{longtblr}
\end{document}

相关内容