'wrapFigure'와 해당 단락이 함께 표시되지 않는 이유는 무엇입니까?

'wrapFigure'와 해당 단락이 함께 표시되지 않는 이유는 무엇입니까?

wrapfig일반적으로 그것을 감싸야 하는 특정 텍스트와 나란히 조판하려는 의도로 사용됩니다. 그러나 근처에 부동 소수점을 많이 사용하면 wrapfig전체 텍스트의 일부가 래핑된 그림에 가깝게 유지되지 않습니다. 또한 그 수치는 나머지 수치와 순서가 맞지 않습니다. 이 문제를 어떻게 해결하나요?

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

내 MWE

\documentclass[a4paper,12pt]{article}

\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{blindtext}
\usepackage[showframe]{geometry}
\usepackage{ragged2e}


\begin{document}

    \newcommand{\commonfigwidth}{0.35\linewidth}

    \begin{figure}
        \centering
        \includegraphics[width=\commonfigwidth]{example-image-a}
        \caption{My Fig}
    \end{figure}


    \begin{figure}
        \centering
        \includegraphics[width=\commonfigwidth]{example-image-b}
        \caption{My Fig}
    \end{figure}

    \begin{figure}
        \centering
        \includegraphics[width=\commonfigwidth]{example-image-c}
        \caption{My Fig}
    \end{figure}

    \begin{wrapfigure}{O}{\commonfigwidth} 
        \includegraphics[width=\linewidth]{example-image-a}
        \centering This is a circuit
    \end{wrapfigure}
    \blindtext

    \begin{figure}
        \centering
        \includegraphics[width=\commonfigwidth]{example-image-b}
        \caption{My Fig}
    \end{figure}

    \begin{figure}
        \centering
        \includegraphics[width=\commonfigwidth]{example-image-c}
        \caption{My Fig}
    \end{figure}

\end{document}

답변1

wrapfigure일반적인 부동 메커니즘과 연결되어 있지 않으므로 두 가지를 모두 사용하는 경우 발생하는 모든 문제를 관리해야 합니다. 여기에서는 다음 페이지에서 컷아웃이 수행되는 것을 방지하면 허용 가능한 출력을 얻을 수 있다고 생각합니다.

    \begin{wrapfigure}[8]{O}{\commonfigwidth} 
    \includegraphics[width=\linewidth]{example-image-a}
    \centering This is a circuit
    \end{wrapfigure}

따라서 8줄로 제한합니다(기본적으로 사용되는 10줄 대신).

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

답변2

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

LaTeX는 환경 wrapfigure내부에 작성되지 않는 한 부동 소수점으로 간주되지 않습니다 . 내부 나 환경 figure에 존재하는 모든 것이 LaTeX가 선택한 모든 페이지에 동시에 표시되어야 합니다. 따라서 좋은 해결 방법은 다음과 같습니다.figuretable

\begin{figure}

    \begin{wrapfigure}{<other wrapfig arguments>} 
        \includegraphics[width=\linewidth]{<image file name>}
    \end{wrapfigure}

  <the text that should wrap the figure>

\end{figure}

이렇게 하면 래핑된 그림 근처에 있어야 하는 단락은 주변의 자료에 부유물이 많더라도 강제로 거기에 머물게 됩니다. 또한 LaTeX는 소스 코드에 표시된 순서대로 모든 부동 소수점을 배치하므로 언급된 순서 문제도 해결됩니다.

\documentclass[a4paper,12pt]{article}

\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{blindtext}
\usepackage[showframe]{geometry}
\usepackage{ragged2e}


\begin{document}

    \newcommand{\commonfigwidth}{0.35\linewidth}

    \begin{figure}
        \centering
        \includegraphics[width=\commonfigwidth]{example-image-a}
        \caption{My Fig}
    \end{figure}


    \begin{figure}
        \centering
        \includegraphics[width=\commonfigwidth]{example-image-b}
        \caption{My Fig}
    \end{figure}

    \begin{figure}
        \centering
        \includegraphics[width=\commonfigwidth]{example-image-c}
        \caption{My Fig}
    \end{figure}

    \begin{figure}

        \begin{wrapfigure}{O}{\commonfigwidth} 
            \includegraphics[width=\linewidth]{example-image-a}
            \centering This is a circuit
        \end{wrapfigure}

    \blindtext

    \end{figure}

    \begin{figure}
        \centering
        \includegraphics[width=\commonfigwidth]{example-image-b}
        \caption{My Fig}
    \end{figure}

    \begin{figure}
        \centering
        \includegraphics[width=\commonfigwidth]{example-image-c}
        \caption{My Fig}
    \end{figure}

\end{document}

관련 정보