그림 위에 라텍스 텍스트가 이상하게 나타납니다.

그림 위에 라텍스 텍스트가 이상하게 나타납니다.

나는 내 그림 위에 몇 가지 설명을 추가하려고했습니다. 그런데 정말 이상해 보이네요. 센터링을 사용했기 때문일 수도 있지만 센터링을 제거하면 사진이 올바르게 배치되지 않습니다. 도와주세요. 감사합니다!

\documentclass{article} 
\usepackage{graphicx}
\usepackage{subcaption}

\begin{document}
\begin{figure}[h!] 
 \caption{Police}
This figure plots the survey respondents' attitudes to contacting police officers for four categories of cybercrime from 2012 to 2014. Panel from (a) to (d) plots police contact relating to online identity theft, and consumer fraud. hated speech, and denial of service, respectively.\break
\\
\\
 \label{Police}
 \centering
 \begin{subfigure}{0.485\textwidth}
     \includegraphics[width=\textwidth]{dentity_Theft_police}
     \caption{Identity Theft}
     \label{fig1:police}
 \end{subfigure}
 \hfill
 \begin{subfigure}{0.485\textwidth}
     \includegraphics[width=\textwidth]{ConsumerFraud_police}
     \caption{Consumer Fraud}
     \label{fig2:police}
 \end{subfigure}
 \medskip
 \begin{subfigure}{0.485\textwidth}
     \includegraphics[width=\textwidth]{RHR_police}
     \caption{Hated Speech}
     \label{fig3:police}
 \end{subfigure}
 \hfill
 \begin{subfigure}{0.485\textwidth}
     \includegraphics[width=\textwidth]{DOS_police}
     \caption{Denial of Service}
     \label{fig4:police}
 \end{subfigure}
\end{figure}

\end{document}

어떤 조언이라도 감사하겠습니다! 여기에 이미지 설명을 입력하세요

답변1

간단히 텍스트를 \parbox.

\documentclass{article} 
\usepackage{graphicx}
\usepackage{subcaption}

\begin{document}
\begin{figure}[h!] 
 \caption{Police}
\parbox{\linewidth}{This figure plots the survey respondents' attitudes to contacting police officers for four categories of cybercrime from 2012 to 2014. Panel from (a) to (d) plots police contact relating to online identity theft, and consumer fraud. hated speech, and denial of service, respectively.}
\medskip
 \label{Police}
 \centering%
 \begin{subfigure}{0.5\textwidth}
     \includegraphics[width=\textwidth]{example-image-a}
     \caption{Identity Theft}
     \label{fig1:police}
 \end{subfigure}%
 \begin{subfigure}{0.5\textwidth}
     \includegraphics[width=\textwidth]{example-image-b}
     \caption{Consumer Fraud}
     \label{fig2:police}
 \end{subfigure}
 \medskip
 \begin{subfigure}{0.5\textwidth}
     \includegraphics[width=\textwidth]{example-image-c}
     \caption{Hated Speech}
     \label{fig3:police}
 \end{subfigure}%
 \begin{subfigure}{0.5\textwidth}
     \includegraphics[width=\textwidth]{example-image-duck}
     \caption{Denial of Service}
     \label{fig4:police}
 \end{subfigure}
\end{figure}

\end{document}

또한 하위 그림의 너비를 변경 0.5\linewidth하고 줄 바꿈을 통해 보기 흉한 "형식 지정"을 제거했습니다. 또한 귀하의 이미지를 제가 사용할 수 있는 이미지로 교체했습니다. 결과

편집하다

아니면 단순히 David Carlisle이 권장하는 대로 수행하세요. 이것도 효과가 있습니다.;-)

답변2

명령

\break
\\
\\
\centering

문제는 다음과 같습니다. \centering발행된 단락에도 영향을 미치고 \\단락을 끝내지 않습니다. \\일반 텍스트에는 사용하지 마세요 .

\medskip또한 (빈 줄 사이) 및 의 위치를 ​​자세히 살펴보십시오 \hfill.

그냥 사용하지 마십시오 [h!]. 사용 가능한 공간이 없으면 대기열을 차단합니다.

\documentclass{article} 
\usepackage{graphicx}
\usepackage{subcaption}

\begin{document}
\begin{figure}[!htp] 

\caption{Police}\label{Police}

This figure plots the survey respondents' attitudes to contacting 
police officers for four categories of cybercrime from 2012 to 2014. 
Panel from (a) to (d) plots police contact relating to online identity 
theft, and consumer fraud. hated speech, and denial of service, 
respectively.

\bigskip

\centering

\begin{subfigure}{0.485\textwidth}
  \includegraphics[width=\textwidth]{example-image}
  \caption{Identity Theft}
  \label{fig1:police}
\end{subfigure}\hfill
\begin{subfigure}{0.485\textwidth}
  \includegraphics[width=\textwidth]{example-image}
  \caption{Consumer Fraud}
  \label{fig2:police}
\end{subfigure}

\medskip

\begin{subfigure}{0.485\textwidth}
  \includegraphics[width=\textwidth]{example-image}
  \caption{Hated Speech}
  \label{fig3:police}
\end{subfigure}\hfill
\begin{subfigure}{0.485\textwidth}
  \includegraphics[width=\textwidth]{example-image}
  \caption{Denial of Service}
  \label{fig4:police}
\end{subfigure}

\end{figure}

\end{document}

여기에 이미지 설명을 입력하세요

관련 정보