![编辑:](https://linux22.com/image/401236/%E7%BC%96%E8%BE%91%EF%BC%9A.png)
有没有办法让表格/图形不位于新页面的段落中间?
我曾尝试过:
\begin{table}[htp!]
和
\begin{table}[h!]
\documentclass[12pt,oneside]{book}
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
\usepackage{makecell,siunitx}
\usepackage{booktabs}
\begin{document}
Testtesttestest
Testtesttestest
Testtesttestest
Testtesttestest
Testtesttestest Testtesttes
Testtesttestest Testtesttes
To save some time when writing too many expressions
with exponents is by defining a new command to make simpler:
To save some time when writing too many expressions
with exponents is by defining a new command to make simpler:
To save some time when writing too many expressions
with exponents is by defining a new command to make simpler:
To save some time when writing too many expressions
with exponents is by defining a new command to make simpler:
To save some time when writing too many expressions
with exponents is by defining a new command to make simpler:
To save some time when writing too many expressions
with exponents is by defining a new command to make simpler:
To save some time when writing too many expressions
with exponents is by defining a new command to make simpler:
To save some time when writing too many expressions
with exponents is by defining a new command to make simpler:
To save some time when writing too many expressions
with exponents is by defining a new command to make simpler:
To save some time when writing too many expressions
with exponents is by defining a new command to make simpler:
"Looking back on a childhood filled with events and memories, I find it rather difficult to pick one that leaves me with the fabled "warm and fuzzy feelings." As the daughter of an Air Force major, I had the pleasure of traveling across America in many moving trips. I have visited the monstrous trees of the Sequoia National Forest, stood on the edge of the Grand Canyon and have jumped on the beds at Caesar's Palace in Lake Tahoe."
"The day I picked my dog up from the pound was one of the happiest days of both of our lives. I had gone to the pound just a week earlier with the idea that I would just "look" at a puppy. Of course, you can no more just look at those squiggling little faces so filled with hope and joy than you can stop the sun from setting in the evening. I knew within minutes of walking in the door that I would get a puppy… but it wasn't until I saw him that I knew I had found my puppy."
"Looking for houses was supposed to be a fun and exciting process. Unfortunately, none of the ones that we saw seemed to match the specifications that we had established. They were too small, too impersonal, too close to the neighbors. After days of finding nothing even close, we began to wonder: was there really a perfect house out there for us?"
\begin{table}[htp!]
\centering
\begin{tabular}{
l
S[table-format=2.2,table-space-text-post=\%]
S[table-format=3.2,,table-space-text-post=\%]
}
\toprule
& \multicolumn{2}{c}{\thead{\makebox[0pt]{\textbf{Descriptive Analysis 1}}}}\\
\cmidrule{2-3}
& \textbf{MM}
& \textbf{CM} \\
\midrule
N & {10} & {10} \\
Mean & 91.45\% & 8.55\% \\
Median & 94.74\% & 5.26\% \\
\bottomrule
\end{tabular}
\end{table}
"Billy Ray's Pawn Shop and Lawn Mower Repair looked like a burial ground for country auction rejects. The blazing, red, diesel fuel tanks beamed in front of the station, looking like cheap lipstick against the pallid, wrinkled texture of the parking lot sand. The yard, not much larger than the end zone at General G. Patton High School on the north end of town, was framed with a rusted metallic hedge of lawn mowers, banana seat bicycles, and corroded oil drums. It wasn't a calico frame of rusted parts, but rather an orchestra of unwanted machinery that Billy Ray had arranged into sections. The yellow-tanked mowers rested silently at the right of the diesel fuel. Once red, now faded orange, mowers stood at attention to the left. The oil barrels, jaded and pierced with holes, bellared like chimes when the wind was right. The bikes rested sporadically throughout the lot. In the middle of it all was the office, a faded, steel roof supported by cheap two-by-fours and zebra paneling. Billy Ray was at home, usually, five blocks east of town on Kennel Road."
\end{document}
答案1
如果你不想让表格浮动,就不要使用环境table
。改用以下代码:
%\begin{table}[htp!]
\begin{center}
\begin{tabular}{%
l
S[table-format=2.2,table-space-text-post=\%]
S[table-format=3.2,,table-space-text-post=\%]
}
\toprule
& \multicolumn{2}{c}{\thead{\makebox[0pt]{\textbf{Descriptive Analysis 1}}}}\\
\cmidrule{2-3}
& \textbf{MM}
& \textbf{CM} \\
\midrule
N & {10} & {10} \\
Mean & 91.45\% & 8.55\% \\
Median & 94.74\% & 5.26\% \\
\bottomrule
\end{tabular}
\end{center}
%\end{table}
请参阅我评论的环境table
和命令\centering
并使用环境center
。
如果您的表格/图形的位置非常靠近页面末尾,则之前的代码可能会发生这种情况,因为标题和表格放在两个不同的页面上:-(
要省略使用以下代码(minipage
将表格和标题保持在一起,使用环境时minipage
您可以再次使用\centering
环境center
):
\begin{minipage}[c]{\textwidth} % <=====================================
\centering
\begin{tabular}{%
l
S[table-format=2.2,table-space-text-post=\%]
S[table-format=3.2,,table-space-text-post=\%]
}
\toprule
& \multicolumn{2}{c}{\thead{\makebox[0pt]{\textbf{Descriptive Analysis 1}}}}\\
\cmidrule{2-3}
& \textbf{MM}
& \textbf{CM} \\
\midrule
N & {10} & {10} \\
Mean & 91.45\% & 8.55\% \\
Median & 94.74\% & 5.26\% \\
\bottomrule
\end{tabular}
\captionof{table}{the wantet title of table a} % <======================
\label{tab:titlea} % <==================================================
\end{minipage} % <======================================================
使用以下完整的 MWE(请注意,我删除了\\
段落的结尾。不要这样做,请使用空白行标记新段落!):
\documentclass[12pt,oneside]{book}
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
\usepackage{makecell,siunitx}
\usepackage{booktabs}
\begin{document}
"When entering the door at Lou's, two things are immediately noticeable: the place is rarely empty and seems to consist of a maze of rooms. The first room, through the door, is the main part of the restaurant. There is another, rarely used, dining room off to the right. It was added during the oil well boom of the seventies. Through the main dining room is yet another room; it guards the door leading into the kitchen. This room contains the most coveted table in the place. The highest tribute Lou can bestow on anyone is to allow them access to seats at this table. This table is the family table; it is reserved for Lou's, and her daughter Karen's, immediate family and treasured friends."
"Like his twisted feathers, his many scars, the reliable old owl chose the gnarled, weather-beaten, but solid branch often - it being a companion to the wise alone with the night and the last branch to creak in the heaviest wind. He often came to survey the fields and the clouds before his hunt, to listen to the steady sound of the stream passing through reeds under the bridge, while combing his feathers for the unwanteds - whatever they might be."
"Looking back on a childhood filled with events and memories, I find it rather difficult to pick one that leaves me with the fabled "warm and fuzzy feelings." As the daughter of an Air Force major, I had the pleasure of traveling across America in many moving trips. I have visited the monstrous trees of the Sequoia National Forest, stood on the edge of the Grand Canyon and have jumped on the beds at Caesar's Palace in Lake Tahoe."
"The day I picked my dog up from the pound was one of the happiest days of both of our lives. I had gone to the pound just a week earlier with the idea that I would just "look" at a puppy. Of course, you can no more just look at those squiggling little faces so filled with hope and joy than you can stop the sun from setting in the evening. I knew within minutes of walking in the door that I would get a puppy… but it wasn't until I saw him that I knew I had found my puppy."
"Looking for houses was supposed to be a fun and exciting process. Unfortunately, none of the ones that we saw seemed to match the specifications that we had established. They were too small, too impersonal, too close to the neighbors. After days of finding nothing even close, we began to wonder: was there really a perfect house out there for us?"
Below is a pdf link to personal statements and application essays representing strong efforts by students applying for both undergraduate and graduate opportunities. These ten essays have one thing in common: They were all written by students under the constraint of the essay being 1-2 pages due to the target program’s explicit instructions. In such circumstances, writers must attend carefully to the essay prompt (sometimes as simple as “Write a one-page summary of your reasons for wanting to pursue graduate study”) and recognize that evaluators tend to judge these essays on the same fundamental principles, as follows:
%\begin{table}[htp!]
\begin{center}
\begin{tabular}{%
l
S[table-format=2.2,table-space-text-post=\%]
S[table-format=3.2,,table-space-text-post=\%]
}
\toprule
& \multicolumn{2}{c}{\thead{\makebox[0pt]{\textbf{Descriptive Analysis 1}}}}\\
\cmidrule{2-3}
& \textbf{MM}
& \textbf{CM} \\
\midrule
N & {10} & {10} \\
Mean & 91.45\% & 8.55\% \\
Median & 94.74\% & 5.26\% \\
\bottomrule
\end{tabular}
\end{center}
%\end{table}
"Billy Ray's Pawn Shop and Lawn Mower Repair looked like a burial ground for country auction rejects. The blazing, red, diesel fuel tanks beamed in front of the station, looking like cheap lipstick against the pallid, wrinkled texture of the parking lot sand. The yard, not much larger than the end zone at General G. Patton High School on the north end of town, was framed with a rusted metallic hedge of lawn mowers, banana seat bicycles, and corroded oil drums. It wasn't a calico frame of rusted parts, but rather an orchestra of unwanted machinery that Billy Ray had arranged into sections. The yellow-tanked mowers rested silently at the right of the diesel fuel. Once red, now faded orange, mowers stood at attention to the left. The oil barrels, jaded and pierced with holes, bellared like chimes when the wind was right. The bikes rested sporadically throughout the lot. In the middle of it all was the office, a faded, steel roof supported by cheap two-by-fours and zebra paneling. Billy Ray was at home, usually, five blocks east of town on Kennel Road."
"When entering the door at Lou's, two things are immediately noticeable: the place is rarely empty and seems to consist of a maze of rooms. The first room, through the door, is the main part of the restaurant. There is another, rarely used, dining room off to the right. It was added during the oil well boom of the seventies. Through the main dining room is yet another room; it guards the door leading into the kitchen. This room contains the most coveted table in the place. The highest tribute Lou can bestow on anyone is to allow them access to seats at this table. This table is the family table; it is reserved for Lou's, and her daughter Karen's, immediate family and treasured friends.
\end{document}
您将获得以下结果:
如果您希望打印的文档中有一行空白,请使用包parskip
(查看其文档texdoc parskip
)...
编辑:
要获取表格或图形的标题,请参阅以下 MWE(代码更改以 标记<====
):
\documentclass[12pt,oneside]{book}
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
\usepackage{makecell,siunitx}
\usepackage{booktabs}
\usepackage{parskip} % <================================================
\usepackage{caption} % <================================================
\begin{document}
"When entering the door at Lou's, two things are immediately noticeable: the place is rarely empty and seems to consist of a maze of rooms. The first room, through the door, is the main part of the restaurant. There is another, rarely used, dining room off to the right. It was added during the oil well boom of the seventies. Through the main dining room is yet another room; it guards the door leading into the kitchen. This room contains the most coveted table in the place. The highest tribute Lou can bestow on anyone is to allow them access to seats at this table. This table is the family table; it is reserved for Lou's, and her daughter Karen's, immediate family and treasured friends."
"Like his twisted feathers, his many scars, the reliable old owl chose the gnarled, weather-beaten, but solid branch often - it being a companion to the wise alone with the night and the last branch to creak in the heaviest wind. He often came to survey the fields and the clouds before his hunt, to listen to the steady sound of the stream passing through reeds under the bridge, while combing his feathers for the unwanteds - whatever they might be."
"Looking back on a childhood filled with events and memories, I find it rather difficult to pick one that leaves me with the fabled "warm and fuzzy feelings." As the daughter of an Air Force major, I had the pleasure of traveling across America in many moving trips. I have visited the monstrous trees of the Sequoia National Forest, stood on the edge of the Grand Canyon and have jumped on the beds at Caesar's Palace in Lake Tahoe."
"The day I picked my dog up from the pound was one of the happiest days of both of our lives. I had gone to the pound just a week earlier with the idea that I would just "look" at a puppy. Of course, you can no more just look at those squiggling little faces so filled with hope and joy than you can stop the sun from setting in the evening. I knew within minutes of walking in the door that I would get a puppy… but it wasn't until I saw him that I knew I had found my puppy."
"Looking for houses was supposed to be a fun and exciting process. Unfortunately, none of the ones that we saw seemed to match the specifications that we had established. They were too small, too impersonal, too close to the neighbors. After days of finding nothing even close, we began to wonder: was there really a perfect house out there for us?"
Below is a pdf link to personal statements and application essays representing strong efforts by students applying for both undergraduate and graduate opportunities. These ten essays have one thing in common: They were all written by students under the constraint of the essay being 1-2 pages due to the target program’s explicit instructions. In such circumstances, writers must attend carefully to the essay prompt (sometimes as simple as “Write a one-page summary of your reasons for wanting to pursue graduate study”) and recognize that evaluators tend to judge these essays on the same fundamental principles, as follows:
%\begin{table}[htp!]
\begin{center}
\begin{tabular}{%
l
S[table-format=2.2,table-space-text-post=\%]
S[table-format=3.2,,table-space-text-post=\%]
}
\toprule
& \multicolumn{2}{c}{\thead{\makebox[0pt]{\textbf{Descriptive Analysis 1}}}}\\
\cmidrule{2-3}
& \textbf{MM}
& \textbf{CM} \\
\midrule
N & {10} & {10} \\
Mean & 91.45\% & 8.55\% \\
Median & 94.74\% & 5.26\% \\
\bottomrule
\end{tabular}
\captionof{table}{the wantet title of table} % <========================
\label{tab:title} % <===================================================
\end{center}
%\end{table}
"Billy Ray's Pawn Shop and Lawn Mower Repair looked like a burial ground
for country auction rejects. The blazing, red, diesel fuel tanks beamed
in front of the station, looking like cheap lipstick against the pallid,
wrinkled texture of the parking lot sand. The yard, not much larger than
the end zone at General G. Patton High School on the north end of town,
was framed with a rusted metallic hedge of lawn mowers, banana seat
bicycles, and corroded oil drums. It wasn't a calico frame of rusted
parts, but rather an orchestra of unwanted machinery that Billy Ray had
arranged into sections. The yellow-tanked mowers rested silently at the
%right of the diesel fuel. Once red, now faded orange, mowers stood at
%attention to the left. The oil barrels, jaded and pierced with holes,
%bellared like chimes when the wind was right. The bikes rested
%sporadically throughout the lot. In the middle of it all was the office,
%a faded, steel roof supported by cheap two-by-fours and zebra paneling.
Billy Ray was at home, usually, five blocks east of town on Kennel Road."
\begin{minipage}[c]{\textwidth} % <=====================================
\centering
\begin{tabular}{%
l
S[table-format=2.2,table-space-text-post=\%]
S[table-format=3.2,,table-space-text-post=\%]
}
\toprule
& \multicolumn{2}{c}{\thead{\makebox[0pt]{\textbf{Descriptive Analysis 1}}}}\\
\cmidrule{2-3}
& \textbf{MM}
& \textbf{CM} \\
\midrule
N & {10} & {10} \\
Mean & 91.45\% & 8.55\% \\
Median & 94.74\% & 5.26\% \\
\bottomrule
\end{tabular}
\captionof{table}{the wantet title of table a} % <======================
\label{tab:titlea} % <==================================================
\end{minipage} % <======================================================
"When entering the door at Lou's, two things are immediately noticeable: the place is rarely empty and seems to consist of a maze of rooms. The first room, through the door, is the main part of the restaurant. There is another, rarely used, dining room off to the right. It was added during the oil well boom of the seventies. Through the main dining room is yet another room; it guards the door leading into the kitchen. This room contains the most coveted table in the place. The highest tribute Lou can bestow on anyone is to allow them access to seats at this table. This table is the family table; it is reserved for Lou's, and her daughter Karen's, immediate family and treasured friends.
\end{document}
及其结果:
请查看(红色箭头 1 标记)带有标题的表格的第一个代码,并用红色箭头 2 标记解决方案minipage
。请注意,我在表格 2(红色箭头 3)之前注释了您的文本的几行,以将其放在页面末尾。现在复制 MWE 并开始删除一个或多个注释,编译并查看更改的结果...