
좋은 아침이에요,
여러 페이지에 걸쳐 여러 줄 방정식을 정렬하는 방법에 대한 많은 질문과 튜토리얼을 찾았지만 여러 방정식을 그 사이의 텍스트 단락과 정렬하는 방법을 알 수 없습니다.
내 문제에 대한 최소한의 작업 예는 다음과 같습니다.
\documentclass[10pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{fleqn}
\begin{document}
Since we have
\begin{equation}
e^x = \frac{d}{dx}e^x
\end{equation}
and
\begin{equation}
e^x = \int e^x dx
\end{equation}
one of my students concluded that
\begin{equation}
\int dx = \frac{d}{dx}.
\end{equation}
\end{document}
이는 다음과 같이 컴파일됩니다.
보시다시피 처음 두 방정식은 왼쪽이 동일한 너비를 차지하므로 완벽하게 정렬됩니다. 방정식 3은 왼쪽이 더 넓기 때문에 정렬되지 않습니다. 전체 문서는 아니더라도 적어도 한 페이지에서 모든 등호를 정렬하는 간단한 솔루션을 찾고 있습니다.
내가 작성하고 있는 전체 문서에는 방정식 사이에 여러 줄의 설명이 있으며 때로는 인라인 수학, 참조 등이 포함되어 있으므로 수학 환경 내에서 일반 텍스트로 몇 단어를 간단히 입력하는 솔루션은 실제로 실행 가능하지 않다고 생각합니다.
제 질문이 명확하게 설명되었길 바라며, 좋은 하루 보내시기 바랍니다.
답변1
"수학 환경 내에서 일반 텍스트로 몇 단어를 입력하는" 솔루션이 실행 가능하지 않은 것 같다고 말씀하신 것을 알고 있습니다. 하지만 여전히 \intertext
( amsmath
) 및 \shortintertext
( mathtools
) 명령을 고려하고 싶을 수도 있습니다 .
이를 통해 인라인 수학 및 인용을 포함하여 방정식 사이에 전체 텍스트 단락을 넣을 수 있습니다.
두 명령의 차이점은 간격에 있습니다. \shortintertext
아래 예와 같이 단락 사이의 간격이 더 작습니다.
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{filecontents}
\begin{filecontents}{references.bib}
@inproceedings{TestSmith,
title={This is a Test},
author={Smith, John and Jones, Ben},
booktitle={2016 Placeholder Conference on Citation Testing},
pages={3--4},
year={2016}
}
\end{filecontents}
\begin{document}
The "intertext" and "shortintertext" commands allow you to put text inside an align environment.
\begin{align}
c + c + e^x &= \frac{d}{dx}e^x
\intertext{this is normal "intertext"}
\intertext{It has large spacing between paragraphs}
b + b + b + e^x &= \int e^x dx
\shortintertext{"shortintertext" from the "mathtools" package has smaller spacing}
\shortintertext{like this}
\int dx &= \frac{d}{dx}.
\shortintertext{This works even for multi-line paragraphs, inline math ($x=\alpha+\frac{a}{b+1}$) and citations~\cite{TestSmith}.}
\shortintertext{Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. . Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.}
\int dx &= \frac{d}{dx} + a + a + a.
\end{align}
\bibliographystyle{apalike}
\bibliography{references}
\end{document}
답변2
\intertext
귀하의 요구에 충분하다면 단일 또는 여러 페이지에서 작동합니다.
\documentclass[10pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[fleqn]{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
%\usepackage{fleqn}
\begin{document}
Since we have
\begin{align}
e^x &= \frac{d}{dx}e^x
\intertext{and}
e^x &= \int e^x dx
\intertext{one of my students concluded that.. one of my students concluded that.. one of my students concluded that..}
\int dx &= \frac{d}{dx}.
\end{align}
\end{document}