0

I form the following slide by taking the image file from a pdf file [Page 13, Example 1, JS]. enter image description here I dont want the white parts to appear. Is it ppossible to patch those parts by using the background from some other parts of the image? For instance, as in the following one. enter image description here

It would be very great to learn how to place $1$ as text after then.

Another way of doing this would be parsing the original image and then joining appropriate parts.

[JS]: James Stewart - Calculus: Concepts and Contexts - Brooks Cole, 2nd, (2001).

Here is my MWE.

\documentclass[10pt]{beamer}

\usepackage{amsthm}

\usetheme{Warsaw}
\usecolortheme{seahorse}

\begin{document}

\begin{frame}{}{}

\begin{example}

\begin{figure}[htb]
  \centering
  \includegraphics[page=13,clip,trim=112mm 194mm 59mm 45mm]{stewart-ccac.pdf}
  \caption{}
  \label{s2ss1exm1fig1}
\end{figure}

\end{example}

\end{frame}

\end{document}
1
1

I answer your question in two parts:

  1. If you want to annotate a specific part of your image, you can put an \includegraphics inside a TikZ node and then draw over it.
    In TikZ, you can use nodes to place almost anything (in particular, text) in the position you want. The following code adds some dummy texts to your plot:

    \documentclass[]{beamer}
    \usepackage{tikz}
    \begin{document}
    \begin{tikzpicture}
        \node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.9\textwidth]{96D5S.png}};
        \begin{scope}[x={(image.south east)},y={(image.north west)}]
            \node[draw] at (0.72,0.5) {some text};
            \node[draw] at (0.4,0.91) {some text};
        \end{scope}
    \end{tikzpicture}
    \end{document}
    

which yields the following image:

enter image description here

Inside the scope, (0,0) is at the lower left of the picture and (1,1) is at the upper right. The only side-effect of this method is whenever you choose to scale the image differently, you have to correct the coordinates for your annotations.

  1. If you want to remove the white area around the numbers that you specified in your image, I think it is more logical to use a photo editor to do so. Otherwise, I suggest you creating the plot in TikZ from scratch. To do so, you should define the behavior of your function. In the following code, I demonstrate the plot of y=cos(x) using TikZ. You can simply change your equation for your case.

    \documentclass{article}
    \usepackage{pgfplots}
    \pgfplotsset{compat=1.12}
    
    \begin{document}
    
    \begin{figure}[h]
      \centering
      \begin{tikzpicture}
    \begin{axis}%
        [grid=both,
         minor tick num=4,
         grid style={line width=.1pt, draw=gray!10},
         major grid style={line width=.2pt,draw=gray!50},
         axis lines=middle,
         enlargelimits={abs=0.2},
         axis background/.style={fill=green!5}
        ]
    \addplot[domain=-1:3,samples=50,smooth,red] {cos(deg(x))};
            \node[draw] at (1.5,-.2) {0.5};
        \end{axis}
      \end{tikzpicture}
    \end{figure}
    
    \end{document}
    

This code creates the following image:

enter image description here

For your beamer document, you can just keep the figure block.

0

My solution is the following. However, I dont know why I have to use \vspace{-1pt} and \hspace{-1pt}.

\documentclass[10pt]{beamer}

\usepackage{amsthm}

\usetheme{Warsaw}
\usecolortheme{seahorse}

\begin{document}

\begin{frame}{}{}

\begin{example}[4 Pieces]

\begin{figure}[htb]
  \centering
  \includegraphics[page=13,clip,trim=321pt 553pt 171pt 130pt]{stewart-ccac.pdf}
\end{figure}

\end{example}

\end{frame}

%%

\begin{frame}{}{}

\begin{example}[X Pieces]

\begin{figure}[htb]
  \centering
  \includegraphics[page=13,clip,trim=321pt 627.5pt 171pt 131pt]{stewart-ccac.pdf}\vspace{-1pt}\\
  \includegraphics[page=13,clip,trim=321pt 603.3pt 280.3pt 167.5pt]{stewart-ccac.pdf}\hspace{-1pt}\includegraphics[page=13,clip,trim=321pt 603.3pt 280.3pt 167.5pt]{stewart-ccac.pdf}\hspace{-1pt}\includegraphics[page=13,clip,trim=345pt 603.3pt 171pt 167.5pt]{stewart-ccac.pdf}\vspace{-1pt}\\
  \includegraphics[page=13,clip,trim=321pt 591.2pt 261pt 191.65pt]{stewart-ccac.pdf}\hspace{-1pt}\includegraphics[page=13,clip,trim=376.4pt 591.2pt 225.2pt 191.65pt]{stewart-ccac.pdf}\hspace{-1pt}\includegraphics[page=13,clip,trim=364pt 591.2pt 171pt 191.65pt]{stewart-ccac.pdf}\vspace{-1pt}\\
  \includegraphics[page=13,clip,trim=321pt 553pt 171pt 203.8pt]{stewart-ccac.pdf}
\end{figure}

\end{example}

\end{frame}

\end{document} 

Solution shown in the picture of the **OP**

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.