1

Here in my work there are two figures in which i want to add captions as Figure (i) and Figure (ii) separately.

MWE:

\documentclass{article}
\usepackage[
a4paper,top=1in,bottom=1in,left=0.7in,right=0.7in,headheight=14.5pt,]{geometry}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
    \large
\begin{tikzpicture}
\tkzDefPoint(4,0){A}
\tkzDefPoint(2,4){B}
\tkzDefPoint(0,0){C}
\tkzDrawPolygon(A,C,B)
\tkzLabelPoints[right,yshift=0pt](A)
\tkzLabelPoints[left,yshift=0pt](C)
\tkzLabelPoints[above,yshift=0pt](B)
\hspace{6cm}
\tkzDefPoint(4,0){A}
\tkzDefPoint(2,4){B}
\tkzDefPoint(0,0){C}
\tkzDrawPolygon(A,C,B)
\tkzLabelPoints[right,yshift=0pt](A)
\tkzLabelPoints[left,yshift=0pt](C)
\tkzLabelPoints[above,yshift=0pt](B)
\end{tikzpicture}

\end{document}
0

You need to have two tikzpictures to put each of them inside a subfigure.

\documentclass{article}
\usepackage[
a4paper,top=1in,bottom=1in,left=0.7in,right=0.7in,headheight=14.5pt,]{geometry}
\usepackage{tkz-euclide}
\usepackage{subcaption}
\usetkzobj{all}
\begin{document}
\begin{figure}
    \centering
    \begin{subfigure}{6cm}
    \centering
    \begin{tikzpicture}
        \tkzDefPoint(4,0){A}
        \tkzDefPoint(2,4){B}
        \tkzDefPoint(0,0){C}
        \tkzDrawPolygon(A,C,B)
        \tkzLabelPoints[right,yshift=0pt](A)
        \tkzLabelPoints[left,yshift=0pt](C)
        \tkzLabelPoints[above,yshift=0pt](B)
    \end{tikzpicture}
    \caption{Local caption}
    \end{subfigure}
    \begin{subfigure}{6cm}
    \centering
    \begin{tikzpicture}
        \tkzDefPoint(4,0){A}
        \tkzDefPoint(2,4){B}
        \tkzDefPoint(0,0){C}
        \tkzDrawPolygon(A,C,B)
        \tkzLabelPoints[right,yshift=0pt](A)
        \tkzLabelPoints[left,yshift=0pt](C)
        \tkzLabelPoints[above,yshift=0pt](B)
    \end{tikzpicture}
    \caption{Local caption}
    \end{subfigure}
    \caption{Normal caption}
    \label{fig:my_label}
\end{figure}
\end{document}

enter image description here

  • In this geometry \usepackage[ top=0.6in,bottom=0.5in,left=0.7in,right=0.5in]{geometry} it is not working. I am stuck. – Maths4Sandy Apr 25 at 9:58
  • @Sandy Well, it is not related to this question at all – user156344 Apr 25 at 13:36

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.