如何旋轉(僅)圖形的標題?

如何旋轉(僅)圖形的標題?

我試圖僅旋轉圖形的標題,因為所包含的圖片包含一個大型工作流程,該工作流程垂直延伸以完美適合頁面。但是,圖下方沒有剩餘空間,因此我想將標題旋轉 90 度並將其放置在圖的左側(或右側)。

我在 SE 中可以找到的大多數帖子都與旋轉圖形(例如使用 sidewaysfigure)有關,但不僅僅是標題。請注意,標題相對較大,這意味著我確實想要在這裡旋轉,而不僅僅是使用例如 capbeside 將其放置在右側或左側。

這是我想要得到的範例(黑框代表包含的圖形):

在此輸入影像描述

希望我的問題清楚

-瓊斯

答案1

像這樣:

在此輸入影像描述

\documentclass{article}
\usepackage[export]{adjustbox}
\usepackage{graphics}
\usepackage{array}

\begin{document}
\begin{figure}
\refstepcounter{figure}
\begin{tabular}{c c}
\includegraphics[valign=m]{example-image-a}
    &
\rotatebox[origin=c]{90}{Figure~\thefigure: My rotated caption}
\end{tabular}
\end{figure}

\begin{figure}
\includegraphics{example-image-b}
\caption{Standard caption}
\end{figure}
\end{document}

答案2

我自己也遇到了這個問題,並找到了另一個解決方案。我知道這不是OP的理想選擇,但它看起來更簡單並且對我有用,因此也可能對其他人有用。這個想法是,您可以建立一個橫向頁面,並在該橫向頁面中,僅將影像單獨旋轉 90 度,以便它返回到縱向方向。旁邊的標題將保持橫向模式。嘗試這個:

\documentclass{book}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{lscape}
\usepackage{lipsum}

\begin{document}

\newgeometry{left=1.5cm, right=1cm, top=1.5cm, bottom=1.5cm} % Play around with margins, if necessary
\begin{landscape}
\begin{figure}[p]
\centerline{
\includegraphics[width=8cm, height=22cm, angle=-90]{example-image-c}}
\caption[My short caption]{\lipsum[2]}
\label{fig:mylabel}
\end{figure}
\end{landscape}
\restoregeometry

\end{document}

答案3

試試用這個:

\documentclass{book}
\usepackage{rotating}
\begin{document}

\begin{figure}
\fbox{\vbox to 15pc{\hbox to 10pc{Test}}}%%insert your figure here
\begin{sideways}
\begin{minipage}{10pc}
{\caption{caption test}}
\end{minipage}
\end{sideways}
\end{figure}

\end{document}

相關內容