我正在尝试将标题包含在一行中

我正在尝试将标题包含在一行中

感谢社区的反馈和文档,我有以下长表:

\documentclass{article}
\usepackage[margin=0.1in]{geometry}
\usepackage{pdflscape}
\usepackage{longtable}
\begin{document}
\begin{landscape}
\begin{longtable}{ r *{7}{l} }
  \caption{Simultaneously Amplified or Deleted Genes in Claudin-Low Breast Cancer}\label{tab:genes}\\
  \hline
  & Gene & Description & Cytoband & Chr & Start & End \\ 
  \hline
  \endfirsthead
  \multicolumn{8}{c}{Table \ref{tab:genes}, continued}\\[1ex]
  \hline
 & Gene & Description & Cytoband & Chr & Start & End & qValue \\ 
  \hline
  \endhead
  \hline
  \multicolumn{8}{r@{}}{(continued on next page)}
  \endfoot
  \hline\hline
  \endlastfoot
1 & A26B1 & protein expressed in prostate, ovary, testis, & 15q11.2 & 15 & 19305252 & 19336667 \\

2 & APOD & apolipoprotein D precursor & 3q29 & 3 & 196776864 & 196792278 \\

3 & DOK6 & docking protein 6 & 18q23 & 18 & 65219270 & 65660359 \\

4 & FLJ20433 & hypothetical protein LOC54932 & 9q34.3 & 9 & 139321168 & 139437535 \\

5 & FLT3 & fms-related tyrosine kinase 3 & 13q12.2 & 13 & 27475410 & 27572729 \\

6 & hsa-mir-570 & hsa-mir-570 & 3q29 & 3 & 196911451 & 196911548 \\

7 & LOC283755 & hypothetical protein LOC283755 & 15q11.2 & 15 & 18848557 & 18971443 \\

8 & LOC283767 & hypothetical protein LOC283767 & 15q11.2 & 15 & 20287609 & 20296164 \\

9 & LOC650137 & seven transmembrane helix receptor & 15q11.2 & 15 & 19915065 & 19915749 \\

10 & MUC20 & mucin 20 isoform L & 3q29 & 3 & 196933423 & 196950211 \\

11 & MUC20 & mucin 20 isoform S & 3q29 & 3 & 196936768 & 196950211 \\

12 & OR11H12 & olfactory receptor, family 11, subfamily H, & 14q11.1 & 14 & 18447593 & 18448574 \\

13 & OR4M2 & olfactory receptor, family 4, subfamily M, & 15q11.2 & 15 & 19869939 & 19870881 \\

14 & OR4N4 & olfactory receptor, family 4, subfamily N, & 15q11.2 & 15 & 19883836 & 19884787 \\

15 & PIK3CA & phosphoinositide-3-kinase, catalytic, alpha & 3q26.32 & 3 & 180349004 & 180435191 \\

16 & TMPRSS11E & transmembrane protease, serine 11E & 4q13.2.1 & 4 & 68995761 & 69045917 \\

17 & TMPRSS11E2 & transmembrane protease, serine 11E2 & 4q13.2.1 & 4 & 68995761 & 69045917 \\

18 & UGT2B15 & UDP glycosyltransferase 2 family, polypeptide & 4q13.2.1 & 4 & 69194909 & 69218969 \\

19 & UGT2B17 & UDP glucuronosyltransferase 2 family, & 4q13.2.1 & 4 & 69085497 & 69116840 \\

20 & ZDHHC11 & zinc finger, DHHC-type containing 11 & 5p15.33 & 5 & 848721 & 904101 \\
\hline
\hline
\end{longtable}
\end{landscape}
\end{document}

如果您运行代码,您将看到图块不能很好地容纳在一行中,并且末尾有很多空白。我很确定这是我没有看到的愚蠢的东西。谢谢!

长桌

答案1

简单的答案就是纳入\usepackage{caption}序言中。

