自适应大小/位置的箭头符号指向下一行

自适应大小/位置的箭头符号指向下一行

我想使用向下弯曲的箭头符号来表示“下一行继续”。我正在使用scalefnt并间接从中获取符号来调整箭头的大小mnsymbol,以避免软件包冲突。

\documentclass{memoir}
\usepackage{amsmath}
\usepackage{scalefnt}

% in order to not load package "mnsymbol":
\DeclareFontFamily{U}{MnSymbolA}{}
\DeclareFontShape{U}{MnSymbolA}{m}{n}{
  <-6> MnSymbolA5
  <6-7> MnSymbolA6
  <7-8> MnSymbolA7
  <8-9> MnSymbolA8
  <9-10> MnSymbolA9
  <10-12> MnSymbolA10
  <12-> MnSymbolA12}{}
\newcommand*{\lcurvearrowdown}{\mathrel{\text{\usefont{U}{MnSymbolA}{m}{n}\symbol{187}}}}
\newcommand*{\nextlineref}{\raisebox{-1.25ex}[0pt][0pt]{\scalefont{1.25}\(\lcurvearrowdown\)}}

\begin{document}

This is text at normal size. \nextlineref \\
This is more text. xxxxxxxxxxxxxxxxxxxxxxx

\begin{small}
This is text at small size. \nextlineref \\
This is more text. xxxxxxxxxxxxxxxxxxxxxxx
\end{small}

\end{document}

我通常使用这个符号来表示“数学公式在下一行继续”,但这个例子使用文本,因为这足以说明问题:

虽然符号在small上下文中是可伸缩的,位置 / 大小 / 与下一行的距离的组合看起来不一致:它更接近正常大小上下文中的字母“x”。为什么会这样?怎样纠正?顺便说一下,行间距在这里可能起到一定的作用。

(附录/小评论:刚才我意识到箭头可能不应该在视觉上靠近“x”字母...无论如何,我的问题仍然完全一样,因为它是一致性我所问的;我刚刚注意到的可以通过\scalefont\raisebox因素的正确组合轻松调整,我不会在这篇文章中改变,以避免混淆。)

答案1

这种奇怪行为背后的原因是,您没有结束受字体大小切换影响的组内的段落,因此应用\baselineskip的与中的相同,\normalsize从而产生了提到的不一致;一旦您结束组内的段落,就会\baselineskip应用正确的值,问题就会消失:

\documentclass{memoir}
\usepackage{amsmath}
\usepackage{scalefnt}

% in order to not load package "mnsymbol":
\DeclareFontFamily{U}{MnSymbolA}{}
\DeclareFontShape{U}{MnSymbolA}{m}{n}{
  <-6> MnSymbolA5
  <6-7> MnSymbolA6
  <7-8> MnSymbolA7
  <8-9> MnSymbolA8
  <9-10> MnSymbolA9
  <10-12> MnSymbolA10
  <12-> MnSymbolA12}{}
\newcommand*{\lcurvearrowdown}{\mathrel{\text{\usefont{U}{MnSymbolA}{m}{n}\symbol{187}}}}
\newcommand*{\nextlineref}{\raisebox{-1.25ex}[0pt][0pt]{\scalefont{1.25}\(\lcurvearrowdown\)}}

\begin{document}

This is text at normal size. \nextlineref \\
This is more text. xxxxxxxxxxxxxxxxxxxxxxx

{\small
This is text at \verb+\small+ size. \nextlineref \\
This is more text. xxxxxxxxxxxxxxxxxxxxxxx\par
}

{\footnotesize
This is text at \verb+\footnotesize+ size. \nextlineref \\
This is more text. xxxxxxxxxxxxxxxxxxxxxxx\par
}

\end{document}

在此处输入图片描述

顺便说一下,字体大小开关是没有参数的命令,例如{\small some text\par}(括号是为了保持更改本地化,\par以防使用多行并\baselineskip应用适当的值)。

答案2

您可以使用\hookleftarrowcarriagereturn(dingbat},例如

\newcommand\nextline{\raisebox{-1.25ex}[0pt][0pt]{$\hookleftarrow$}}
\newcommand\nextlines{\raisebox{-1ex}[0pt][0pt]{\small\carriagereturn}}

一位 MWE 表示:

\documentclass{memoir}
\usepackage{dingbat}
%\usepackage{scalefnt}
\newcommand\nextline{\raisebox{-1.25ex}[0pt][0pt]{$\hookleftarrow$}}
\newcommand\nextlines{\raisebox{-1ex}[0pt][0pt]{\small\carriagereturn}}

\begin{document}

This is text at normal size. \nextline \\
This is more text. xxxxxxxxxxxxxxxxxxxxxxx\par

\begin{small}
This is text at small size. \nextline \\
This is more text. xxxxxxxxxxxxxxxxxxxxxxx\par
\end{small}

\begin{footnotesize}
This is text at footnote size. \nextline \\
This is more text. xxxxxxxxxxxxxxxxxxxxxxx\par
\end{footnotesize}

This is text at normal size. \nextlines \\
This is more text. xxxxxxxxxxxxxxxxxxxxxxx\par

\begin{small}
This is text at small size. \nextlines \\
This is more text. xxxxxxxxxxxxxxxxxxxxxxx\par
\end{small}

\begin{footnotesize}
This is text at footnote size. \nextlines \\
This is more text. xxxxxxxxxxxxxxxxxxxxxxx\par
\end{footnotesize}

\end{document}

在此处输入图片描述

答案3

您也可以使用通常的过度杀伤 该选项tikz为您提供了调整箭头尖、颜色、线条样式等方面的所有灵活性tikz。下面列出了一些选项:

在此处输入图片描述

代码:

\documentclass{memoir}
\usepackage{tikz}

\newcommand{\NextLineRef}[1][]{%
    \tikz [overlay,remember picture] \draw [->, out=-10, in=20, distance=0.25cm, thick, #1] 
        (0,0.5ex) to (0,-1.25ex);
}

\begin{document}

This is text at normal size. \NextLineRef[red] \\
This is more text. xxxxxxxxxxxxxxxxxxxxxxx

This is text at normal size. \NextLineRef[red, -latex, shorten >= -0.5ex] \\
This is more text. xxxxxxxxxxxxxxxxxxxxxxx


{\small
This is text at \verb+\small+ size. \NextLineRef[orange, -latex, distance=1.5cm] \\
This is more text. xxxxxxxxxxxxxxxxxxxxxxx\par
}

{\footnotesize
This is text at \verb+\footnotesize+ size. \NextLineRef[blue, densely dotted] \\
This is more text. xxxxxxxxxxxxxxxxxxxxxxx\par
}

{\small
This is text at \verb+\small+ size. \NextLineRef[green, distance=1.5cm, out=5, in=10] \\
This is more text. xxxxxxxxxxxxxxxxxxxxxxx\par
}

\end{document}

相关内容