3

I am a beginner with LaTeX. I know this question have been asked a couple of times already, but I did not manage to make it work.

%By default, CURRENTLY TWO-SIDED DOCUMENT! 

\documentclass[12pt, a4paper]{book}
%Packages
\usepackage{graphicx}
\usepackage[a4paper, left=1in, top=1in,right=1in,bottom=1in]{geometry}
\usepackage{setspace} 
\graphicspath{{images/}}
\usepackage{emptypage}
\usepackage{hyperref}
\usepackage[labelfont=bf]{caption}
\usepackage{indentfirst}
\usepackage{array}
\usepackage{longtable}

\usepackage[style=apa]{biblatex} %%or authoryear
\addbibresource{MyLibrary.bib} %% add new one updated

\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\hypersetup{colorlinks=true,linkcolor=black,urlcolor=cyan,citecolor=black,}
%\setboolean{@twoside}{false} to put one sided document

\begin{document}
\pagestyle{plain}
\onehalfspacing
\setlength{\parskip}{12pt}


\begin{table}%[hbt!]
\renewcommand{\arraystretch}{1.5}
\centering
\caption[List of siRNA sequences.]{\textbf{List of siRNA sequences.}}
\begin{tabular}{C{0.5cm}C{2cm}C{2cm}C{2cm}C{6.5cm}}