我最初的猜测是,如果没有它,它使用\textwidth而不是\linewidth来表示标题宽度,因为在旋转文本时,前者不会改变,但后者会改变。但正如 John K. 在评论中指出的那样,默认标题的实际宽度明显比 的值要窄\textwidth

captionArash E. 的评论正确地诊断了未使用该包时与标题相关的长度。它是\LTcapwidth(即 longtable 标题宽度)。我在最后给出了一个 MWE 来演示这一点。

无论如何,都可以通过使用caption包来实现补救,该包可以正确地将标题宽度设置为可用的宽度\linewidth

\documentclass{article}
\usepackage[margin=0.1in]{geometry}
\usepackage{pdflscape}
\usepackage{longtable}
\usepackage{caption}
\begin{document}
\begin{landscape}
\begin{longtable}{ r *{7}{l} }
  \caption{Simultaneously Amplified or Deleted Genes in Claudin-Low Breast Cancer}\label{tab:genes}\\
  \hline
  & Gene & Description & Cytoband & Chr & Start & End \\ 
  \hline
  \endfirsthead
  \multicolumn{8}{c}{Table \ref{tab:genes}, continued}\\[1ex]
  \hline
 & Gene & Description & Cytoband & Chr & Start & End & qValue \\ 
  \hline
  \endhead
  \hline
  \multicolumn{8}{r@{}}{(continued on next page)}
  \endfoot
  \hline\hline
  \endlastfoot
1 & A26B1 & protein expressed in prostate, ovary, testis, & 15q11.2 & 15 & 19305252 & 19336667 \\

2 & APOD & apolipoprotein D precursor & 3q29 & 3 & 196776864 & 196792278 \\

3 & DOK6 & docking protein 6 & 18q23 & 18 & 65219270 & 65660359 \\

4 & FLJ20433 & hypothetical protein LOC54932 & 9q34.3 & 9 & 139321168 & 139437535 \\

5 & FLT3 & fms-related tyrosine kinase 3 & 13q12.2 & 13 & 27475410 & 27572729 \\

6 & hsa-mir-570 & hsa-mir-570 & 3q29 & 3 & 196911451 & 196911548 \\

7 & LOC283755 & hypothetical protein LOC283755 & 15q11.2 & 15 & 18848557 & 18971443 \\

8 & LOC283767 & hypothetical protein LOC283767 & 15q11.2 & 15 & 20287609 & 20296164 \\

9 & LOC650137 & seven transmembrane helix receptor & 15q11.2 & 15 & 19915065 & 19915749 \\

10 & MUC20 & mucin 20 isoform L & 3q29 & 3 & 196933423 & 196950211 \\

11 & MUC20 & mucin 20 isoform S & 3q29 & 3 & 196936768 & 196950211 \\

12 & OR11H12 & olfactory receptor, family 11, subfamily H, & 14q11.1 & 14 & 18447593 & 18448574 \\

13 & OR4M2 & olfactory receptor, family 4, subfamily M, & 15q11.2 & 15 & 19869939 & 19870881 \\

14 & OR4N4 & olfactory receptor, family 4, subfamily N, & 15q11.2 & 15 & 19883836 & 19884787 \\

15 & PIK3CA & phosphoinositide-3-kinase, catalytic, alpha & 3q26.32 & 3 & 180349004 & 180435191 \\

16 & TMPRSS11E & transmembrane protease, serine 11E & 4q13.2.1 & 4 & 68995761 & 69045917 \\

17 & TMPRSS11E2 & transmembrane protease, serine 11E2 & 4q13.2.1 & 4 & 68995761 & 69045917 \\

18 & UGT2B15 & UDP glycosyltransferase 2 family, polypeptide & 4q13.2.1 & 4 & 69194909 & 69218969 \\

19 & UGT2B17 & UDP glucuronosyltransferase 2 family, & 4q13.2.1 & 4 & 69085497 & 69116840 \\

