1

This question has been asked before here and here, but I am struggling to make things perfectly work.

I am using beamer, but I guess that does not matter.

This is my code:

\usepackage{adjustbox}
\begin{document}
\begin{frame}{How is it used?}
\justifying
\footnotesize
$$f\left(\adjincludegraphics[valign=c,height=1cm]{cat.jpg} \right)$$
\end{frame}
\end{document}

The result is this:

As you can see, the parenthesis are not perfectly aligned with the image. I admit I am being nitpicky, but one of the nice things about LaTeX is that you can afford to be like that. I attached the image I am using for reference here:

Werner
  • 603,163
Schach21
  • 201
  • 1
  • 6

1 Answers1

2

You can just fiddle with the raise and set vsize options from the adjustbox package until you are happy.

\documentclass{article}
\usepackage{adjustbox}
\begin{document}
\[
  f\left(\adjincludegraphics[valign=c, height=1cm, raise=0.2\baselineskip,
    set vsize={1.3cm}{0cm}]{example-image} \right)
\]
\end{document}

output

David Purton
  • 25,884
  • 3
    Perhaps a relative raise would be more appropriate (something like raise=.2\baselineskip)? – Werner Nov 05 '21 at 02:12