调整横向旋转小页面中的图片和标题

调整横向旋转小页面中的图片和标题

标题听起来已经很复杂了,因为我需要在横向模式下使用旋转图像侧面的标题。我尝试了一些间距,如您在注释的行中看到的那样%,但效果不佳。您能否建议任何通用解决方案,而无需单独调整每幅图像的大小,以便图像在垂直和水平方向上都居中,并且长标题不会超出边距?

以下是代码:

\documentclass[12pt,a4paper,fleqn,parskip=half]{scrartcl}
\usepackage{graphicx}
\usepackage{pdflscape}
\usepackage{showframe} %% just to show frames.

\begin{document}

\begin{landscape}
%\vspace*{\fill}
\begin{figure}[H]
 %\vspace*{-3.5cm}
 %\hspace*{3cm}
 \rotatebox[origin=c]{-90}{
  \begin{minipage}{1.0\linewidth}
   \centering
   \includegraphics[scale=1.0,angle=90]{example-image-a}
   \caption{A very very very very very very very very very very very very very very very very very very very very very very very very very very long caption.}
   \label{a}
   \end{minipage}
 }
\end{figure}
%\vspace*{\fill}
\end{landscape}

\end{document}

这是我得到的结果:

示例图像-a

这是一个模型:

小样

答案1

此解决方案可能仅适用于您的情况,不适用于一般问题标题。有关此主题的更多信息,请参阅这个问题

由于除图像之外的所有内容都应与正常纵向模式保持一致,因此您可能只需旋转图像并仅使用 pdf 属性旋转页面,而不是使用pdflandscape。我不得不摆脱浮动环境来控制图像页面上的分页符和 pdf 属性。该capt-of包模拟图形环境以创建适当的标题类型。

\documentclass[12pt,a4paper,fleqn,parskip=half]{scrartcl}
\usepackage{graphicx}
\usepackage{showframe} %% just to show frames.
\usepackage{capt-of}

\newenvironment{rotatepage}%
    {\pagebreak\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 90}}%
    {\pagebreak\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 0}}%

\begin{document}
blindtext

\begin{rotatepage}
  \vspace*{\fill} % this and the the vspace below will center the image vertically
  \centering      % this will center the image horizontally
  \includegraphics[scale=1.2,angle=90]{example-image-a}
  \captionof{figure}{A very very very very very very very very very very very very
     very very very very very very very very very very very very very very long caption.}       
  \label{a} 
  \vspace{\fill}
\end{rotatepage}

blindtext
\end{document}

结果: 在此处输入图片描述

相关内容