我一直在尝试修复这个问题,但无济于事。有没有办法移动附图中旋转文本的对齐方式? 我正在使用 LLNCS 文档类。我当前的代码是
\usepackage{graphicx}
\usepackage{booktabs, makecell, tabularx}
\usepackage{rotating}
\usepackage[export]{adjustbox}
\begin{figure*}[t!]
% \setlength\tabcolsep{1pt}
\settowidth\rotheadsize{Unhyperlink}
\begin{tabularx}{0.8\linewidth}{c c c c c}
\rothead{{Hyperlink}} & \includegraphics[width=0.13\paperwidth]{img.jpg}
& \includegraphics[width=0.13\paperwidth]{img.jpg}
& \includegraphics[width=0.13\paperwidth]{img.jpg}
& \includegraphics[width=0.13\paperwidth]{img.jpg}\\
% \addlinespace[1pt]
% \hline
\rothead{{Unhyperlink}} & \includegraphics[width=0.13\paperwidth]{img.jpg}
& \includegraphics[width=0.13\paperwidth]{img.jpg}
& \includegraphics[width=0.13\paperwidth]{img.jpg}
& \includegraphics[width=0.13\paperwidth]{img.jpg}\\
\end{tabularx}
\caption{Contoh}
\label{fig_seq}
\end{figure*}
答案1
无需使用(和加载)tabularx
如果您不打算插入 -column X
。此外,最好根据\linewidth
(或\textwidth
)而不是设置元素。索引(和)\paperwidth
中的垂直错位可以通过旋转ed 版本以及输入的垂直对齐来纠正,这要归功于Hyperlink
Unhyperlink
\smash
c
v
align
adjustbox
。
\documentclass{llncs}
\usepackage[export]{adjustbox}
\begin{document}
\begin{figure}
\begin{tabular}{ *{5}{c} }
~\rotatebox[origin=c]{90}{\smash{Hyperlink}}~~
\includegraphics[valign=c,width=0.2\linewidth]{example-image}
& \includegraphics[valign=c,width=0.2\linewidth]{example-image}
& \includegraphics[valign=c,width=0.2\linewidth]{example-image}
& \includegraphics[valign=c,width=0.2\linewidth]{example-image} \\ \\
~\rotatebox[origin=c]{90}{\smash{Unhyperlink}}~~
\includegraphics[valign=c,width=0.2\linewidth]{example-image}
& \includegraphics[valign=c,width=0.2\linewidth]{example-image}
& \includegraphics[valign=c,width=0.2\linewidth]{example-image}
& \includegraphics[valign=c,width=0.2\linewidth]{example-image}
\end{tabular}
\caption{A figure}
\end{figure}
\end{document}
答案2
使用您已加载的包valign=c
中的选项:adjustbox
\documentclass{article}
\usepackage[demo]{graphicx} %<---- remove demo option in real document
\usepackage{booktabs, makecell, tabularx}
\usepackage{rotating}
\usepackage[export]{adjustbox}
\begin{document}
\begin{figure*}[t!]
% \setlength\tabcolsep{1pt}
\settowidth\rotheadsize{Unhyperlink}
\begin{tabularx}{0.8\linewidth}{c c c c c}
\rothead{{Hyperlink}} & \includegraphics[width=0.13\paperwidth, valign=c]{img.jpg}
& \includegraphics[width=0.13\paperwidth, valign=c]{img.jpg}
& \includegraphics[width=0.13\paperwidth, valign=c]{img.jpg}
& \includegraphics[width=0.13\paperwidth, valign=c]{img.jpg}\\
\addlinespace
% \hline
\rothead{{Unhyperlink}} & \includegraphics[width=0.13\paperwidth, valign=c]{img.jpg}
& \includegraphics[width=0.13\paperwidth, valign=c]{img.jpg}
& \includegraphics[width=0.13\paperwidth, valign=c]{img.jpg}
& \includegraphics[width=0.13\paperwidth, valign=c]{img.jpg}\\
\end{tabularx}
\caption{Contoh}
\label{fig_seq}
\end{figure*}
\end{document}