\textbf{\#} & \textbf{Target gene} & \textbf{Ref} & \textbf{Ref single siRNA} &\textbf{Sequence}\\ \hline
1 & Silencer & 4390843 & & proprietary - not disclosed\\ 
2 & Gapd & D-001830-20-20 & & XXXXXXXXXXXXXXXXXXX  / XXXXXXXXXXXXXXXXXXX / XXXXXXXXXXXXXXXXXXX / XXXXXXXXXXXXXXXXXXX\\ 
3 & Atf3 & 4390771 & s62686 & XXXXXXXXXXXXXXXXXXXtt\\
4 & Atf3 & 4390771 & s62688 & XXXXXXXXXXXXXXXXXXXtt\\
5 & Sox11 & 4390771 & s74154 & XXXXXXXXXXXXXXXXXXXtt\\
6 & Sox11 & 4390771 & s202022 & XXXXXXXXXXXXXXXXXXXtt \\
7 & Atf3 & LQ-058604-01-0010, 11910 & J-058604-13 & XXXXXXXXXXXXXXXXXXX\\
8 & Atf3 & LQ-058604-01-0010, 11910 & J-058604-14 & XXXXXXXXXXXXXXXXXXX\\
9 & Atf3 & LQ-058604-01-0010, 11910 & J-058604-15 & XXXXXXXXXXXXXXXXXXX\\
10 & Atf3 & LQ-058604-01-0010, 11910 & J-058604-16 & XXXXXXXXXXXXXXXXXXX\\
11 & Sox11 & LQ-040404-01-0010, 20666 & J-040404-09 & XXXXXXXXXXXXXXXXXXX\\
12 & Sox11 & LQ-040404-01-0010, 20666 & J-040404-10 & XXXXXXXXXXXXXXXXXXX\\
13 & Sox11 & LQ-040404-01-0010, 20666 & J-040404-11 & XXXXXXXXXXXXXXXXXXX\\
14 & Sox11 & LQ-040404-01-0010, 20666 & J-040404-12 & XXXXXXXXXXXXXXXXXXX\\
15 & Tnfrsf12a & LQ-040436-01-0010, 27279 & J-040436-09 & XXXXXXXXXXXXXXXXXXX \\
16 & Tnfrsf12a & LQ-040436-01-0010, 27279 & J-040436-10 & XXXXXXXXXXXXXXXXXXX\\
17 & Tnfrsf12a & LQ-040436-01-0010, 27279 & J-040436-11 & XXXXXXXXXXXXXXXXXXX\\
18 & Tnfrsf12a & LQ-040436-01-0010, 27279 & J-040436-12 & XXXXXXXXXXXXXXXXXXX\\
19 & Gadd45a & LQ-042505-00-0010, 13197 & J-042505-05 & XXXXXXXXXXXXXXXXXXX\\ 
20 & Gadd45a & LQ-042505-00-0010, 13197 & J-042505-06 & XXXXXXXXXXXXXXXXXXX\\
21 & Gadd45a & LQ-042505-00-0010, 13197 & J-042505-07 & XXXXXXXXXXXXXXXXXXX\\
22 & Gadd45a & LQ-042505-00-0010, 13197 & J-042505-08 & XXXXXXXXXXXXXXXXXXX\\
23 & Cdkn1a & LQ-058636-00-0010, 12575 & J-058636-05 & XXXXXXXXXXXXXXXXXXX\\
24 & Cdkn1a & LQ-058636-00-0010, 12575 & J-058636-06 & XXXXXXXXXXXXXXXXXXX\\
25 & Cdkn1a & LQ-058636-00-0010, 12575 & J-058636-07 & XXXXXXXXXXXXXXXXXXX\\
26 & Cdkn1a & LQ-058636-00-0010, 12575 & J-058636-08 & XXXXXXXXXXXXXXXXXXX\\
27 & Fgfr1 & LQ-040832-00-0010, 14182 & J-040832-05 & XXXXXXXXXXXXXXXXXXX\\
28 & Fgfr1 & LQ-040832-00-0010, 14182 & J-040832-06 & XXXXXXXXXXXXXXXXXXX\\
29 & Fgfr1 & LQ-040832-00-0010, 14182 & J-040832-07 & XXXXXXXXXXXXXXXXXXX\\
30 & Fgfr1 & LQ-040832-00-0010, 14182 & J-040832-08 & XXXXXXXXXXXXXXXXXXX\\ 
31 & Ecel1 & LQ-041879-00-0010, 13599 & J-041879-05 & XXXXXXXXXXXXXXXXXXX\\
32 & Ecel1 & LQ-041879-00-0010, 13599 & J-041879-06 & XXXXXXXXXXXXXXXXXXX\\ 
33 & Ecel1 & LQ-041879-00-0010, 13599 & J-041879-07 & XXXXXXXXXXXXXXXXXXX\\ 
34 & Ecel1 & LQ-041879-00-0010, 13599 & J-041879-08 & XXXXXXXXXXXXXXXXXXX\\
  \hline
\end{tabular}
\label{tab:siRNAseq}
\end{table}

%references


\end{document}

This is the code I have. When I compile it, only 14 lines are displayed out of the 34, and the line 14 is at the very bottom of this page. Ideally, I would like to split the table on multiple pages. I cannot really give more details since it is the first document I ever produced using Latex.

Many thanks in advance for your precious help. Regards, Alex

2
  • 1
    Welcome to TeX.SE.
    – Mico
    Nov 13, 2023 at 21:11
  • 1
    Off-topic: left=1in,top=1in,right=1in,bottom=1in may be expressed more succinctly as margin=1in.
    – Mico
    Nov 13, 2023 at 21:18

3 Answers 3

4

(updated the answer to switch from a longtable setup to a tabularx setup)

If you eliminate the line breaks in columns 2, 3, and 4, you can typeset the entire table on a single page.

The following solution employs a table/tabularx combination, with a target width of \textwidth; it employs the X column type for the final column. I would also typeset the material in the final column in a monospaced font. Separately, I'd impose some visual grouping on the table's contents by inserting \addlinespace directive for each group of target genes.

enter image description here

\documentclass[12pt,a4paper]{book}
%Packages
\usepackage{graphicx}
\usepackage[margin=1in]{geometry}
\usepackage{setspace} 
\usepackage{hyperref}
\hypersetup{colorlinks,linkcolor=black,urlcolor=cyan,citecolor=black}

\usepackage[font=bf]{caption}
\usepackage{indentfirst}

% New code
\usepackage{tabularx} % for 'tabularx' env. and 'X' column type
\usepackage{ragged2e} % for '\RaggedRight' macro
\usepackage{booktabs} % for well-spaced horizontal rules and  '\addlinespace' macro
\newcolumntype{L}[1]{>{\RaggedRight}p{#1}} % suppress full justification

\begin{document}

\pagestyle{plain}
\onehalfspacing
%\setlength{\parskip}{12pt} % bad idea

\begin{table}[p] % place table on a page by itself
\caption{List of siRNA sequences.}
\label{tab:siRNAseq}

\begin{tabularx}{\textwidth}{@{} 
     r L{2cm} l L{2.25cm} >{\ttfamily}X @{}}

\# & Target gene & Ref & Ref single siRNA & \textrm{Sequence}\\ 
\midrule

1  & Silencer  & 4390843 & & \textrm{proprietary, not disclosed}\\ 
\addlinespace
2  & Gapd      & D-001830-20-20 & & 
   XXXXXXXXXXXXXXXXXXX / 
   XXXXXXXXXXXXXXXXXXX / 
   XXXXXXXXXXXXXXXXXXX /
   XXXXXXXXXXXXXXXXXXX \\ 
\addlinespace
3  & Atf3      & 4390771                  & s62686      & XXXXXXXXXXXXXXXXXXXtt\\
4  & Atf3      & 4390771                  & s62688      & XXXXXXXXXXXXXXXXXXXtt\\
\addlinespace
5  & Sox11     & 4390771                  & s74154      & XXXXXXXXXXXXXXXXXXXtt\\
6  & Sox11     & 4390771                  & s202022     & XXXXXXXXXXXXXXXXXXXtt\\ 
\addlinespace
7  & Atf3      & LQ-058604-01-0010, 11910 & J-058604-13 & XXXXXXXXXXXXXXXXXXX\\
8  & Atf3      & LQ-058604-01-0010, 11910 & J-058604-14 & XXXXXXXXXXXXXXXXXXX\\
9  & Atf3      & LQ-058604-01-0010, 11910 & J-058604-15 & XXXXXXXXXXXXXXXXXXX\\
10 & Atf3      & LQ-058604-01-0010, 11910 & J-058604-16 & XXXXXXXXXXXXXXXXXXX\\ 
\addlinespace
11 & Sox11     & LQ-040404-01-0010, 20666 & J-040404-09 & XXXXXXXXXXXXXXXXXXX\\
12 & Sox11     & LQ-040404-01-0010, 20666 & J-040404-10 & XXXXXXXXXXXXXXXXXXX\\
13 & Sox11     & LQ-040404-01-0010, 20666 & J-040404-11 & XXXXXXXXXXXXXXXXXXX\\
14 & Sox11     & LQ-040404-01-0010, 20666 & J-040404-12 & XXXXXXXXXXXXXXXXXXX\\ 
\addlinespace
15 & Tnfrsf12a & LQ-040436-01-0010, 27279 & J-040436-09 & XXXXXXXXXXXXXXXXXXX\\
16 & Tnfrsf12a & LQ-040436-01-0010, 27279 & J-040436-10 & XXXXXXXXXXXXXXXXXXX\\
17 & Tnfrsf12a & LQ-040436-01-0010, 27279 & J-040436-11 & XXXXXXXXXXXXXXXXXXX\\
18 & Tnfrsf12a & LQ-040436-01-0010, 27279 & J-040436-12 & XXXXXXXXXXXXXXXXXXX\\ 
\addlinespace
19 & Gadd45a   & LQ-042505-00-0010, 13197 & J-042505-05 & XXXXXXXXXXXXXXXXXXX\\ 
20 & Gadd45a   & LQ-042505-00-0010, 13197 & J-042505-06 & XXXXXXXXXXXXXXXXXXX\\
21 & Gadd45a   & LQ-042505-00-0010, 13197 & J-042505-07 & XXXXXXXXXXXXXXXXXXX\\
22 & Gadd45a   & LQ-042505-00-0010, 13197 & J-042505-08 & XXXXXXXXXXXXXXXXXXX\\ 
\addlinespace
23 & Cdkn1a    & LQ-058636-00-0010, 12575 & J-058636-05 & XXXXXXXXXXXXXXXXXXX\\
24 & Cdkn1a    & LQ-058636-00-0010, 12575 & J-058636-06 & XXXXXXXXXXXXXXXXXXX\\
25 & Cdkn1a    & LQ-058636-00-0010, 12575 & J-058636-07 & XXXXXXXXXXXXXXXXXXX\\
26 & Cdkn1a    & LQ-058636-00-0010, 12575 & J-058636-08 & XXXXXXXXXXXXXXXXXXX\\ 
\addlinespace
27 & Fgfr1     & LQ-040832-00-0010, 14182 & J-040832-05 & XXXXXXXXXXXXXXXXXXX\\
28 & Fgfr1     & LQ-040832-00-0010, 14182 & J-040832-06 & XXXXXXXXXXXXXXXXXXX\\
29 & Fgfr1     & LQ-040832-00-0010, 14182 & J-040832-07 & XXXXXXXXXXXXXXXXXXX\\
30 & Fgfr1     & LQ-040832-00-0010, 14182 & J-040832-08 & XXXXXXXXXXXXXXXXXXX\\ 
\addlinespace 
31 & Ecel1     & LQ-041879-00-0010, 13599 & J-041879-05 & XXXXXXXXXXXXXXXXXXX\\
32 & Ecel1     & LQ-041879-00-0010, 13599 & J-041879-06 & XXXXXXXXXXXXXXXXXXX\\ 
33 & Ecel1     & LQ-041879-00-0010, 13599 & J-041879-07 & XXXXXXXXXXXXXXXXXXX\\ 
34 & Ecel1     & LQ-041879-00-0010, 13599 & J-041879-08 & XXXXXXXXXXXXXXXXXXX\\
\bottomrule
\end{tabularx}
\end{table}

\end{document}
3
  • 1
    Many thanks Mico, it was very useful. For your information, I edited your reply to remove some data. But the idea remains here. Thanks
    – KrKAlex
    Nov 14, 2023 at 18:06
  • 1
    @KrKAlex Note most data is never really deleted on this site. The history of edits to every post is always kept. So, you should always make sure that you don't post sensible data in the first place. Nov 14, 2023 at 19:45
  • Thank you @JasperHabicht, I understand my mistake indeed, and tried to "repair" it as much as I could.
    – KrKAlex
    Nov 15, 2023 at 7:26
3

You're wasting precious space with the long headers, which can be split across lines.

For the last column, I like Mico's idea to print the sequence in monospaced type, which guarantees alignment. The first entry is in normal font (smaller).

The last column is declared of type p with the length determined in advance from the longest sequences.

This makes the table to fit in the width.

\documentclass[12pt, a4paper]{book}
%Packages
\usepackage{graphicx}
\usepackage[a4paper, left=1in, top=1in,right=1in,bottom=1in]{geometry}
\usepackage{setspace} 
\graphicspath{{images/}}
\usepackage{emptypage}
\usepackage{hyperref}
\usepackage[labelfont=bf]{caption}
\usepackage{indentfirst}
\usepackage{array}
\usepackage{longtable}
\usepackage{ltxtable}
\usepackage{longtable}
\usepackage{tabularx}

\usepackage[style=apa]{biblatex} %%or authoryear
\addbibresource{MyLibrary.bib} %% add new one updated

\hypersetup{colorlinks=true,linkcolor=black,urlcolor=cyan,citecolor=black,}
%\setboolean{@twoside}{false} to put one sided document

\newlength{\sequencelength}

\pagestyle{plain}
\onehalfspacing
%\setlength{\parskip}{12pt} % Don't! Really, don't! You only waste space

\begin{document}

\begingroup

\settowidth{\sequencelength}{\ttfamily AGAGGAACCUCUUUAUCCAtt}

\begin{longtable}{|c|c|c|c|>{\raggedright\ttfamily\arraybackslash}p{\sequencelength}|}
\caption{List of siRNA sequences.}\label{tab:siRNAseq}
 \\
\hline
\# &
\begin{tabular}[t]{@{}c@{}} Target \\ gene \end{tabular} &
Ref & 
\begin{tabular}[t]{@{}c@{}} Ref single \\ siRNA \end{tabular} &
\multicolumn{1}{c|}{Sequence} \\
\hline
\endfirsthead
\hline
\# &
\begin{tabular}[t]{@{}c@{}} Target \\ gene \end{tabular} &
Ref & 
\begin{tabular}[t]{@{}c@{}} Ref single \\ siRNA \end{tabular} &
\multicolumn{1}{c|}{Sequence} \\
\hline
\endhead
\hline
\endfoot
    % Your table data goes here
    1 & Silencer & 4390843 & & \normalfont\footnotesize proprietary -- not disclosed\\ 
    2 & Gapd & D-001830-20-20 & & XXXXXXXXXXXXXXXXXXX  / XXXXXXXXXXXXXXXXXXX / XXXXXXXXXXXXXXXXXXX / XXXXXXXXXXXXXXXXXXX\\ 
    3 & Atf3 & 4390771 & s62686 & XXXXXXXXXXXXXXXXXXXtt\\
    4 & Atf3 & 4390771 & s62688 & XXXXXXXXXXXXXXXXXXXtt\\
    5 & Sox11 & 4390771 & s74154 & XXXXXXXXXXXXXXXXXXXtt\\
    6 & Sox11 & 4390771 & s202022 & XXXXXXXXXXXXXXXXXXXtt \\
    7 & Atf3 & LQ-058604-01-0010, 11910 & J-058604-13 & XXXXXXXXXXXXXXXXXXX\\
    8 & Atf3 & LQ-058604-01-0010, 11910 & J-058604-14 & XXXXXXXXXXXXXXXXXXX\\
    9 & Atf3 & LQ-058604-01-0010, 11910 & J-058604-15 & XXXXXXXXXXXXXXXXXXX\\
    10 & Atf3 & LQ-058604-01-0010, 11910 & J-058604-16 & XXXXXXXXXXXXXXXXXXX\\
    11 & Sox11 & LQ-040404-01-0010, 20666 & J-040404-09 & XXXXXXXXXXXXXXXXXXX\\
    12 & Sox11 & LQ-040404-01-0010, 20666 & J-040404-10 & XXXXXXXXXXXXXXXXXXX\\
    13 & Sox11 & LQ-040404-01-0010, 20666 & J-040404-11 & XXXXXXXXXXXXXXXXXXX\\
    14 & Sox11 & LQ-040404-01-0010, 20666 & J-040404-12 & XXXXXXXXXXXXXXXXXXX\\
    15 & Tnfrsf12a & LQ-040436-01-0010, 27279 & J-040436-09 & XXXXXXXXXXXXXXXXXXX \\
    16 & Tnfrsf12a & LQ-040436-01-0010, 27279 & J-040436-10 & XXXXXXXXXXXXXXXXXXX\\
    17 & Tnfrsf12a & LQ-040436-01-0010, 27279 & J-040436-11 & XXXXXXXXXXXXXXXXXXX\\
    18 & Tnfrsf12a & LQ-040436-01-0010, 27279 & J-040436-12 & XXXXXXXXXXXXXXXXXXX\\
    19 & Gadd45a & LQ-042505-00-0010, 13197 & J-042505-05 & XXXXXXXXXXXXXXXXXXX\\ 
    20 & Gadd45a & LQ-042505-00-0010, 13197 & J-042505-06 & XXXXXXXXXXXXXXXXXXX\\
    21 & Gadd45a & LQ-042505-00-0010, 13197 & J-042505-07 & XXXXXXXXXXXXXXXXXXX\\
    22 & Gadd45a & LQ-042505-00-0010, 13197 & J-042505-08 & XXXXXXXXXXXXXXXXXXX\\
    23 & Cdkn1a & LQ-058636-00-0010, 12575 & J-058636-05 & XXXXXXXXXXXXXXXXXXX\\
    24 & Cdkn1a & LQ-058636-00-0010, 12575 & J-058636-06 & XXXXXXXXXXXXXXXXXXX\\
    25 & Cdkn1a & LQ-058636-00-0010, 12575 & J-058636-07 & XXXXXXXXXXXXXXXXXXX\\
    26 & Cdkn1a & LQ-058636-00-0010, 12575 & J-058636-08 & XXXXXXXXXXXXXXXXXXX\\
    27 & Fgfr1 & LQ-040832-00-0010, 14182 & J-040832-05 & XXXXXXXXXXXXXXXXXXX\\
    28 & Fgfr1 & LQ-040832-00-0010, 14182 & J-040832-06 & XXXXXXXXXXXXXXXXXXX\\
    29 & Fgfr1 & LQ-040832-00-0010, 14182 & J-040832-07 & XXXXXXXXXXXXXXXXXXX\\
    30 & Fgfr1 & LQ-040832-00-0010, 14182 & J-040832-08 & XXXXXXXXXXXXXXXXXXX\\ 
    31 & Ecel1 & LQ-041879-00-0010, 13599 & J-041879-05 & XXXXXXXXXXXXXXXXXXX\\
    32 & Ecel1 & LQ-041879-00-0010, 13599 & J-041879-06 & XXXXXXXXXXXXXXXXXXX\\ 
    33 & Ecel1 & LQ-041879-00-0010, 13599 & J-041879-07 & XXXXXXXXXXXXXXXXXXX\\ 
    34 & Ecel1 & LQ-041879-00-0010, 13599 & J-041879-08 & XXXXXXXXXXXXXXXXXXX\\
\end{longtable}
\endgroup

%references


\end{document}

enter image description here

If you switch to \footnotesize (and to \scriptsize for the textual entry in the last column) you don't even need longtable and a standard \begin{table}[p] will suffice.

enter image description here

For completeness, I show what you get in this case with a more open look.

\documentclass[12pt, a4paper]{book}
%Packages
\usepackage[a4paper, left=1in, top=1in,right=1in,bottom=1in]{geometry}
\usepackage{array}
\usepackage{booktabs}
\usepackage{caption}

\newlength{\sequencelength}

\pagestyle{plain}

\begin{document}

\begin{table}[p]
\centering\small
\settowidth{\sequencelength}{\ttfamily AGAGGAACCUCUUUAUCCAtt}

\caption{List of siRNA sequences.}\label{tab:siRNAseq}

\begin{tabular}{@{}cccc>{\raggedright\ttfamily\arraybackslash}p{\sequencelength}@{}}
\toprule
\# &
\begin{tabular}[t]{@{}c@{}} Target \\ gene \end{tabular} &
Ref & 
\begin{tabular}[t]{@{}c@{}} Ref single \\ siRNA \end{tabular} &
\multicolumn{1}{c}{Sequence} \\
\midrule
    % Your table data goes here
    1 & Silencer & 4390843 & & \normalfont\footnotesize proprietary -- not disclosed\\ 
    2 & Gapd & D-001830-20-20 & & XXXXXXXXXXXXXXXXXXX  / XXXXXXXXXXXXXXXXXXX / XXXXXXXXXXXXXXXXXXX / XXXXXXXXXXXXXXXXXXX\\ 
    3 & Atf3 & 4390771 & s62686 & XXXXXXXXXXXXXXXXXXXtt\\
    4 & Atf3 & 4390771 & s62688 & XXXXXXXXXXXXXXXXXXXtt\\
    5 & Sox11 & 4390771 & s74154 & XXXXXXXXXXXXXXXXXXXtt\\
    6 & Sox11 & 4390771 & s202022 & XXXXXXXXXXXXXXXXXXXtt \\
    7 & Atf3 & LQ-058604-01-0010, 11910 & J-058604-13 & XXXXXXXXXXXXXXXXXXX\\
    8 & Atf3 & LQ-058604-01-0010, 11910 & J-058604-14 & XXXXXXXXXXXXXXXXXXX\\
    9 & Atf3 & LQ-058604-01-0010, 11910 & J-058604-15 & XXXXXXXXXXXXXXXXXXX\\
    10 & Atf3 & LQ-058604-01-0010, 11910 & J-058604-16 & XXXXXXXXXXXXXXXXXXX\\
    11 & Sox11 & LQ-040404-01-0010, 20666 & J-040404-09 & XXXXXXXXXXXXXXXXXXX\\
    12 & Sox11 & LQ-040404-01-0010, 20666 & J-040404-10 & XXXXXXXXXXXXXXXXXXX\\
    13 & Sox11 & LQ-040404-01-0010, 20666 & J-040404-11 & XXXXXXXXXXXXXXXXXXX\\
    14 & Sox11 & LQ-040404-01-0010, 20666 & J-040404-12 & XXXXXXXXXXXXXXXXXXX\\
    15 & Tnfrsf12a & LQ-040436-01-0010, 27279 & J-040436-09 & XXXXXXXXXXXXXXXXXXX \\
    16 & Tnfrsf12a & LQ-040436-01-0010, 27279 & J-040436-10 & XXXXXXXXXXXXXXXXXXX\\
    17 & Tnfrsf12a & LQ-040436-01-0010, 27279 & J-040436-11 & XXXXXXXXXXXXXXXXXXX\\
    18 & Tnfrsf12a & LQ-040436-01-0010, 27279 & J-040436-12 & XXXXXXXXXXXXXXXXXXX\\
    19 & Gadd45a & LQ-042505-00-0010, 13197 & J-042505-05 & XXXXXXXXXXXXXXXXXXX\\ 
    20 & Gadd45a & LQ-042505-00-0010, 13197 & J-042505-06 & XXXXXXXXXXXXXXXXXXX\\
    21 & Gadd45a & LQ-042505-00-0010, 13197 & J-042505-07 & XXXXXXXXXXXXXXXXXXX\\
    22 & Gadd45a & LQ-042505-00-0010, 13197 & J-042505-08 & XXXXXXXXXXXXXXXXXXX\\
    23 & Cdkn1a & LQ-058636-00-0010, 12575 & J-058636-05 & XXXXXXXXXXXXXXXXXXX\\
    24 & Cdkn1a & LQ-058636-00-0010, 12575 & J-058636-06 & XXXXXXXXXXXXXXXXXXX\\
    25 & Cdkn1a & LQ-058636-00-0010, 12575 & J-058636-07 & XXXXXXXXXXXXXXXXXXX\\
    26 & Cdkn1a & LQ-058636-00-0010, 12575 & J-058636-08 & XXXXXXXXXXXXXXXXXXX\\
    27 & Fgfr1 & LQ-040832-00-0010, 14182 & J-040832-05 & XXXXXXXXXXXXXXXXXXX\\
    28 & Fgfr1 & LQ-040832-00-0010, 14182 & J-040832-06 & XXXXXXXXXXXXXXXXXXX\\
    29 & Fgfr1 & LQ-040832-00-0010, 14182 & J-040832-07 & XXXXXXXXXXXXXXXXXXX\\
    30 & Fgfr1 & LQ-040832-00-0010, 14182 & J-040832-08 & XXXXXXXXXXXXXXXXXXX\\ 
    31 & Ecel1 & LQ-041879-00-0010, 13599 & J-041879-05 & XXXXXXXXXXXXXXXXXXX\\
    32 & Ecel1 & LQ-041879-00-0010, 13599 & J-041879-06 & XXXXXXXXXXXXXXXXXXX\\ 
    33 & Ecel1 & LQ-041879-00-0010, 13599 & J-041879-07 & XXXXXXXXXXXXXXXXXXX\\ 
    34 & Ecel1 & LQ-041879-00-0010, 13599 & J-041879-08 & XXXXXXXXXXXXXXXXXXX\\
\bottomrule
\end{tabular}

\end{table}

\end{document}

enter image description here

2
  • Many thanks egreg, it was very useful. For your information, I edited your reply to remove some data. But the idea remains here. Thanks
    – KrKAlex
    Nov 14, 2023 at 18:35
  • 1
    @KrKAlex Fair enough.
    – egreg
    Nov 14, 2023 at 22:07
2

Edit:
Meanwhile OP changes in his/her question the data in the last column. This changes are now reflected in this answer too. Also is added the image of case, when table is broken between two pages.

  • Your table can be fit on one page.
  • But for any case if table doesn't start at top of a page and consequently is than broken on two pages, let use long table.
  • For the long table code I suggest to use longtblr of tabularray package. Using it the table code is concise and simple. It can be written as follows:
\documentclass[12pt, a4paper]{book}
\usepackage[margin=1in]{geometry}
%--------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%
\usepackage{lipsum}                             % for dummy text
%---------------------------------------------------------------%
%Packages
\usepackage{setspace}

\usepackage{xcolor}
\usepackage{seqsplit}
\usepackage{tabularray}     % new
\UseTblrLibrary{booktabs}   % new
    \SetTblrStyle{caption}{font=\small}
    \SetTblrStyle{caption-tag}{font=\small\bfseries}
    \SetTblrStyle{contfoot}{font=\footnotesize\itshape}
\ExplSyntaxOn
    \NewChildSelector{eachfour}
    {
    \int_step_inline:nnnn {5}{4}{\l_tblr_childs_total_tl}
          { \clist_put_right:Nn \l_tblr_childs_clist {##1} }
    }
\ExplSyntaxOff


%\usepackage{hyperref}
%\hypersetup{colorlinks, linkcolor=black, urlcolor=cyan, citecolor=black}

\begin{document}
\pagestyle{plain}

\begin{longtblr}[
caption = {List of siRNA sequences.},
  label = {tab:siRNAseq}
                ]{colsep = 4pt, 
                  colspec = {@{} r l l l X[l, font=\ttfamily] @{}},
                  row{1}  = {font=\small\bfseries, l, f},
                  row{2-Y}      = {rowsep=0pt},
                  row{eachfour} = {belowsep=1ex},
                  rowhead = 1 
                  }

    \toprule
\#  &   {Target\\ gene}
                &   Ref                     &   {Ref single\\ siRNA}   
                                                            &   Sequence    \\
    \midrule
% table body
1   & Silencer  & 4390843                   &               & \textrm{proprietary --- not disclosed}\\[1ex]
2   & Gapd      & D-001830-20-20            &               & \seqsplit{XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}
\\[1ex]
3   & Atf3      & 4390771                   & s62686        & XXXXXXXXXXXXXXXXXXXtt \\
4   & Atf3      & 4390771                   & s62688        & XXXXXXXXXXXXXXXXXXXtt \\[2ex]
5   & Sox11     & 4390771                   & s74154        & XXXXXXXXXXXXXXXXXXXtt \\
6   & Sox11     & 4390771                   & s202022       & XXXXXXXXXXXXXXXXXXXtt \\
7   & Atf3      & LQ-058604-01-0010, 11910  & J-058604-13   & XXXXXXXXXXXXXXXXXXX   \\
8   & Atf3      & LQ-058604-01-0010, 11910  & J-058604-14   & XXXXXXXXXXXXXXXXXXX   \\
9   & Atf3      & LQ-058604-01-0010, 11910  & J-058604-15   & XXXXXXXXXXXXXXXXXXX   \\
10  & Atf3      & LQ-058604-01-0010, 11910  & J-058604-16   & XXXXXXXXXXXXXXXXXXX   \\
11  & Sox11     & LQ-040404-01-0010, 20666  & J-040404-09   & XXXXXXXXXXXXXXXXXXX   \\
12  & Sox11     & LQ-040404-01-0010, 20666  & J-040404-10   & XXXXXXXXXXXXXXXXXXX   \\
13  & Sox11     & LQ-040404-01-0010, 20666  & J-040404-11   & XXXXXXXXXXXXXXXXXXX   \\
14  & Sox11     & LQ-040404-01-0010, 20666  & J-040404-12   & XXXXXXXXXXXXXXXXXXX   \\
15  & Tnfrsf12a & LQ-040436-01-0010, 27279  & J-040436-09   & XXXXXXXXXXXXXXXXXXX   \\
16  & Tnfrsf12a & LQ-040436-01-0010, 27279  & J-040436-10   & XXXXXXXXXXXXXXXXXXX   \\
17  & Tnfrsf12a & LQ-040436-01-0010, 27279  & J-040436-11   & XXXXXXXXXXXXXXXXXXX   \\
18  & Tnfrsf12a & LQ-040436-01-0010, 27279  & J-040436-12   & XXXXXXXXXXXXXXXXXXX   \\
19  & Gadd45a   & LQ-042505-00-0010, 13197  & J-042505-05   & XXXXXXXXXXXXXXXXXXX   \\
20  & Gadd45a   & LQ-042505-00-0010, 13197  & J-042505-06   & XXXXXXXXXXXXXXXXXXX   \\
21  & Gadd45a   & LQ-042505-00-0010, 13197  & J-042505-07   & XXXXXXXXXXXXXXXXXXX   \\
22  & Gadd45a   & LQ-042505-00-0010, 13197  & J-042505-08   & XXXXXXXXXXXXXXXXXXX   \\
23  & Cdkn1a    & LQ-058636-00-0010, 12575  & J-058636-05   & XXXXXXXXXXXXXXXXXXX   \\
24  & Cdkn1a    & LQ-058636-00-0010, 12575  & J-058636-06   & XXXXXXXXXXXXXXXXXXX   \\
25  & Cdkn1a    & LQ-058636-00-0010, 12575  & J-058636-07   & XXXXXXXXXXXXXXXXXXX   \\
26  & Cdkn1a    & LQ-058636-00-0010, 12575  & J-058636-08   & XXXXXXXXXXXXXXXXXXX   \\
27  & Fgfr1     & LQ-040832-00-0010, 14182  & J-040832-05   & XXXXXXXXXXXXXXXXXXX   \\
28  & Fgfr1     & LQ-040832-00-0010, 14182  & J-040832-06   & XXXXXXXXXXXXXXXXXXX   \\
29  & Fgfr1     & LQ-040832-00-0010, 14182  & J-040832-07   & XXXXXXXXXXXXXXXXXXX   \\
30  & Fgfr1     & LQ-040832-00-0010, 14182  & J-040832-08   & XXXXXXXXXXXXXXXXXXX   \\
31  & Ecel1     & LQ-041879-00-0010, 13599  & J-041879-05   & XXXXXXXXXXXXXXXXXXX   \\
32  & Ecel1     & LQ-041879-00-0010, 13599  & J-041879-06   & XXXXXXXXXXXXXXXXXXX   \\
33  & Ecel1     & LQ-041879-00-0010, 13599  & J-041879-07   & XXXXXXXXXXXXXXXXXXX   \\
34  & Ecel1     & LQ-041879-00-0010, 13599  & J-041879-08   & XXXXXXXXXXXXXXXXXXX   \\
    \bottomrule
\end{longtblr}

\end{document}

enter image description here

(red lines indicate page layout)

And an example, when your table doesn't start at top of page and then it is consequently split two pages:

enter image description here

8
  • @Mico, as usual you are right. Corrected.
    – Zarko
    Nov 13, 2023 at 23:22
  • Many thanks Zarko, it was very useful. Indeed, there was some information on the page above the table so that ti would not fit on one page. For your information, I edited your reply to remove some data. But the idea remains here. Thanks
    – KrKAlex
    Nov 14, 2023 at 18:41
  • @KrKAlex, I reject your edit of my answer. Other answers still have data which you provide in original question so i not see any reason why they should be changed in my answer. Oher information why is used long table of longtblr type are noted in answer.
    – Zarko
    Nov 14, 2023 at 19:05
  • 1
    @Mico, hm, OP should thinking about showed data when (s)he asked a question ... If (s)he meanwhile change a mind, than (s)he firs correct them in question and than edit answers and add some explanation why is doing so, Anyway, I edited my answer and insert this new dummy data and also show possible view of table when is split between two pages.
    – Zarko
    Nov 15, 2023 at 4:51
  • 1
    @Mico, you are welcome!
    – Zarko
    Nov 15, 2023 at 5:08

You must log in to answer this question.

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