我的论文中有一个表格太长,包含太多信息,当我完成时,表格的位置在页面的右侧,而不是居中。我怎样才能让它在页面中居中?这是代码,表格中的信息被缩短了。在文件中它看起来像这样,表格无法居中。有人能帮帮我吗?(我没有指定特定的字体大小。下面的代码可以在 overleaf 中运行)
您可以通过此链接下载小文件:
https://drive.google.com/file/d/1fJmBBQvIpI4tMdQ2nqrnDbg9cJKPK2X8/view?usp=drive_link
\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx} % Required for inserting images
\usepackage{setspace}% for\doublespacing
\usepackage{indentfirst}% for indent the first line
\usepackage{longtable}
\usepackage{textalpha}
\usepackage{ragged2e}
\begin{document}
\begin{longtable}[c]{| c | c |c | c |c | }
\caption{\centering DUSP Protein or RNA expression in animal and human
brain\label{long3}}\\
\hline
\multicolumn{5}{| c |}{ DUSP Protein or RNA expression in animal and
human brain }\\
\hline
Isoforms & Expression& Protein/ mRNA & Species& Ref.\\
\hline
\endfirsthead
\hline
\multicolumn{5}{|c|}{Continuation of Table \ref{long3}}\\
\hline
Isoforms & Expression& Protein/ mRNA & Species& Ref.\\
\hline
\endhead
\hline
\endfoot
\hline
\multicolumn{5}{| c |}{End of Table}\\
\hline\hline
\endlastfoot
SSH2 & Brain &mRNA& Mice& [4]\\
& Thalamus & & & \\
& Hippocampus & & & \\
SSH3 & Hippocampus &mRNA& Human&[5]\\
& Temporal gyrus & & & \\
& Frontal gyrus & & & \\
&Prefrontal cortex& mRNA& Mice& [6]\\
& Hypothalamus & & & \\
&Amygdala& mRNA& Mice& [7]\\
SSH1 & Frontal cortex & Protein & Human &
\cite{Barone2014InactivationGamma-secretase,Zafar2017Cytoskeleton-
AssociatedDisease}\\
& Cerebellum & & & \\
& Primary cortical neurons& Protein& Mice&
\cite{Barone2014InactivationGamma-secretase}\\
& Ganglion neurons &Protein&
Chick&\cite{Endo2003ControlCofilin}\\
SSH2 & Brain &mRNA& Mice& [4]\\
& Thalamus & & & \\
& Hippocampus & & & \\
SSH3 & Hippocampus &mRNA& Human&[5]\\
& Temporal gyrus & & & \\
& Frontal gyrus & & & \\
&Prefrontal cortex& mRNA& Mice& [6]\\
& Hypothalamus & & & \\
&Amygdala& mRNA& Mice& [7]\\
PRL2 & Cerebellum & mRNA & Human &[8]\\
& Cerebral cortex & & & \\
&Neuronal lineages & mRNA &Zebrafish& [9]\\
CDC14A & Cortical slices& mRNA& Human& [10]\\
& Cerebral cortex& Protein &Human & *[11] \\
hCDC14Bpar& Adult/fetal brain & mRNA& Human & [12]\\
hCDC14B1 & Hippocampus& mRNA & Human &[12]\\
& Prefrontal cortex & & & \\
& Amygdala & & & \\
& Hypothalamus & & & \\
hCDC14B2& Hippocampus& mRNA& Human& [12]\\
& Prefrontal cortex& & & \\
& Amygdala & & & \\
& Hypothalamus & & & \\
hCDC14B3 & Hippocampus &mRNA&Human&[12]\\
& Prefrontal cortex & & & \\
& Amygdala & & & \\
& Hypothalamus & & & \\
hCDC14C & Adult brain & mRNA&Human& [12]\\
& Embryonic forebrain,& & & \\
& Dorsal telencephalon & & & \\
PTENs & Cerebral cortex, & Protein& Human& *[11]\\
& Cerebellum& & & \\
& Hippocampus& & & \\
& Anterior olfactory nucleus & Protein& Rat&[13]\\
& Cerebral cortex & & & \\
& Amygdaloid nucleus & & & \\
& Hippocampus & & & \\
& Purkinje's cells& & & \\
& Basal ganglia& & & \\
&Thalamus& & & \\
& Midbrain, Pons& & & \\
&Ventral prefrontal cortex& Protein& Human& [14]\\
&Layer III temporal cortex & Protein& Human& [15]\\
&Frontal cortex & Protein & Human & [16]\\
Myotubularin & Spinal cord & mRNA& Human& [17]\\
& Substantia nigra& & & \\
& Cerebral cortex & Protein & Human &*[11]\\
& Hippocampus & & & \\
& Cerebellum & & & \\
MKP1 &Hippocampus& Protein/mRNA& Human/Mice &[18]\\
(DUSP1)& Caudate& mRNA& Human& [19]\\
&Temporal cortex& Protein& Human& [20]\\
& Cerebral cortex & Protein& Human& [21]\\
& Cerebellum & & & \\
&Striatum & mRNA & Mice& [19]\\
&Striatum& mRNA& Rat& [22]\\
&Thalamus/Cortex& & & \\
& Neocortex &Protein& Rat&[24]\\
& BNST & & & \\
MKP2 & Cerebellar vermis& Protein& Human& [25]\\
(DUSP4) &Cortex &Protein&Human &[21]\\
& Hippocampus& & & \\
& Cerebellum & & & \\
&The medial prefrontal cortex & mRNA& Rat& [26]\\
&Lateral frontal cortex & & & \\
&Parietal cortex& & & \\
&Hippocampus& & & \\
MKP3 & The medial prefrontal cortex &mRNA&Rat&[26]\\
(DUSP6)& Lateral frontal cortex & & & \\
& Parietal cortex& & & \\
& Hippocampus& & & \\
&Ventromedial PFC& mRNA& Human/Mice& [27]\\
&Striatum & mRNA& Rat& [22]\\
&Cortex& & & \\
&Hippocampus& & & \\
PAC1 & Hippocampus & Protein/mRNA & Mice &[28] \\
(DUSP2) & Hippocampus& mRNA & Human& [18]\\
Hvhr3 & Brain (not specified)& mRNA &Mice & [29]\\
(DUSP5)& Nucleus accumbens& mRNA& Mice& [30]\\
& Medial prefrontal cortex& mRNA &Rat& [31]\\
MKP-X & Whole-brain& mRNA &Mice& [32]\\
( DUSP7)& & & & \\
Hvh5 & Amygdala & mRNA& Human& [33]\\
(DUSP8) & caudate nucleus& & & \\
& Corpus callosum& & & \\
& Hippocampus& & & \\
& Hypothalamus/thalamus& & & \\
& Subthalamic nucleus& & & \\
& Substantia nigra& & & \\
MTMR2 & Cortex &Protein/mRNA & Rat &[34]\\
& Hippocampus& & & \\
& Cerebellum& & & \\
MTMR5 & Brain &Protein& Mice& [35]\\
& The sciatic nerve& & & \\
Laforin & Cerebellum & mRNA & Mice & [36]\\
(EPM2A) & Hippocampus& & & \\
& Cerebral cortex& & & \\
& Olfactory bulb& & & \\
DUSP12 & Hippocampus & mRNA & Human & [18]\\
DUSP14 & Retinal ganglion cells &mRNA& Rat& [37]\\
DUSP15& Schwann cell& mRNA& Rat& [38]\\
& Myelinating Oligodendrocytes& mRNA& Rat& [39]\\
DUSP18 & Fetal brain &mRNA &Human& [40]\\
DUSP19 & Hippocampus& mRNA &Human& [18]\\
&Ventral subiculum& mRNA &Human& [27]\\
DUSP22 & Hippocampus & Protein &Human &[41]\\
DUSP23& Nucleus accumbens&mRNA&Human&[27]\\
& The Broadman area& & & \\
DUSP26& Hippocampus& Protein/mRNA & Human& [18, 42]\\
\end{longtable}
\end{document}
答案1
看起来表格太宽了,无法放入文本块中。我建议您从一个longtable
环境切换到另一个xltabular
环境,将表格的目标宽度设置为\textwidth
,并允许至少在其中一列中自动换行。
\documentclass{report}
%%\usepackage[utf8]{inputenc} % that's the default nowadays
\usepackage[T1]{fontenc} % <-- new
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{indentfirst}
\usepackage{longtable}
\usepackage{textalpha}
\usepackage{ragged2e}
% new code
\usepackage{xltabular}
\newcolumntype{L}{>{\RaggedRight}X} % suspend full justification
% special new column type for header row:
\newcolumntype{C}{>{\centering\arraybackslash}%
p{\dimexpr\textwidth-2\tabcolsep-2\arrayrulewidth\relax}}
\begin{document}
\begin{xltabular}{\textwidth}{ | l | L | c | l | l | } % <-- new
%% headers and footers
\caption{DUSP Protein or RNA expression in animal and human brain\label{long3}}\\
\hline
\multicolumn{5}{ | C | }{DUSP Protein or RNA expression in animal and human brain}\\
\hline
Isoforms & Expression & Protein/mRNA & Species & Ref. \\
\hline
\endfirsthead
\hline
\multicolumn{5}{|c|}{Continuation of Table \ref{long3}}\\
\hline
Isoforms & Expression & Protein/mRNA & Species & Ref. \\
\hline
\endhead
\hline
\endfoot
\hline
\multicolumn{5}{| c |}{End of Table}\\
\hline\hline
\endlastfoot
%% body of table
SSH2 & Brain & mRNA & Mice & [104, 105] \\
& Thalamus & & & \\
& %Hippocampus
Primary cortical neurons & & & \\
SSH3 & Hippocampus & mRNA & Human & [5] \\
& Temporal gyrus & & & \\
& Frontal gyrus & & & \\
& Prefrontal cortex& mRNA & Mice & [6] \\
& Hypothalamus & & & \\
& Amygdala & mRNA & Mice & [7] \\
\end{xltabular}
\end{document}