0

Actually I made a code, and I want to make my figures in (below) Introduction.

But the results is like this: enter image description here How can I make the figure in Introduction?? (Below the 1.Introducition)

\documentclass[12pt]{article}
%\usepackage[left=40mm,right=40mm,top=40mm,bottom=40mm,a4paper]{geometry}

\usepackage{amsfonts,amsmath,amssymb,amsthm,kotex}

\usepackage{graphicx} \usepackage{times}
\usepackage{bm} \usepackage{amsbsy} \usepackage{indentfirst} \usepackage[all]{xy} \usepackage{curve2e} \usepackage[onehalfspacing]{setspace} \usepackage{setspace} \setstretch{1.6} \usepackage{subcaption} \usepackage{booktabs} \usepackage{multirow}

\counterwithin{equation}{section} \renewcommand{\theequation}{\arabic{section}.\arabic{equation}}

\renewcommand\refname{\centerline{References}} \renewcommand\thesection{\arabic{section}} \renewcommand\thesubsection{\arabic{section}.\arabic{subsection}} \renewcommand\thesubsubsection{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}

\begin{document}

\newtheorem{thm}{Theorem} \numberwithin{thm}{section} \newtheorem{cor}{Corollary} \numberwithin{cor}{section} \newtheorem{lem}{Lemma} \numberwithin{lem}{section} \newtheorem{prop}{Proposition} \numberwithin{prop}{section}

\theoremstyle{definition} \newtheorem{de}{Definition} \numberwithin{de}{section}

\newtheorem{ex}{Example} \numberwithin{ex}{section}

\newtheorem*{rmk}{Remark}

\setlength{\paperwidth}{40mm} \setlength{\paperheight}{40mm}

Why

\section{Introduction}

\begin{figure} \centering \begin{subfigure}{0.4\textwidth} \includegraphics[width=\textwidth]{4.jpg} \label{fig:first} \end{subfigure} \hfill \begin{subfigure}{0.4\textwidth} \includegraphics[width=\textwidth]{5.jpg}

\label{fig:second}

\end{subfigure}

\caption{Canonical forms are the same.} \label{fig:figures} \end{figure}

Come on

JAEMTO
  • 125

1 Answers1

1

You want this:

\documentclass[12pt]{article}

\usepackage{graphicx} \usepackage{subcaption} \usepackage{float}

\begin{document} Why

\section{Introduction}

\begin{figure}[H]
    \centering
    \begin{subfigure}{0.4\textwidth}
        \includegraphics[width=\textwidth]{example-image-a}
        \label{fig:first}
    \end{subfigure}
    \hfill
    \begin{subfigure}{0.4\textwidth}
        \includegraphics[width=\textwidth]{example-image-b}
        \label{fig:second}
    \end{subfigure}

    \caption{Canonical forms are the same.}
    \label{fig:figures}
\end{figure}

Come on

\end{document}

Also, please try to provide a proper minimal working example next time

codecepts
  • 396
  • 1
  • 4
  • I am really sorry because I thought it was a problem of userpackage..... but maybe it is not. I have a question, though, what is difference between \begin{figure}[H] and \begin{figure}[h]?? – JAEMTO Apr 13 '22 at 09:43
  • 1
    @JAEMTO, very big! H prevent floats to float, h will itry to show image where is inserted (if there is suficient space). However, never use just h, beter is ht or htb, ... which enable that in case, that at point of inserting is not sufficient space, float will move to the top of the next page. – Zarko Apr 13 '22 at 09:57
  • 1
    H is provided by the float package. You can read all about it in the doc. – codecepts Apr 13 '22 at 10:15
  • I didnt know [H] command, it looks really useful. Thanks! – JAEMTO Apr 14 '22 at 01:14