0

I'm pretty new to using LaTex and currently I'm trying to use longtable in my document.

This is the code from @Zarko in this article :

\documentclass{article}
\usepackage[a5paper, margin=10mm]{geometry} % a6paper?
\usepackage{lipsum}

\usepackage{enumitem}
\newlist{tabenum}{enumerate}{1}% <-- defined new enumerate list
\setlist[tabenum]{nosep,
    label*=\textbf{\alph*)},
    wide,
    before=\begin{minipage}[t]{\hsize},% <---
        after=\end{minipage}}
\usepackage{newtxtext}
\usepackage{microtype}
\usepackage{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{varwidth}  % <===


\begin{document}
    \begingroup
        \SetTblrStyle{caption}{font=\footnotesize}
        \SetTblrStyle{contfoot-text}{font=\footnotesize\itshape, fg=gray2}
    
    \begin{longtblr}[
        caption = {Long Long Long Tabular},
        label = {tblr:test},
        ]{
            hlines, vlines,
            colspec = {c X[j]X[j]X[j] X[j]},
            colsep = 3pt,
            rowhead = 1,
            rows = {font=\footnotesize},
            row{1} = {font=\footnotesize\bfseries, m},
            rowsep = 1pt,
            measure = vbox,
        }
        {Pap. No.}  &   {Paper Title/\\Description}
        &   {What data sets\\ was it tested on} 
        &   Methodology 
        &   {Strengths and\\ Weaknesses}
        \\ 
        % table body
        1   &   HOTR: End-to-End Human-Object Interaction Detection with Transformers (2021)
        &   \begin{tabenum} 
            \item   Tested on V-COCO and HICO-DET.
            \item   Achieved results that showed it was 5x faster than other models as of publication. See the table \ref{tab: tableStats}
        \end{tabenum}
        &   The methodology used was to improve on the DETR paper \cite{HOI_DETR_basisofHOTR_carion_massa}. It used transformers and parallel interaction and instance query decoders. 1 shared encoder.  Loss function that matches the predicted interactions with the ground truth (replacing post processing step) mechanisms of transformers makes the model exploit the contextual relationships between human and object and their interactions. This allows for higher-level scene understanding.
        &   The strength of this paper was that it's end-to-end and parallel HOI detector model. The model however performed worse in comparison to other models for areas like rare data.
        \\
        2   &   Human-Object Interaction Detection: A Quick Survey and Examination of Methods  (2020)
        &   \begin{tabenum}
            \item   A few datasets were used by the papers described in the survey, including the popular HICO-DET, MS-COCO and V-COCO.
            \item   Paper was methological in reviewing the various models in the HOI scene. The models were split into 2 categories - multi stream and graphical models. Of course some models are novel and don't fall under these explicitly (and weren't included in this survey) but most of them are under these categories.
        \end{tabenum}
        &   Multi-stream models took into account the various elements that made up the scene. For example, there would be streams for the human, for the action and for the object. In piecing together the trio, the model is able to guess what is the HOI occuring in the scene. Graphical methods bounced off nodes in the graph to `strengthen` the relationship between a human and the object. At the end of the computations, the relationship with the strongest co-relation value would be chosen as the final guess for what the HOI in that scene was.
        & This is a review so there is no explicit strength and weaknesses of the review paper.                                                                                           \\
        3   &   Parallel Detection for Efficient Video Analytics at the Edge (2021)
        &   This model was tested on only 2 video datasets - ADL-Rundle-6 and ETH-Sunnyday. It wasn't tested on conventional HOI datasets and used edge servers to run the detection in parallel in real-time.
        &   For the methodology, they made use of multi-model detection scheduler and the sequence synchronizer as the key components of the model. These 2 work hand in hand to allow parallel detection processing of numerous input video frames simultaneously. Concurrently, the temporal order of the detection processed frames, as per the original input stream video sequence is maintained.
        &   The strength is that this model is able to detect the HOI interactions very accurately in almost real-time without messing up the sequence of the video or sizeable lag. However the weakness is that this model is only tested on a couple of datasets. So the results obtained could be purely contextual or only applicable to these datasets.                                                                                            \\  
        4   &   QAHOI: Query-Based Anchors for Human-Object Interaction Detection (2021)
        &   \begin{tabenum}
            \item   Take one year swap and run it with IM.
            \item   Take the same swap and run it without IM. 
        \end{tabenum}\medskip
        \emph{Note}: Please use CVA closeout model in both cases.
        &   With IM graph should start higher, converging into without IM towards expiry.
        &   The same result can be implied from already run test cases.                                                                                           \\ 
        5   & Swap with IM and without IM                                         
        &   \begin{tabenum}
            \item   Take one year swap and run it with IM. 
            \item   Take the same swap and run it without IM. 
        \end{tabenum}\medskip
        \emph{Note}: Please use CVA closeout model in both cases.
        &   With IM graph should start higher, converging into without IM towards expiry.                                                                   &   The same result can be implied from already run test cases.                                                                                           \\
        6   & Swap with IM and without IM        
        &   \begin{tabenum}
            \item   Take one year swap and run it with IM.
            \item   Take the same swap and run it without IM. 
        \end{tabenum}\medskip
        \emph{Note}: Please use CVA closeout model in both cases.
        &   With IM graph should start higher, converging into without IM towards expiry.  
        &   The same result can be implied from already run test cases. \
        \\
        7   &   Swap with IM and without IM                                         
        &   \begin{tabenum}
            \item   Take one year swap and run it with IM.
            \item   Take the same swap and run it without IM.            \end{tabenum}\medskip
        \emph{Note}: Please use CVA closeout model in both cases.           
        &   With IM graph should start higher, converging into without IM towards expiry. 
        &   The same result can be implied from already run test cases.
        \\
        8   &   Swap with IM and without IM                                         
        &   \begin{tabenum}
            \item   Take one year swap and run it with IM.
            \item   Take the same swap and run it without IM.            \end{tabenum}\medskip
        \emph{Note}: Please use CVA closeout model in both cases.           
        &   With IM graph should start higher, converging into without IM towards expiry. 
        &   The same result can be implied from already run test cases.
        \\
    \end{longtblr}
    \endgroup
\end{document}

However I keep getting red lines and compile errors everywhere, but I can't seem to find the reason why - the syntax looks correct to me :(

Could someone help advise on this? Thank youErrors when compiling

7
  • well the first error is "undefined control sequence \SetTblrStyle", so probably your version of tabularray doesn't define this. It works for me, is your tex system up-to-date? Mar 18 at 13:46
  • 1
    texstudio is not related to this error that is just the editor that you are using to write the source file.What matters is the tex system you installed. (miktex or texlive) (also you tagged this longtable which is a different package to tabularray and you are not using that. Mar 18 at 14:21
  • 1
    texlive from tug or texlive from a linux distrib (they have different update systems) but in genrral we would not have to ask these things if you showed the log file of your example program in a text block, it is impossible to debug error messages shown as an image. Mar 18 at 14:45
  • 1
    "undefined control sequence" errors often mean that something is wrong with your preambles, and not necessarily where the error first shows. Have you tried compiling the code exactly as you have copy pasted it here, or is an extract from a larger file? Because it compiles as is for me.
    – cktai
    Mar 18 at 14:59
  • 1
    As I see, code in question is copy from my answer on your previous question. I test my answer by recent tabularray package version (2022A). However I don't see any reason that proposed solution will not work with older tabularray version (for example 2021Q) too. BTW, in would be nice if you mention that your code is from my answer. Anyway, try to update your tabularray installation. Do you have installed tabularray package?
    – Zarko
    Mar 18 at 16:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.