0
\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}

Hello,

I have defined a command called 'Source' that adds an extra line below the caption of an image. My problem is that it seems to be leaving too much space between the word 'Source' and the following source link. I get the underfull hbox badness 10000 error.

Can anyone please tell me what I can do here?

Thanks in advance!

Pranav

enter image description here

1

1 Answer 1

1

I would use the measuredfigure environment from threeparttable, and package url for a proper formatting of urls:

\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

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .