정리의 왼쪽과 오른쪽에 있는 수평 공간

정리의 왼쪽과 오른쪽에 있는 수평 공간

정리의 왼쪽과 오른쪽에 수평 공간을 확보하려면 어떻게 해야 합니까? 내 초기 아이디어는 다음과 같은 나쁜 생각을 하는 것이었습니다.

\documentclass{article}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{amsthm}% http://ctan.org/pkg/amsthm

\newtheoremstyle{newplain}  % name of the style to be used
  {}                        % measure of space to leave above the theorem
  {}                        % measure of space to leave below the theorem
  {\addtolength{\leftskip}{2em}\addtolength{\rightskip}{2em}% this is probably bad!!!
   \itshape}                % commands on body of the theorem
  {}                        % measure of space to indent (empty = no indent, \parindent = para indent)
  {\bfseries}               % name of head font
  {.}                       % punctuation between head and body
  {5pt plus 1pt minus 1pt}  % space after theorem head
  {}                        % Manually specify head

\theoremstyle{newplain}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}{Lemma}[section]

\begin{document}

\lipsum[1]

\begin{lemma}
The Lemma says
\begin{equation}
y=mx+c.
\end{equation}
\end{lemma}

\lipsum[2]

\begin{theorem}[Wigner-Eckart theorem]
The Matrix elements of a tensor operator can be rewritten as
\begin{equation}
y=(\partial_x y)x+c.
\end{equation}
This equation does not does not have the correct formatting that was defined above.
\end{theorem}

\lipsum[3]

\end{document}

답변1

다음은etoolbox포장하다 changepage당신 adjustwidth주변의 의 환경 theorem.

중요한 부분은 다음과 같습니다.

\BeforeBeginEnvironment{theorem}{\begin{adjustwidth}{2cm}{2cm}}
\AfterEndEnvironment{theorem}{\endadjustwidth}

2cm적합하다고 생각되는 대로 분명히 변경할 수 있습니다 .

스크린샷

\documentclass{article}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{amsthm}% http://ctan.org/pkg/amsthm
\usepackage{etoolbox}
\usepackage{changepage}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]  % numbered by the sections number

\BeforeBeginEnvironment{theorem}{\begin{adjustwidth}{2cm}{2cm}}
\AfterEndEnvironment{theorem}{\endadjustwidth}

\begin{document}
\lipsum[1]
\begin{theorem}[Wigner-Eckart theorem]
    The Matrix elements of a tensor operator $T_{q}^{(1)}$ can be rewritten as
    \begin{equation}
        y=mx+c
    \end{equation}
\end{theorem}
\lipsum[2]
\end{document}

관련 정보