2

When I use longtblr with a long table, when it reaches line 140, the pdf file is generated normally, but from line 140 onwards an error appears: "Bad register code (32768)." I think it's because of the memory overflow.

Please help me with this code?

P/s: I can only illustrate with 4 lines in the table, because stackexchange's limit does not allow text to be longer than 30000 characters.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T5]{fontenc}
\usepackage{parskip}
\usepackage{amsmath}
\usepackage{setspace}
\usepackage[fontsize=14pt]{scrextend}
\usepackage[paperheight=21cm,paperwidth=29.7cm,right=1cm,left=1cm,top=1cm,bottom=1cm]{geometry}
\usepackage{mathptmx}
\usepackage{ulem}
\renewcommand{\ULdepth}{6pt}
\renewcommand{\ULthickness}{1pt}
\usepackage{tabularx}
\usepackage{tabularray}
\usepackage{pdflscape}
\usepackage{array}
\usepackage{indentfirst}
\setlength{\parindent}{1.27cm}
\renewcommand{\baselinestretch}{1}
\usepackage{ragged2e}
\justifying
\setlength{\parskip}{6pt}
\thispagestyle{empty}
\pagenumbering{gobble}
\renewcommand{\headrulewidth}{0pt}
\pagestyle{fancy}

\begin{document}

    \DefTblrTemplate{contfoot-text}{default}{}
    \DefTblrTemplate{conthead-text}{default}{}
    \DefTblrTemplate{caption}{default}{}
    \DefTblrTemplate{conthead}{default}{}
    \DefTblrTemplate{capcont}{default}{}

    \SetTblrInner{rowsep=0pt}
    \noindent
    \begin{longtblr}{width=1\linewidth,rowhead=1,rowhead=2, rowhead=3, hlines,vlines,
        colspec={X[0.5,c] X[1.7,c] X[1.7,c] X[1.7,c] X[1,c] X[2,c] X[1.3,c] X[1.3,c] X[1.3,c] X[1.3,c]X[1.3,c]},
        colsep=6pt,
        rowsep=3pt,
        rows={font=\small,m},
        row{1,2,3}={c,font=\small\bfseries}}
        \SetCell[r= 2]{c} STT & \SetCell[r= 2]{c}  Tên cơ sở bán lẻ   & \SetCell[r= 2]{c}   Người chịu trách nhiệm chuyên môn & \SetCell[r= 2]{c}  CMT người chịu trách nhiệm chuyên môn & \SetCell[r= 2]{c}  Trình độ chuyên môn & \SetCell[r= 2]{c}   Địa chỉ                                        & \SetCell[c= 2]{c}  {GCN đủ điều kiện                                            \\kinh doanh dược} &          & \SetCell[c= 3]{c}  {GCN đạt \\Thực hành tốt cơ sở bán lẻ thuốc} & &  \\

                              &                                       &                                                      &                                                          &                                        &                                                                   & Số                                   & Ngày cấp & Số  & Ngày cấp & Ngày hết hạn \\
        (1)                   & (2)                                   & (3)                                                  & (4)                                                      & (5)                                    & (6)                                                               & (7)                                  & (8)      & (9) & (10)     & (11)         \\
        % *****************************************?
        1                     & Nhà thuốc Yến Nhi                     & Nguyễn Thị Huyền Tâm                                 & 135 558 971                                              & Dược sỹ đại học                        & 289 đường Lê Duẩn, Liên Bảo, Vĩnh Yên, Vĩnh Phúc                  & {00189/                                                                         \\ĐKKDD-VP}&10/12/2019&00189/GPP&10/12/2019&10/12/2022\\
        2                     & Nhà thuốc Nguyễn Văn Mừng             & Nguyễn Văn Mừng                                      & 135 825 977                                              & Dược sỹ đại học                        & Khuôn viên BV 109, Tô Hiến Thành, Đồng Tâm, Vĩnh Yên, Vĩnh Phúc   & {00188/                                                                         \\ĐKKDD-VP}&10/12/2019&00188/GPP&10/12/2019&10/12/2022\\
        3                     & Quầy thuốc số 57 Nguyễn Công Sang     & Nguyễn Công Sang                                     & 0260 8500 2968                                           & Dược sỹ trung cấp                      & Phú Nông, Kim Xá, Vĩnh Tường, Vĩnh Phúc                           & {0756/                                                                          \\ĐKKDD-VP}&30/12/2019&0756/GPP&30/12/2019&30/12/2022\\
        4                     & Quầy thuốc số 12 Nguyễn Thị Xuân      & Nguyễn Thị Xuân                                      & 135 741 211                                              & Dược sỹ trung cấp                      & Khu 7, Vũ Di, Vĩnh Tường, Vĩnh Phúc                               & {0755/                                                                          \\ĐKKDD-VP}&30/12/2019&0755/GPP&30/12/2019&30/12/2022\\    
            \end{longtblr}

\end{document}
3
  • 1
    tabularray uses l3regex to split the body, and that can't handle text that is longer 32732 tokens (with lualatex a bit more). That is a hard limit and means that the size of tabulars it can handles are restricted. Use longtable instead. Commented Aug 20, 2022 at 10:11
  • 1
    Your code is bad. It uses \pagestyle{fancy} without \usepackage{fancy}, so it cannot compile. Although fancy is irrelevant for this example it shows that this is NOT the code of your document. Commented Aug 20, 2022 at 14:25
  • Just like @UlrikeFischer said, I had to split my big board into two small boards and the code worked again! Thank you!
    – tungsondkh
    Commented Aug 20, 2022 at 15:02

1 Answer 1

7

tabularray uses l3regex to split the body. l3regex can't handle text that is longer 32732 tokens (more with lualatex, but still a finite number). That is a hard limit and it means that the size of tabulars tabularray can handle is restricted. Either split your table or use longtable instead.

1
  • Always very good.
    – Sebastiano
    Commented Aug 20, 2022 at 17:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .