minipage排版图片时位置偏左,请问怎样与文本和图片标题均保持居中对齐?

发布于 2022-04-24 15:39:07

MWE_minipage_figure.zip

在使用minipage排版图片时,发现两个问题:
(1)图片相对于图片标题往右偏移了一点(没有居中对齐);
(2)图片相对于文本往右偏移了一点(也没有居中对齐)。
需求:图片与文本、图片标题均保持居中对齐。谢谢!

image.png

查看更多

关注者
0
被浏览
5.5k
LaTeXStudio
LaTeXStudio 2022-04-24
这家伙很懒,什么也没写!

仔细看看说明书,提到了的,label 后面要加上 % 来规避空格。

\documentclass[twocolumn]{article}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{showframe}
\title{The Dog}

\begin{document}

The dog or domestic dog (Canis familiaris or Canis lupus familiaris) is a domesticated descendant of the wolf, and is characterized by an upturning tail. The dog is derived from an ancient, extinct wolf, and the modern wolf is the dog's nearest living relative. The dog was the first species to be domesticated, by hunter–gatherers over 15,000 years ago, before the development of agriculture. Due to their long association with humans, dogs have expanded to a large number of domestic individuals and gained the ability to thrive on a starch-rich diet that would be inadequate for other canids.

The dog has been selectively bred over millennia for various behaviors, sensory capabilities, and physical attributes. Dog breeds vary widely in shape, size, and color. They perform many roles for humans, such as hunting, herding, pulling loads, protection, assisting police and the military, companionship, therapy, and aiding disabled people. Over the millennia, dogs became uniquely adapted to human behavior, and the human-canine bond has been a topic of frequent study. This influence on human society has given them the sobriquet of "man's best friend".

The dog or domestic dog (Canis familiaris or Canis lupus familiaris) is a domesticated descendant of the wolf, and is characterized by an upturning tail. The dog is derived from an ancient, extinct wolf, and the modern wolf is the dog's nearest living relative. The dog was the first species to be domesticated, by hunter–gatherers over 15,000 years ago, before the development of agriculture. Due to their long association with humans, dogs have expanded to a large number of domestic individuals and gained the ability to thrive on a starch-rich diet that would be inadequate for other canids.

\begin{figure}[!t]
    \subfigure[]{%
        \begin{minipage}[b]{\columnwidth}
            \centering
            \label{fig_test_case1:a}%
            \includegraphics[width=\columnwidth]{dog.jpeg}
        \end{minipage}
    }\\
    \subfigure[]{%
        \begin{minipage}[b]{\columnwidth}
            \centering
            \label{fig_test_case1:b}%
            \includegraphics[width=\columnwidth]{dog.jpeg}
        \end{minipage}
    }
    \caption{The dog or domestic dog is a domesticated descendant of the wolf. (a) Dog 1; (b) Dog 2.}
    \label{fig_test_case1}
\end{figure}

The dog has been selectively bred over millennia for various behaviors, sensory capabilities, and physical attributes. Dog breeds vary widely in shape, size, and color. They perform many roles for humans, such as hunting, herding, pulling loads, protection, assisting police and the military, companionship, therapy, and aiding disabled people. Over the millennia, dogs became uniquely adapted to human behavior, and the human-canine bond has been a topic of frequent study. This influence on human society has given them the sobriquet of "man's best friend".

The dog or domestic dog (Canis familiaris or Canis lupus familiaris) is a domesticated descendant of the wolf, and is characterized by an upturning tail. The dog is derived from an ancient, extinct wolf, and the modern wolf is the dog's nearest living relative. The dog was the first species to be domesticated, by hunter–gatherers over 15,000 years ago, before the development of agriculture. Due to their long association with humans, dogs have expanded to a large number of domestic individuals and gained the ability to thrive on a starch-rich diet that would be inadequate for other canids.

\end{document}

image.png

2 个回答
LaTeX_Ruan
LaTeX_Ruan 2022-04-24
这家伙很懒,什么也没写!

感谢LaTeXStudio专业和快速的解决方案!
另外,查了一下关于知乎问题:为什么在定义 LaTeX 命令时,很多时候都会在行尾加上百分号 %?
引用刘海洋老师的回答,如下:
image.png

撰写答案

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

发布
问题

分享
好友

手机
浏览

扫码手机浏览