![将文字环绕在表格周围,延伸至整个页面高度](https://linux22.com/image/374768/%E5%B0%86%E6%96%87%E5%AD%97%E7%8E%AF%E7%BB%95%E5%9C%A8%E8%A1%A8%E6%A0%BC%E5%91%A8%E5%9B%B4%EF%BC%8C%E5%BB%B6%E4%BC%B8%E8%87%B3%E6%95%B4%E4%B8%AA%E9%A1%B5%E9%9D%A2%E9%AB%98%E5%BA%A6.png)
我正在尝试在环境中将文本环绕在表格周围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}