subfloat的子图如何垂直居中对齐?

发布于 2022-03-17 23:04:36
\documentclass{ctexart}
\usepackage{subfig}
\usepackage{mwe}
\usepackage{graphicx}
\begin{document}
    \begin{figure}[h]
        \centering
        \subfloat[]
        {
            \includegraphics[width=0.3\textwidth]{example-image-golden-upright}
        }\quad
        \subfloat[]
        {
            \includegraphics[width=0.5\textwidth]{example-image-golden}
        }
    \caption{test}
    \end{figure}
\end{document}

image.png

请问如何设置将这两张图在竖直方向居中对齐(也就是右图应该稍微往上一些)?

查看更多

关注者
0
被浏览
4.6k
1 个回答
1210
1210 2022-03-17
道阻且长,行则将至,行而不辍,未来可期
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{floatrow}
\usepackage{subfig}
\usepackage{mwe}
\newsavebox{\tempbox}
\usepackage[left=2.00cm, right=2.00cm, top=2.00cm, bottom=2.00cm]{geometry}
\begin{document}

\begin{figure}%
\centering
\sbox{\tempbox}{\includegraphics[width=0.3\textwidth]{example-image-golden-upright}}%
\subfloat[Big figure]{\usebox{\tempbox}}%
\subfloat[Small figure]{%
\vbox to \ht\tempbox{%
\vfil
\includegraphics[width=0.5\textwidth]{example-image-golden}
\vfil}}%
\caption{Two more sub-floats.}
    \end{figure}
\end{document}

凑合用吧!

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览