![核苷酸序列超出表格](https://linux22.com/image/453513/%E6%A0%B8%E8%8B%B7%E9%85%B8%E5%BA%8F%E5%88%97%E8%B6%85%E5%87%BA%E8%A1%A8%E6%A0%BC.png)
我的问题是,使用 Overleaf 时,核苷酸序列无法保留在表格中。该表格不是最好的,我只是想说明这个问题。
\begin{table}[h]
\centering
\begin{tabular}{ |p{2cm}p{3cm}p{8cm}| }
\hline
\multicolumn{3}{|c|}{list of oligonucleotides} \\
\hline
& primer ID & AAP1\\
dual sgRNA & RRB008_fw 5'-3’
& ATATATGGTCTCGATTGCACGATAAAGGGCACACTGGTTTTAGAGCTAGAAATAGC\\
dual sgRNA & RRB008_rev 5'-3' &
ATTATTGGTCTCGAAACCTGTGCCCGTCATACTCGTCAAATCTCTTAGTCGACTCTAC\\
\hline
\end{tabular}
\caption{Caption}
\label{tab:my_label}
\end{table}
答案1
这是使用包的解决方案seqsplit
。我使用包进行了一些改进,因为表格中的默认垂直间距非常小,cellspace
它允许您在带有字母前缀的说明符的列中定义单元格顶部和底部的最小垂直间距S
(或者如果您通过加载时间选项C
加载,或任何您想要的字母)。siunitx
\documentclass{article}
\usepackage{seqsplit}
\usepackage{cellspace}
\setlength{\cellspacetoplimit}{6pt}
\setlength{\cellspacebottomlimit}{6pt}
\begin{document}
\begin{table}[h]
\centering
\begin{tabular}{ |S{p{2cm}}S{p{3cm}}S{p{8cm}}| }
\hline
\multicolumn{3}{|Sc|}{list of oligonucleotides} \\
\hline
& primer ID & AAP1\\
dual sgRNA & RRB008\textsubscript{fw 5'-3’}
& \seqsplit{ATATATGGTCTCGATTGCACGATAAAGGGCACACTGGTTTTAGAGCTAGAAATAGC}\\
dual sgRNA & RRB008\textsubscript{rev 5'-3'} &
\seqsplit{ATTATTGGTCTCGAAACCTGTGCCCGTCATACTCGTCAAATCTCTTAGTCGACTCTAC}\\
\hline
\end{tabular}
\caption{Caption}
\label{tab:my_label}
\end{table}
\end{document}
答案2
如果你希望序列不出现断线,你可以将各组组合起来,并用一个额外的空格将它们分开。由于序列很长,旋转表格也可能有帮助
\documentclass{article}
\usepackage{array} % improved column specification
\usepackage{booktabs} % adds toprule, bottomrule, midrule, and addlinespace
\usepackage{rotating} % for \rotatebox{}{}
\usepackage{caption} % improved captioning
\captionsetup[table]{position=bottom, skip=12pt}
%%% For demonstration
\usepackage{showframe}
\renewcommand*{\ShowFrameLinethickness}{0.2pt}
\renewcommand*{\ShowFrameColor}{\color{blue}}
\begin{document}
\begin{table}[tbh]
\setlength\tabcolsep{0pt}
\centering
\rotatebox{90}{%
\begin{tabular}{p{2cm}<{:} @{\extracolsep{\fill}} l}
\toprule
\multicolumn{1}{l}{Terms} & Details \\
\midrule
Name & dual sgRNA \\
primer ID & RRB008\textsubscript{fw} 5'-3’ \\
AAP1 & ATATATGGTCTCGATTGCAC-GATAAAGGGCACACTGGTTTTA-GAGCTAGAAATAGC \\ \addlinespace[12pt]
Name & dual sgRNA \\
primer ID & RRB008\textsubscript{rev} 5'-3' \\
AAP1 & ATTATTGGTCTCGAAACCTGTGCCCGTCATACTCGTCAAATCTCTTAGTCGACTCTAC \\ \addlinespace[12pt]
Name & etc. \\
primer ID & etc. \\
AAP1 & etc. \\
\bottomrule
\end{tabular}}
\caption{list of oligonucleotides}\label{tab:my_label}
\end{table}
\end{document}