Scissor LaTeX 中的 float、wrapfig 和 rotating
float、wrapfig 和 rotating 套件在 Scissor LaTeX 中部分可用:float 的 [H] 會讓圖片完全留在你寫的位置;wrapfigure 和 wraptable 會變成一般的置中浮動體,文字不會繞著它們排列;sidewaysfigure 和 sidewaystable 不會旋轉;\newfloat 和 \restylefloat 無法辨識。
套件的用途
float提供位置參數[H](「就放在這裡,不要移動」),以及用來定義自己浮動體類型和樣式的\newfloat和\restylefloat。wrapfig提供wrapfigure和wraptable,它們放在文字旁邊,段落會繞著它們排列。rotating提供sidewaysfigure和sidewaystable,能把浮動體旋轉 90 度並單獨放在一頁,還有可用於任何內容的turn和rotate環境。
在這裡可用的功能
| 功能 | 在 Scissor LaTeX 中 | 備註 |
|---|---|---|
\begin{figure}[H] | 可用 | 圖片留在文字中的原位。 |
\newfloat, \floatstyle, \restylefloat | 不支援 | 會被略過並在「問題」分頁中註記,它們的參數會以文字印出。 |
wrapfigure, wraptable | 部分支援 | 帶圖說的一般置中圖片或表格。文字不會繞著它排列,寬度也會被忽略。 |
sidewaysfigure, sidewaystable | 部分支援 | 一般的圖片或表格,不會旋轉。 |
landscape(pdflscape、lscape) | 部分支援 | 內容保留在一般頁面上。 |
turn、rotate 環境 | 不支援 | 內容會保留但不會旋轉,角度會以文字印出。 |
範例
[H] 讓圖片留在兩個段落之間:
[H] 把圖片放在這裡
John Doe measured the length of 44 rods.
\begin{figure}[H]
\centering
\fbox{Histogram of the rod lengths}
\caption{Rod lengths.}
\end{figure}
Most rods are close to the mean.wrapfigure 會變成一般的置中圖片,文字在它下方繼續:
不繞排的 wrapfigure
\begin{wrapfigure}{r}{0.4\textwidth}
\centering
\fbox{Portrait}
\caption{Erika Mustermann.}
\end{wrapfigure}
Erika Mustermann has led the lab since 2021. In a TeX installation
this paragraph would flow around the portrait on the right; here it
starts below the figure.sidewaystable 會保留內容,但不旋轉:
sidewaystable 不會旋轉
\begin{sidewaystable}
\centering
\caption{A wide table.}
\begin{tabular}{lrrrr}
Year & Q1 & Q2 & Q3 & Q4 \\
2025 & 44 & 47 & 51 & 50 \\
\end{tabular}
\end{sidewaystable}相容性
- 從 TeX 安裝環境搬到這裡:文件可以排版。繞排的圖片會顯示成全寬的浮動體,旋轉的浮動體會保持直立,所以很寬的表格可能會超出邊界。
- 從這裡搬到 TeX 安裝環境:文件在那裡不需修改就能編譯,繞排和旋轉也會套用。
完整手冊在 CTAN 上:ctan.org/pkg/float、ctan.org/pkg/wrapfig 和 ctan.org/pkg/rotating。關於位置的一般說明,請見浮動體:放置圖片與表格。
另請參閱浮動體、圖片與影像和 caption, subcaption。
常見問題
要怎麼讓圖片不要移動?
載入 float 並寫 \begin{figure}[H]。在這裡,使用 h 的位置參數也會讓圖片留在原位。
文字可以繞著圖片排列嗎?
目前還不行。wrapfigure 會顯示成一般圖片,放在後面的文字上方。
本頁的每個範例都在建置網站時由 Scissor LaTeX 排版。 最後更新:2026-11-07