5

Around an image, I would like to place parentheses that are large enough to enclose an image. To give you an idea, I tried:

\[
 \left(
  \includegraphics[width=0.2\textwidth]{figurename}
 \right)
\]

However, this does not work, because the parentheses are too small and not properly aligned (too low). Is there a way to get what I want?

  • 1
    I don't think this is a duplicate: the other question deals with braces to the left and below and that requires a completely different treatment, as shown in the answers to that question. Here, the situation is different (parantheses to the left and to the right), and can be handled in a completely different matter. In fact, the solutions given to the other question don't directly apply here. – Gonzalo Medina Apr 14 '13 at 22:02
10

A pmatrix solution:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{amsmath}

\begin{document}

\[
\begin{pmatrix}
\includegraphics{image}
\end{pmatrix}
\]

\end{document}

enter image description here

You can also use

\[
\begin{pmatrix}
& \includegraphics{image} &
\end{pmatrix}
\]

to have some more spacing.

An array solution:

\documentclass{article}
\usepackage[demo]{graphicx}

\begin{document}

\[
\left(
\begin{array}{c}
\includegraphics{image}
\end{array}
\right)
\]

\end{document}

enter image description here

A TikZ solution:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{tikz}
\usetikzlibrary{matrix}

\begin{document}

\begin{tikzpicture}
\matrix [matrix of math nodes,left delimiter=(,right delimiter=)]
{
\includegraphics{image}\\
};
\end{tikzpicture}

\end{document}

enter image description here

The demo option for graphicx simply replaces actual figures with black rectangles; do not use that option in your actual document.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.