1

I want the letter to align exactly with the images(little righter). Here is my code

\begin{figure}
        \subfloat[\label{fig1}]{
            \includegraphics[scale=0.74]{varnode.pdf}}\qquad \qquad 
        \subfloat[\label{fig2}]{
            \includegraphics[scale=0.74]{checknode.pdf}}
\end{figure}

and here is the result

image

1 Answer 1

0

You've inserted a spurious space as part of the image placement:

enter image description here

\documentclass{beamer}

\usepackage{subfig}

\begin{document}

\begin{frame}

\begin{figure}
  \subfloat[\label{fig1}]{
    \includegraphics[scale=0.2]{example-image-a}}\qquad \qquad 
  \subfloat[\label{fig2}]{%
    \includegraphics[scale=0.2]{example-image-b}}
\end{figure}

\end{frame}

\end{document}

Note how (a) has a mis-aligned placement, while (b) is perfectly centred. That's because of the use of % around the line-break inside the \subfloat. Without it, there's actually an extra space set before the image, pushing it over slightly to the right (i.e., pushing the caption over slightly to the left).

For more on this topic, see What is the use of percent signs (%) at the end of lines?

You must log in to answer this question.

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