20 & ZDHHC11 & zinc finger, DHHC-type containing 11 & 5p15.33 & 5 & 848721 & 904101 \\
\hline
\hline
\end{longtable}
\end{landscape}
\end{document}

在此处输入图片描述


根据 Arash E 的建议\LTcapwidth,我能够通过此 MWE 验证:

\documentclass{article}
\usepackage[margin=0.1in]{geometry}
\usepackage{pdflscape}
\usepackage{longtable}
%\usepackage{caption}
\begin{document}
\begin{landscape}
{\centering\rule{\the\LTcapwidth}{1pt}\par}
\begin{longtable}{ r *{7}{l} }
  \caption{\the\LTcapwidth{} is the LTcapwidth.  The above rule is that width. Simultaneously Amplified or Deleted Genes in Claudin-Low Breast Cancer}\label{tab:genes}\\
  \hline
  & Gene & Description & Cytoband & Chr & Start & End \\ 
  \hline
  \endfirsthead
  \multicolumn{8}{c}{Table \ref{tab:genes}, continued}\\[1ex]
  \hline
 & Gene & Description & Cytoband & Chr & Start & End & qValue \\ 
  \hline
  \endhead
  \hline
  \multicolumn{8}{r@{}}{(continued on next page)}
  \endfoot
  \hline\hline
  \endlastfoot
1 & A26B1 & protein expressed in prostate, ovary, testis, & 15q11.2 & 15 & 19305252 & 19336667 \\

2 & APOD & apolipoprotein D precursor & 3q29 & 3 & 196776864 & 196792278 \\

3 & DOK6 & docking protein 6 & 18q23 & 18 & 65219270 & 65660359 \\

4 & FLJ20433 & hypothetical protein LOC54932 & 9q34.3 & 9 & 139321168 & 139437535 \\

5 & FLT3 & fms-related tyrosine kinase 3 & 13q12.2 & 13 & 27475410 & 27572729 \\

6 & hsa-mir-570 & hsa-mir-570 & 3q29 & 3 & 196911451 & 196911548 \\

7 & LOC283755 & hypothetical protein LOC283755 & 15q11.2 & 15 & 18848557 & 18971443 \\

8 & LOC283767 & hypothetical protein LOC283767 & 15q11.2 & 15 & 20287609 & 20296164 \\

9 & LOC650137 & seven transmembrane helix receptor & 15q11.2 & 15 & 19915065 & 19915749 \\

10 & MUC20 & mucin 20 isoform L & 3q29 & 3 & 196933423 & 196950211 \\

11 & MUC20 & mucin 20 isoform S & 3q29 & 3 & 196936768 & 196950211 \\

12 & OR11H12 & olfactory receptor, family 11, subfamily H, & 14q11.1 & 14 & 18447593 & 18448574 \\

13 & OR4M2 & olfactory receptor, family 4, subfamily M, & 15q11.2 & 15 & 19869939 & 19870881 \\

14 & OR4N4 & olfactory receptor, family 4, subfamily N, & 15q11.2 & 15 & 19883836 & 19884787 \\

15 & PIK3CA & phosphoinositide-3-kinase, catalytic, alpha & 3q26.32 & 3 & 180349004 & 180435191 \\

16 & TMPRSS11E & transmembrane protease, serine 11E & 4q13.2.1 & 4 & 68995761 & 69045917 \\

17 & TMPRSS11E2 & transmembrane protease, serine 11E2 & 4q13.2.1 & 4 & 68995761 & 69045917 \\

18 & UGT2B15 & UDP glycosyltransferase 2 family, polypeptide & 4q13.2.1 & 4 & 69194909 & 69218969 \\

19 & UGT2B17 & UDP glucuronosyltransferase 2 family, & 4q13.2.1 & 4 & 69085497 & 69116840 \\

20 & ZDHHC11 & zinc finger, DHHC-type containing 11 & 5p15.33 & 5 & 848721 & 904101 \\
\hline
\hline
\end{longtable}
\end{landscape}
\end{document}

在此处输入图片描述

答案2

调整的值有帮助吗\LTcapwidth

\documentclass{article}
\usepackage[margin=0.1in]{geometry}
\usepackage{pdflscape}
\usepackage{longtable}

\setlength\LTcapwidth{0.9\textwidth}% <=====

\begin{document}
\begin{landscape}
\begin{longtable}{ r *{7}{l} }
  \caption{Simultaneously Amplified or Deleted Genes in Claudin-Low
    Breast Cancer -- Simultaneously Amplified or Deleted Genes in
    Claudin-Low Breast Cancer -- Simultaneously Amplified or Deleted
    Genes in Claudin-Low Breast Cancer}\label{tab:genes}\\
  \hline
  & Gene & Description & Cytoband & Chr & Start & End \\ 
  \hline
  \endfirsthead
  \multicolumn{8}{c}{Table \ref{tab:genes}, continued}\\[1ex]
  \hline
 & Gene & Description & Cytoband & Chr & Start & End & qValue \\ 
  \hline
  \endhead
  \hline
  \multicolumn{8}{r@{}}{(continued on next page)}
  \endfoot
  \hline\hline
  \endlastfoot
1 & A26B1 & protein expressed in prostate, ovary, testis, & 15q11.2 & 15 & 19305252 & 19336667 \\

2 & APOD & apolipoprotein D precursor & 3q29 & 3 & 196776864 & 196792278 \\

3 & DOK6 & docking protein 6 & 18q23 & 18 & 65219270 & 65660359 \\

4 & FLJ20433 & hypothetical protein LOC54932 & 9q34.3 & 9 & 139321168 & 139437535 \\

5 & FLT3 & fms-related tyrosine kinase 3 & 13q12.2 & 13 & 27475410 & 27572729 \\

6 & hsa-mir-570 & hsa-mir-570 & 3q29 & 3 & 196911451 & 196911548 \\

7 & LOC283755 & hypothetical protein LOC283755 & 15q11.2 & 15 & 18848557 & 18971443 \\

8 & LOC283767 & hypothetical protein LOC283767 & 15q11.2 & 15 & 20287609 & 20296164 \\

9 & LOC650137 & seven transmembrane helix receptor & 15q11.2 & 15 & 19915065 & 19915749 \\

10 & MUC20 & mucin 20 isoform L & 3q29 & 3 & 196933423 & 196950211 \\

11 & MUC20 & mucin 20 isoform S & 3q29 & 3 & 196936768 & 196950211 \\

12 & OR11H12 & olfactory receptor, family 11, subfamily H, & 14q11.1 & 14 & 18447593 & 18448574 \\

13 & OR4M2 & olfactory receptor, family 4, subfamily M, & 15q11.2 & 15 & 19869939 & 19870881 \\

14 & OR4N4 & olfactory receptor, family 4, subfamily N, & 15q11.2 & 15 & 19883836 & 19884787 \\

15 & PIK3CA & phosphoinositide-3-kinase, catalytic, alpha & 3q26.32 & 3 & 180349004 & 180435191 \\

16 & TMPRSS11E & transmembrane protease, serine 11E & 4q13.2.1 & 4 & 68995761 & 69045917 \\

17 & TMPRSS11E2 & transmembrane protease, serine 11E2 & 4q13.2.1 & 4 & 68995761 & 69045917 \\

18 & UGT2B15 & UDP glycosyltransferase 2 family, polypeptide & 4q13.2.1 & 4 & 69194909 & 69218969 \\

19 & UGT2B17 & UDP glucuronosyltransferase 2 family, & 4q13.2.1 & 4 & 69085497 & 69116840 \\

20 & ZDHHC11 & zinc finger, DHHC-type containing 11 & 5p15.33 & 5 & 848721 & 904101 \\
\hline
\hline
\end{longtable}
\end{landscape}
\end{document}

在此处输入图片描述

相关内容