xtable 생성 longtable에서 모든 hline 제거

xtable 생성 longtable에서 모든 hline 제거

을 설정하더라도 hline.after = NULLR 패키지에서 생성된 긴 테이블은 xtable여전히 ​​테이블 맨 끝에 hline을 유지합니다.

\documentclass{article}

\usepackage{longtable}

\begin{document}

<<results='asis'>>=
require(xtable)
print(xtable(cars[1:20,], caption = 'NO HLINES'), 
      tabular.environment = "longtable", include.rownames = F, 
      caption.placement = "top", include.colnames = FALSE, 
      hline.after = NULL, floating = FALSE)
@

\end{document}

결과

\begin{longtable}{rr}
\caption{NO HLINES} \\ 
  4.00 & 2.00 \\ 
  4.00 & 10.00 \\ 
  7.00 & 4.00 \\ 
  7.00 & 22.00 \\ 
  8.00 & 16.00 \\ 
  9.00 & 10.00 \\ 
  10.00 & 18.00 \\ 
  10.00 & 26.00 \\ 
  10.00 & 34.00 \\ 
  11.00 & 17.00 \\ 
  11.00 & 28.00 \\ 
  12.00 & 14.00 \\ 
  12.00 & 20.00 \\ 
  12.00 & 24.00 \\ 
  12.00 & 28.00 \\ 
  13.00 & 26.00 \\ 
  13.00 & 34.00 \\ 
  13.00 & 34.00 \\ 
  13.00 & 46.00 \\ 
  14.00 & 26.00 \\ 
  \hline
\end{longtable}

답변1

booktabs=TRUEprint.xtable 호출에 인수를 추가해야 합니다.

print(xtable(cars[1:20,], caption = 'NO HLINES'), 
  tabular.environment = "longtable", include.rownames = F, 
  caption.placement = "top", include.colnames = FALSE, 
  booktabs = TRUE,
  hline.after = NULL, floating = FALSE)

결과:

\begin{longtable}{rr}
\caption{NO HLINES} \\ 
4.00 & 2.00 \\ 
4.00 & 10.00 \\ 
7.00 & 4.00 \\ 
7.00 & 22.00 \\ 
8.00 & 16.00 \\ 
9.00 & 10.00 \\ 
10.00 & 18.00 \\ 
10.00 & 26.00 \\ 
10.00 & 34.00 \\ 
11.00 & 17.00 \\ 
11.00 & 28.00 \\ 
12.00 & 14.00 \\ 
12.00 & 20.00 \\ 
12.00 & 24.00 \\ 
12.00 & 28.00 \\ 
13.00 & 26.00 \\ 
13.00 & 34.00 \\ 
13.00 & 34.00 \\ 
13.00 & 46.00 \\ 
14.00 & 26.00 \\ 
\end{longtable}

관련 정보