将文字环绕在表格周围,延伸至整个页面高度

将文字环绕在表格周围,延伸至整个页面高度

我正在尝试在环境中将文本环绕在表格周围wraptable

我的代码如下所示:

\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
    \usepackage{amssymb}
    \usepackage{graphicx}
    \usepackage{wrapfig}
    \usepackage{booktabs}
    \usepackage{rotating}
    \usepackage{lipsum}
    \usepackage{lscape}


    \begin{document}
        \begin{wraptable}{l}{0.8\linewidth}

            \footnotesize
            \centering
            \caption[]{my caption \label{tab:summary}}
            \begin{sideways}
                \begin{tabular}{p{\dimexpr 0.2\linewidth-2\tabcolsep} 
                        p{\dimexpr 0.75\linewidth-2\tabcolsep} 
                        p{\dimexpr 0.05\linewidth-2\tabcolsep}}
                    \toprule
                    \textbf{Sample type}                          & \textbf{Definitions}                                                                                                                                                                                                                                                                                              & \textbf{n} \\ \midrule
                    Paired, pre and post treatment - deemed cured & VL treated for 4-5 weeks, with improvement in clinical symptoms and no evidence of relapse at any time 6 months after treatment. Samples were taken at or around the start of treatment and at 6 months.                                                                                                          & 25 pairs   \\
                    Unpaired, relapse                             & VL treated and subsequently relapsed to active disease. Sampled at the time of relapse diagnosis                                                                                                                                                                                                                  & 26         \\
                    Endemic healthy controls                      & Resident in VL endemic area, seronegative by DAT and rK39 ELISA, no history of VL, healthy                                                                                                                                                                                                                        & 15         \\
                    Assymptomatic progressors                     & Asymptomatic seropositive, on the basis of DAT (geq1:16,000) and/or rK39 ELISA (Optical density (OD) greater mean OD + 2 standard deviations of non-endemic healthy control samples), from VL endemic areas, without clinical signs or symptoms or history of VL, developed VL 6 days to 6 months after sampling. & 4          \\
                    Asymptomatic non-progressors                  & Asymptomatic seropositive as above but did not develop VL during follow-up of at least 3 years.                                                                                                                                                                                                                   & 4          \\ \bottomrule
                \end{tabular}%
            \end{sideways}
        \end{wraptable}
        \lipsum[1]
    \end{document}

我看起来还不错,虽然我想有桌子覆盖整个页面高度以及旋转的标题,如下面的代码所示

\begin{landscape}
    \begin{table}[!htb]
        \centering
        \begin{tabular}{p{\dimexpr 0.2\linewidth-2\tabcolsep} 
                p{\dimexpr 0.75\linewidth-2\tabcolsep} 
                p{\dimexpr 0.05\linewidth-2\tabcolsep}}
            \toprule
            \textbf{Sample type}                          & \textbf{Definitions}                                                                                                                                                                                                                                                                                              & \textbf{n} \\ \midrule
            Paired, pre and post treatment - deemed cured & VL treated for 4-5 weeks, with improvement in clinical symptoms and no evidence of relapse at any time 6 months after treatment. Samples were taken at or around the start of treatment and at 6 months.                                                                                                          & 25 pairs   \\
            Unpaired, relapse                             & VL treated and subsequently relapsed to active disease. Sampled at the time of relapse diagnosis                                                                                                                                                                                                                  & 26         \\
            Endemic healthy controls                      & Resident in VL endemic area, seronegative by DAT and rK39 ELISA, no history of VL, healthy                                                                                                                                                                                                                        & 15         \\
            Assymptomatic progressors                     & Asymptomatic seropositive, on the basis of DAT (geq1:16,000) and/or rK39 ELISA (Optical density (OD) greater mean OD + 2 standard deviations of non-endemic healthy control samples), from VL endemic areas, without clinical signs or symptoms or history of VL, developed VL 6 days to 6 months after sampling. & 4          \\
            Asymptomatic non-progressors                  & Asymptomatic seropositive as above but did not develop VL during follow-up of at least 3 years.                                                                                                                                                                                                                   & 4          \\ \bottomrule
        \end{tabular}%
        \caption[]{.}
        \label{tab_sera}
    \end{table}
\end{landscape}

但是,使用此代码,我无法在表格周围换行显示任何文字。

答案1

需要注意的是,这\intextsep也会影响正常浮动,因此您可能需要暂时进行更改。

\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
    \usepackage{amssymb}
    \usepackage{graphicx}
    \usepackage{wrapfig}
    \usepackage{booktabs}
    %\usepackage{rotating}
    \usepackage{lipsum}
    %\usepackage{lscape}
    \usepackage{caption}

    \newsavebox{\tempbox}


    \begin{document}

    % first measure the height of the tabular
    \savebox{\tempbox}{\begin{minipage}{\dimexpr \textheight}
      \footnotesize
      \captionof{table}[]{my caption}\label{tab:summary}
      \begin{tabular}{p{\dimexpr 0.2\linewidth-2\tabcolsep} 
                        p{\dimexpr 0.75\linewidth-2\tabcolsep} 
                        p{\dimexpr 0.05\linewidth-2\tabcolsep}}
                    \toprule
                    \textbf{Sample type}                          & \textbf{Definitions}                                                                                                                                                                                                                                                                                              & \textbf{n} \\ \midrule
                    Paired, pre and post treatment - deemed cured & VL treated for 4-5 weeks, with improvement in clinical symptoms and no evidence of relapse at any time 6 months after treatment. Samples were taken at or around the start of treatment and at 6 months.                                                                                                          & 25 pairs   \\
                    Unpaired, relapse                             & VL treated and subsequently relapsed to active disease. Sampled at the time of relapse diagnosis                                                                                                                                                                                                                  & 26         \\
                    Endemic healthy controls                      & Resident in VL endemic area, seronegative by DAT and rK39 ELISA, no history of VL, healthy                                                                                                                                                                                                                        & 15         \\
                    Assymptomatic progressors                     & Asymptomatic seropositive, on the basis of DAT (geq1:16,000) and/or rK39 ELISA (Optical density (OD) greater mean OD + 2 standard deviations of non-endemic healthy control samples), from VL endemic areas, without clinical signs or symptoms or history of VL, developed VL 6 days to 6 months after sampling. & 4          \\
                    Asymptomatic non-progressors                  & Asymptomatic seropositive as above but did not develop VL during follow-up of at least 3 years.                                                                                                                                                                                                                   & 4          \\ \bottomrule
  \end{tabular}
\end{minipage}}%
    \intextsep=0pt
        \begin{wraptable}{l}{\dimexpr \ht\tempbox+\dp\tempbox}
           \rotatebox{90}{\usebox\tempbox}
        \end{wraptable}%
        \lipsum[1-3]
    \end{document}

完整页面

相关内容