胶乳。 Pagebreak成表

时间:2014-11-17 16:02:02

标签: latex page-break

我在Latex中创建了一个longtable,但是在一个页面中它太长了,如何插入分页符以将表继续到下一页?

我尝试使用\ pagebreak并且它无效...

enter image description here

这是代码:

\begin{table} [h]
\footnotesize 
\setlength\LTleft{-30pt}
\setlength\LTright{-30pt}   
\caption{ Communicate static definition} 
\centering 
\begin{longtable}{@{\extracolsep{\fill}}c c c c@{}} 
\hline\hline %inserts double horizontal lines
Segment & Meaning & Usage & Card.\\ [0.5ex]  
\hline
MSH & Message Header & R & [1..1]\\
[{SFT}] & Software Segment & X & [0..0]\\
\{ & PATIENT RESULT begin & & \\ \relax
[ & PATIENT BEGIN & & \\
PID & Patient Identification & R & [1..1]\\ \relax
[PID1] & Aditional Demographics & X & [0..0]\\ \relax
..[\{NTE\}] & Notes and Comments & X & [0..0]\\ \relax
..[\{NK1\}] & Next of Kin/Associated Parties & X & [0..0]\\
\{ & VISIT begin & & \\
PV1 & Patient Visit & O & [0..1]\\ \relax
[PV2] & Patient Visit Additional Info & X & [0..0]\\ \relax
] & VISIT end & & \\ \relax
] & PATIENT end & & \\ \relax
\{ & ORDER OBSERVATION begin & & \\ \relax
[ORC] & Order Common & O & [0..1]\\
OBR & Observation Request & R & [1..1]\\ \relax
[\{NTE\}] & Notes and Comments & O & [0..1]\\ \relax
[\{&TIMING QTY begin & & \\
TQ1 & Timming/Quantity & O & [0..1]\\  \relax
[\{TQ2\}] & Timming/Quantity Order Sequence & X & \\ \relax
\{] & TIMING QTY end & & \\ \relax
[CTD] & Contact Data & X & [0..0]\\ \relax
[\{ & OBSERVATION begin & & \\
OBX & Observation Result & R & [1..1]\\ \relax
[\{NTE\}] & Notes and Comments & & \\ \relax
\}] & OBSERVATION end & & \\ \relax
[\{FT1\}] & Financial Transaction & X & [0..0]\\ \relax
[\{CT1\}] & Cllinical Trial Identification & X & [0..0]\\ \relax
[\{ & SPECIMEN begin & & \\ \relax
SPM & Specimen & X & [0..0]\\ \relax
[\{OBX\}] & Observation related to Specimen & X & [0..0]\\ \relax
\}] & SPECIMEN end & & \\ \relax
\} & ORDER OBSERVATION end & & \\ \relax
\} & PATIENT RESULT end & & \\ \relax
[DSC] & Continuation Pointer & X & [0..0]\\
[1ex] % [1ex] adds vertical space
\hline %inserts single line
\end{longtable}
\label{table:nonlin} % is used to refer this table in the text
\end{table}

1 个答案:

答案 0 :(得分:1)

为了在页面边界上有longtable个中断,您需要将其置于其自身而不是浮动table环境中;后者是牢不可破的。以下示例说明如何使用它:

enter image description here

\documentclass{article}
\usepackage{longtable}
\usepackage{lipsum}% Just for this example
\begin{document}

\lipsum[1-2]

\begingroup
  \footnotesize 
  \setlength\LTleft{-30pt}%
  \setlength\LTright{-30pt}%
  \centering 
  \begin{longtable}{@{\extracolsep{\fill}}c c c c@{}} 
    \caption{Communicate static definition\label{table:nonlin}}\\ % is used to refer this table in the text
    \hline\hline %inserts double horizontal lines
    Segment & Meaning & Usage & Card.\\ [0.5ex]  
    \hline
    MSH&Message Header&R&[1..1]\\ \relax
    [{SFT}] &Software Segment&X&[0..0]\\
    \{&PATIENT RESULT begin&&\\ \relax
    [&PATIENT BEGIN&&\\
    PID&Patient Identification&R&[1..1]\\ \relax
    [PID1]&Aditional Demographics&X&[0..0]\\ \relax
    ..[\{NTE\}]&Notes and Comments&X&[0..0]\\ \relax
    ..[\{NK1\}]&Next of Kin/Associated Parties&X&[0..0]\\
    \{&VISIT begin&&\\
    PV1&Patient Visit&O&[0..1]\\ \relax
    [PV2]&Patient Visit Additional Info&X&[0..0]\\
    ]&VISIT end&&\\
    ]&PATIENT end&&\\
    \{&ORDER OBSERVATION begin&&\\ \relax
    [ORC]&Order Common&O&[0..1]\\
    OBR&Observation Request&R&[1..1]\\ \relax
    [\{NTE\}]&Notes and Comments&O&[0..1]\\ \relax
    [\{&TIMING QTY begin&&\\
    TQ1&Timming/Quantity&O&[0..1]\\ \relax
    [\{TQ2\}]&Timming/Quantity Order Sequence&X&\\
    \{]&TIMING QTY end&&\\ \relax
    [CTD]&Contact Data&X&[0..0]\\ \relax
    [\{&OBSERVATION begin&&\\
    OBX&Observation Result&R&[1..1]\\ \relax
    [\{NTE\}]&Notes and Comments&&\\ \relax
    \}]&OBSERVATION end&&\\ \relax
    [\{FT1\}]&Financial Transaction&X&[0..0]\\ \relax
    [\{CT1\}]&Cllinical Trial Identification&X&[0..0]\\ \relax
    [\{&SPECIMEN begin&&\\ \relax
    SPM&Specimen&X&[0..0]\\ \relax
    [\{OBX\}]&Observation related to Specimen&X&[0..0]\\ \relax
    \}]&SPECIMEN end&&\\ \relax
    \}&ORDER OBSERVATION end&&\\ \relax
    \}&PATIENT RESULT end&&\\ \relax
    [DSC]&Continuation Pointer&X&[0..0]\\
    [1ex] % [1ex] adds vertical space
    \hline %inserts single line
  \end{longtable}
\endgroup

\lipsum[1-2]

\end{document}