Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
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

1 Answer 1

up vote 10 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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