Math & ScienceWeird included Graphics Output

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Re: Weird included Graphics Output

Post by ghostanime2001 »

can you explain thoroughly what this line means? your description is a bit vague and unclear to new latex users like me.

\raisebox{1.75ex}{\parbox[t]{2in}{\null\includegraphics[width=\linewidth]{Diagram.pdf}}}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Weird included Graphics Output

Post by localghost »

So the line in question is this one.

Code: Select all

\raisebox{1.75ex}{\parbox[t]{2in}{\null\includegraphics[width=\linewidth]{Diagram.pdf}}}
Let's write it in a slightly different form to add comments for explanations.

Code: Select all

\raisebox{1.75ex}{%                                    % raise the following content by the given height
  \parbox[t]{2in}{%                                    % create a box of the given width with alignment to the top
    \null%                                             % create a kind of anchor to fool LaTeX
    \includegraphics[width=\linewidth]{Diagram.pdf}%   % include external graphics file
  }
}
I suggest to do some basic reading [1]. With exception of the \null command (which is just an empty box with zero dimension) you will get detailed explanations for all LaTeX commands and their effects.

[1] View topic: LaTeX Resources for Beginners
Post Reply