Wrapfigure 格式强制使用 \hbox,除非我故意用空 $$ 导致错误

Wrapfigure 格式强制使用 \hbox,除非我故意用空 $$ 导致错误

这是我在使用 wrapfig 包跳过一行时遇到的一个问题\\。在下面的 MWE 中,输出是左侧显示的输出,其中第一段的格式不正确,导致每行都强制显示 underfull 。但是,当我在 之前\hbox插入一个空值时,它会引发错误,但也会使输出显示为右侧的输出,这正是我想要的。我试着厚着脸皮使用,这样不会引发错误,但输出又是左侧显示的图像。理想情况下,应该有某种方法可以更自然地提供右侧的输出。$$\\$ $在此处输入图片描述

下面的 MWE(请注意注释,其中指出放置 $$ 的位置会修复输出布局):

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{wrapfig}
\usepackage[left=2cm,top=3cm,right=2cm,bottom=3cm]{geometry}
\usepackage{amsmath}
\usepackage{graphicx}
\setlength{\parindent}{0cm}

\begin{document}
\begin{wrapfigure}[16]{r}{5.1cm}
\includegraphics[width=5cm,height=5cm]{example-image-a}
\caption{Square vortex lattice}
\label{fig:square_lattice}
\end{wrapfigure} 

Nowadays, the structure of superconductors can be measured experimentally, and lattice structures have indeed been found. This lattice structure is what distinguishes type-II from type-I superconductors: for certain ranges of magnetic field strength, the magnetic field penetrates into the superconductor, resulting in a lattice of flux vortices such as the one shown in figure \ref{fig:square_lattice}. It can be calculated that a triangular lattice results in a slightly lower value of $\beta_A = 1.16$. Indeed, the triangular lattice minimises the total energy of the system, although the difference is small enough that environmental factors can still make the square lattice favourable in real materials\\%Adding $$ before \\ fixes layout somehow.

Although the magnetic field penetrates the superconductor within theses vortices, transport of current with zero resistance is still a possibility in this state. Type-II superconductors can generally keep their zero resistance property up to fields much stronger than those for type-I superconductors, and also have larger critical temperatures. For this reason, type-II superconductors have become prominent in a large variety of practical applications, where often zero resistance is the property of interest, rather than field expulsion. Type-II superconductors have made themselves the more common type, and most contemporary research involves type-II superconductors with exceptional critical temperatures or critical fields.
\end{document}

答案1

\\在段落末尾使用空格命令是错误的。使用空格命令(如 \medskip)来获取段落之间的空格(或者,如果您希望空格始终存在,请更改 \parskip)。

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{wrapfig}
\usepackage[left=2cm,top=3cm,right=2cm,bottom=3cm]{geometry}
\usepackage{amsmath}
\usepackage{graphicx}
\setlength{\parindent}{0cm}

\begin{document}
\begin{wrapfigure}[16]{r}{5.1cm}
\includegraphics[width=5cm,height=5cm]{example-image-a}
\caption{Square vortex lattice}
\label{fig:square_lattice}
\end{wrapfigure}

Nowadays, the structure of superconductors can be measured experimentally, 
and lattice structures have indeed been found. This lattice structure is 
what distinguishes type-II from type-I superconductors: 
for certain ranges of magnetic field strength, the magnetic field penetrates into the 
superconductor, resulting in a lattice of flux vortices such as 
the one shown in figure \ref{fig:square_lattice}. It can be calculated that a 
triangular lattice results in a slightly lower value of $\beta_A = 1.16$.
 Indeed, the triangular lattice minimises the total energy of the system, 
 although the difference is small enough that environmental factors can still 
 make the square lattice favourable in real materials

\medskip
Although the magnetic field penetrates the superconductor within theses vortices, transport of current with zero resistance is still a possibility in this state. Type-II superconductors can generally keep their zero resistance property up to fields much stronger than those for type-I superconductors, and also have larger critical temperatures. For this reason, type-II superconductors have become prominent in a large variety of practical applications, where often zero resistance is the property of interest, rather than field expulsion. Type-II superconductors have made themselves the more common type, and most contemporary research involves type-II superconductors with exceptional critical temperatures or critical fields.
\end{document}

相关内容