图像源中的间距问题

图像源中的间距问题
\newcommand{\source}[1]{\caption*{\tiny Source:{#1}}}
\begin{figure}[H]
    \begin{subfigure}{.5\textwidth}
        \centering
        \includegraphics[scale=0.9]{./24GHz-Radar-Kit}
    \end{subfigure}%
    \begin{subfigure}{.5\textwidth}
        \centering
        \includegraphics[scale=0.5]{./ds}
    \end{subfigure}
    \caption{Infineon 24GHz Radar Development Kit}
    \source{ https://www.infineon.com/cms/en/product/rf-and-wireless-control/mm-wave-mmic/24-ghz-radar-automotive/channel.html?channel=5546d4624f205c9a014f465e853c277c}
    \label{radardiagram}
\end{figure}

你好,

我定义了一个名为“Source”的命令,该命令在图像标题下方添加了一行。我的问题是,它似乎在单词“Source”和以下源链接之间留了太多空格。我得到了 underfull hbox badness 10000 错误。

谁能告诉我我在这里能做什么?

提前致谢!

普拉纳夫

enter image description here

答案1

我将使用measuredfigure来自的环境threeparttable和包url来正确格式化 URL:

\documentclass[10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[demo]{graphicx}
\usepackage{caption, subcaption, float, threeparttable}
\usepackage[hyphens]{url}
\def\UrlFont{\sffamily}

\newcommand{\source}[1]{\footnotesize Source: {#1}}

\begin{document}

\begin{figure}[H]
  \begin{measuredfigure}
    \begin{subfigure}{.5\textwidth}
      \centering
      \includegraphics[scale=0.9]{./24GHz-Radar-Kit}
    \end{subfigure}%
    \begin{subfigure}{.5\textwidth}
      \centering
      \includegraphics[scale=0.5]{./ds}
    \end{subfigure}
    \caption{Infineon 24\,GHz Radar Development Kit}\label{radardiagram}\medskip
    \source{\url{https://www.infineon.com/cms/en/product/rf-and-wireless-control/mm-wave-mmic/24-ghz-radar-automotive/channel.html?channel=5546d4624f205c9a014f465e853c277c}}
  \end{measuredfigure}
\end{figure}

\end{document} 

enter image description here

相关内容