0

I need to fix this code for a very long table because it does not allow the file to be compiled.

 \begin{center}

 \begin{longtable}{|*8|}
 \hline
{\bf text} & {\bf  Acceptor} & {\bf Hydrogen atom}& {\bf  Donor } & {\bf No. of Frames}& {\bf  Fraction } & {\bf Average Length}  & {\bf Average Angle}\\
 \hline
1&GLU 73@OE2       & ARG 63@HH12     &ARG 63@NH1    &38472       &0.3890            &2.7931     &163.2221 \\
2&GLU 73@OE1        &ARG 63@HH22     &ARG 63@NH2    &35928       &0.3633       &2.7983     &162.5048 \\
3&ILE 61@O          &ARG 63@HH11     &ARG 63@NH1    &14490       &0.1465       &2.8612     &158.4143 \\
4&GLU 73@OE1        &ARG 63@HH21     &ARG 63@NH2    &14175       &0.1433       &2.7989     &158.1555\\ 
5&GLU 73@OE2         &ARG 63@HE      &ARG 63@NE     &8830       &0.0893        &2.8070     &158.1456\\ 
6&GLU 73@OE2        &ARG 63@HH22     &ARG 63@NH2     &6240       &0.0631       &2.8255     &153.4609\\
7&GLU 73@OE2        &ARG 63@HH21     &ARG 63@NH2     &3949       &0.0399       &2.8370     &150.3891\\
8&GLU 73@OE1         & ARG 63@HE      &ARG 63@NE     &2677       &0.0271       &2.8550     &150.1653\\
9&GLU 73@OE1        &ARG 63@HH12     &ARG 63@NH1     &2539       &0.0257       &2.8152     &159.1169\\ 
10&ILE 61@O           &ARG 63@H       &ARG 63@N     &2152       &0.0218        &2.8859     &143.7632\\ 
11&ASN 64@O          &ARG 63@HH11     &ARG 63@NH1     &1379       &0.0139      &2.8298     &150.0209\\ 
12&ARG 63@O           &THR 65@HG1     &THR 65@OG1      &407       &0.0041      &2.8648     &161.4651\\ 
13&ASN 64@O            &ARG 63@HE      &ARG 63@NE      &325       &0.0033      &2.8589     &153.9301\\ 
14&ASN 64@O          &ARG 63@HH21     &ARG 63@NH2      &255       &0.0026      &2.8406     &148.6241\\ 
15&ARG 63@O             &THR 65@H       &THR 65@N      &255       &0.0026       &2.8795     &142.8652\\ 
16&ILE 61@O            &ARG 63@HE      &ARG 63@NE      &186       &0.0019       &2.8647     &156.4760\\ 
17&ASP 58@O             &ARG 63@H       &ARG 63@N      &163       &0.0016       &2.9154     &142.9759\\ 
18&THR 70@OG1        &ARG 63@HH22     &ARG 63@NH2       &88       &0.0009       &2.8805     &150.7732\\ 
19&ILE 61@O          &ARG 63@HH21     &ARG 63@NH2       &44       &0.0004       &2.8353     &147.7332\\ 
20&ASP 72@OD2        &ARG 63@HH12     &ARG 63@NH1       &25       &0.0003       &2.8411     &157.9767\\ 
21&THR 70@OG1        &ARG 63@HH12     &ARG 63@NH1       &25       &0.0003       &2.8827     &153.7517\\ 
22&VAL 68@O          &ARG 63@HH22     &ARG 63@NH2       &21       &0.0002       &2.9116     &150.5463\\ 
23&THR 70@OG1        &ARG 63@HH21     &ARG 63@NH2       &13       &0.0001       &2.8729     &148.6454\\ 
 24&ASP 72@OD2        &ARG 63@HH22     &ARG 63@NH2        &3       &0.0000       &2.9242     &143.7173\\ 
 25&ASP 58@OD2           &ARG 63@H       &ARG 63@N        &1       &0.0000       &2.9051     &137.9706\\ 
 26&GLY 62@O            &ARG 63@HE      &ARG 63@NE        &1       &0.0000       &2.9086     &161.4056\\ 
 27&ASP 72@OD1        &ARG 63@HH21     &ARG 63@NH2        &1       &0.0000       &2.9765     &139.9365\\
   \hline
 \end{longtable}
  \end{center}
  • 1
    \begin{longtable}{|*8|} is wrong -- to start with – user31729 Oct 29 '15 at 22:37
  • 1
    {|*8|} is missing the column specification, also do not put longtable in a center environment and don't use \bf in late. – David Carlisle Oct 29 '15 at 22:39
  • @DavidCarlisle: I am still wondering about your deep insight into `longtable* package ;-) – user31729 Oct 29 '15 at 22:41
  • Perhaps the Amino acids could be displayed differently, to reduce the width of the table as well – user31729 Oct 29 '15 at 22:48
2

enter image description here

\documentclass[a4paper]{article}
\usepackage{array,longtable}

\newcommand\hd[2]{\multicolumn{1}{#1}{\begin{tabular}{@{}c@{}}#2\end{tabular}}}

\begin{document}

\section{zzz}
X\dotfill X

{\footnotesize
\setlength\tabcolsep{2pt}
\setlength\extrarowheight{2pt}
\begin{longtable}{@{}|*8{r}|@{}}
 \hline
\hd{@{}|c}{text}& 
\hd{c}{Acceptor}&
\hd{c}{Hydrogen\\atom}&
\hd{c}{Donor}&
\hd{c}{No. of\\Frames}&
\hd{c}{Fraction}&
\hd{c}{ Average\\Length}&
\hd{c|@{}}{Average\\Angle}\\
 \hline
1&GLU 73@OE2       & ARG 63@HH12     &ARG 63@NH1    &38472       &0.3890            &2.7931     &163.2221 \\
2&GLU 73@OE1        &ARG 63@HH22     &ARG 63@NH2    &35928       &0.3633       &2.7983     &162.5048 \\
3&ILE 61@O          &ARG 63@HH11     &ARG 63@NH1    &14490       &0.1465       &2.8612     &158.4143 \\
4&GLU 73@OE1        &ARG 63@HH21     &ARG 63@NH2    &14175       &0.1433       &2.7989     &158.1555\\ 
5&GLU 73@OE2         &ARG 63@HE      &ARG 63@NE     &8830       &0.0893        &2.8070     &158.1456\\ 
6&GLU 73@OE2        &ARG 63@HH22     &ARG 63@NH2     &6240       &0.0631       &2.8255     &153.4609\\
7&GLU 73@OE2        &ARG 63@HH21     &ARG 63@NH2     &3949       &0.0399       &2.8370     &150.3891\\
8&GLU 73@OE1         & ARG 63@HE      &ARG 63@NE     &2677       &0.0271       &2.8550     &150.1653\\
9&GLU 73@OE1        &ARG 63@HH12     &ARG 63@NH1     &2539       &0.0257       &2.8152     &159.1169\\ 
10&ILE 61@O           &ARG 63@H       &ARG 63@N     &2152       &0.0218        &2.8859     &143.7632\\ 
11&ASN 64@O          &ARG 63@HH11     &ARG 63@NH1     &1379       &0.0139      &2.8298     &150.0209\\ 
12&ARG 63@O           &THR 65@HG1     &THR 65@OG1      &407       &0.0041      &2.8648     &161.4651\\ 
13&ASN 64@O            &ARG 63@HE      &ARG 63@NE      &325       &0.0033      &2.8589     &153.9301\\ 
14&ASN 64@O          &ARG 63@HH21     &ARG 63@NH2      &255       &0.0026      &2.8406     &148.6241\\ 
15&ARG 63@O             &THR 65@H       &THR 65@N      &255       &0.0026       &2.8795     &142.8652\\ 
16&ILE 61@O            &ARG 63@HE      &ARG 63@NE      &186       &0.0019       &2.8647     &156.4760\\ 
17&ASP 58@O             &ARG 63@H       &ARG 63@N      &163       &0.0016       &2.9154     &142.9759\\ 
18&THR 70@OG1        &ARG 63@HH22     &ARG 63@NH2       &88       &0.0009       &2.8805     &150.7732\\ 
19&ILE 61@O          &ARG 63@HH21     &ARG 63@NH2       &44       &0.0004       &2.8353     &147.7332\\ 
20&ASP 72@OD2        &ARG 63@HH12     &ARG 63@NH1       &25       &0.0003       &2.8411     &157.9767\\ 
21&THR 70@OG1        &ARG 63@HH12     &ARG 63@NH1       &25       &0.0003       &2.8827     &153.7517\\ 
22&VAL 68@O          &ARG 63@HH22     &ARG 63@NH2       &21       &0.0002       &2.9116     &150.5463\\ 
23&THR 70@OG1        &ARG 63@HH21     &ARG 63@NH2       &13       &0.0001       &2.8729     &148.6454\\ 
 24&ASP 72@OD2        &ARG 63@HH22     &ARG 63@NH2        &3       &0.0000       &2.9242     &143.7173\\ 
 25&ASP 58@OD2           &ARG 63@H       &ARG 63@N        &1       &0.0000       &2.9051     &137.9706\\ 
 26&GLY 62@O            &ARG 63@HE      &ARG 63@NE        &1       &0.0000       &2.9086     &161.4056\\ 
 27&ASP 72@OD1        &ARG 63@HH21     &ARG 63@NH2        &1       &0.0000       &2.9765     &139.9365\\
   \hline
 \end{longtable}}

\end{document}
  • Thank you very much ! I tried it, it compiles successfully ! However I have 2pt above the table. The one of \setlength\extrarowheight{2pt} when I tried to remove it, the file did not compile. – Hadeer Oct 29 '15 at 23:29
  • @Hadeer If it didn't compile you made an error but unless you show what you did, and state what error message you got, then hard to help. – David Carlisle Oct 29 '15 at 23:37

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.