4
    \documentclass[12pt]{article}
    \usepackage{fixltx2e,graphicx,amsmath,mathptmx,tikz,tkz-euclide,pgfplots} %for math
    \usetkzobj{all}
    \usetikzlibrary{calc}
    \begin{document}
    This is a square
    \begin{tikzpicture}[thick]
    \coordinate (L) at (0,0);
    \coordinate (M) at (2,0);
    \coordinate (N) at (2,2);
    \coordinate (P) at (0,2);
    \draw 
    (L) node[below left] {\footnotesize{$L$}} --
    (M) node[below right] {\footnotesize{$M$}} --
    (N) node[above right] {\footnotesize{$N$}} --
    (P) node[above left] {\footnotesize{$P$}} -- 
    cycle;
    \tkzLabelSegment[below=2pt](L,M){\footnotesize{$4$cm}}
    \end{tikzpicture}
    Find its area.
    \end{document}

Is there any way to make the text inline with the square?

0
4

You can use the baseline option.

\documentclass[12pt]{article}
\usepackage{fixltx2e,graphicx,amsmath,mathptmx,tikz,tkz-euclide,pgfplots} %for math
\usetkzobj{all}
\usetikzlibrary{calc}
\begin{document}
This is a square
\begin{tikzpicture}[baseline,thick]
\coordinate (L) at (0,0);
\coordinate (M) at (2,0);
\coordinate (N) at (2,2);
\coordinate (P) at (0,2);
\draw
(L) node[below left] {\footnotesize{$L$}} --
(M) node[below right] {\footnotesize{$M$}} --
(N) node[above right] {\footnotesize{$N$}} --
(P) node[above left] {\footnotesize{$P$}} --
cycle;
\tkzLabelSegment[below=2pt](L,M){\footnotesize{$4$cm}}
\end{tikzpicture}
Find its area.
\end{document}

enter image description here

With \begin{tikzpicture}[baseline={(current bounding box.center)},thick], we get

enter image description here

1
  • Yup its working.
    – Shaheryar
    Feb 20 '15 at 14:24

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