我试图让定理或定义中的所有文本都缩进,就像书中通常做的那样,但是 hangparas 环境对我来说不起作用,我不知道为什么。这是我的整个测试文件:
\documentclass[12pt]{article}
\usepackage{amsthm}
\usepackage{hanging}
\theoremstyle{definition}
\newtheorem{definitionn}{Definition}[section]
\def \STATEMENT#1{\vspace{8pt}\begin{hangparas}{16pt}{0}#1\par\end{hangparas}\vspace{8pt}}
\def \DEF#1{\STATEMENT{\begin{definitionn}#1\end{definitionn}}}
\begin{document}
\section{Test}
\DEF{
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Sed tempus tempor magna in dignissim. Nunc tempus pharetra
mi id pulvinar. Nam vel purus ac eros varius pulvinar et in justo.
}
\end{document}
使用此代码,结果是
Definition 1.1. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed
tempus tempor magna in dignissim. Nunc tempus pharetra mi id pulvinar.
Nam vel purus ac eros varius pulvinar et in justo.
而我想要实现的是以下任一项:
Definition 1.1. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed
tempus tempor magna in dignissim. Nunc tempus pharetra mi id pulvinar.
Nam vel purus ac eros varius pulvinar et in justo.
Definition 1.1. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed
tempus tempor magna in dignissim. Nunc tempus pharetra mi id pulvinar.
Nam vel purus ac eros varius pulvinar et in justo.
任何帮助,将不胜感激。
答案1
您可以通过\leftskip
和来做到这一点\hangindent
,这是一个示例。
\documentclass[12pt]{article}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem{definitionn}{Definition}[section]
\begin{document}
\section{Test}
\begin{definitionn}
\hangindent=2em
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Sed tempus tempor magna in dignissim. Nunc tempus pharetra
mi id pulvinar. Nam vel purus ac eros varius pulvinar et in justo.
\end{definitionn}
\begin{definitionn}
\leftskip=2em
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Sed tempus tempor magna in dignissim. Nunc tempus pharetra
mi id pulvinar. Nam vel purus ac eros varius pulvinar et in justo.
\end{definitionn}
\end{document}