여러 줄로 된 수학 표시 줄의 나머지 길이를 결정합니다.

여러 줄로 된 수학 표시 줄의 나머지 길이를 결정합니다.
\documentclass{article}
\pagestyle{empty}
\usepackage{mathtools}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\[
  \text{beginning}\land
  \begin{multlined}[t][\linewidth]
   (\text{extremely long and boring junk occupying lots of space})\\\relax
   [\text{a variable substitution in brackets}]
 \end{multlined}
\]
\lipsum[2]
\end{document}

수확량

산출

\linewidth두 번째 수학 행(대괄호 안의 대체)이 이를 넘어가는 대신 오른쪽 텍스트 여백에 오른쪽 정렬되도록 하는 인수 대신 무엇을 말해야 할까요 ? 즉, "오른쪽 여백까지 나머지 줄의 길이"를 어떻게 계산합니까?

(상상할 수 있듯이 이것은 더 큰 실제 예제의 지나치게 단순화된 버전이므로 이 MWE의 경우 multline*대신 사용하는 것을 제안하지 마십시오. 더 큰 예제에서는 이 항목이 다른 블록 수학 환경 내에 중첩되어 있기 때문입니다.)

답변1

패키지를 사용할 수도 있습니다 linegoal(버그가 없다는 것은 아니지만 단일 애플리케이션의 경우에는 괜찮습니다).

\documentclass{article}
\pagestyle{empty}
\usepackage{mathtools}
\usepackage{linegoal}
\usepackage{lipsum}

\begin{document}
\lipsum[1][1-3]
\[
  \text{beginning}\land
  \begin{multlined}[t][\linegoal]
   (\text{extremely long and boring junk occupying lots of space})\\\relax
   [\text{a variable substitution in brackets}]
 \end{multlined}
\]
\lipsum[2][1-3]
\[
  \text{beginning}\land
  \begin{multlined}[t][0.95\linegoal]
   (\text{extremely long and boring junk occupying lots of space})\\\relax
   [\text{a variable substitution in brackets}]
 \end{multlined}
\]
\lipsum[3][1-3]

\end{document}

두 번째 경우에는 주변 공간의 압축을 방지하고 \land여전히 눈에 띄는 센터링을 얻기 위해(그러나 너무 많은 공간을 낭비하지 않기 위해) 원하는 너비를 줄였습니다.

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

답변2

환경은 선 중앙에 배치하므로 multilined오른쪽 여백과 겹치지 않도록 \linewidth앞에 추가한 부분보다 짧아야 합니다.

mathtools패키지 를 로드 하므로 임의의 텍스트 너비를 가져오는 calc매크로를 사용할 수 있습니다 . 이것을 사용하면 환경 앞에 추가한 항목이 있는 경우 너비 \widthof에서 뺄 수 있습니다 (단점은 이 항목을 두 번 입력해야 한다는 점이므로 설정에서 이것이 가능한지 확실하지 않습니다).\linewidthmultilined

\documentclass{article}
\pagestyle{empty}
\usepackage{mathtools}
\usepackage{lipsum}

\begin{document}
\lipsum[1]
\[
  \text{beginning} \land
  \begin{multlined}[t][\linewidth-\widthof{$\text{beginning} \land$}]
   (\text{extremely long and boring junk occupying lots of space}) \\
   [\text{a variable substitution in brackets}]
 \end{multlined}
\]
\lipsum[2]
\end{document}

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

관련 정보