How can I accomplish something like this:
Basically, I want my text to be "indented" after the first line. It would be great if somebody knew an answer. Ideally I would like to do this, because I want my theorems/proofs to look like this:
In my opinion, it makes the whole format much clearer.
Using the enumitem
package, you can fairly easily muck around with the dimensions of a list:
\documentclass{article}
\usepackage{enumitem}
\usepackage{lipsum}
\pagestyle{empty}
\begin{document}
\lipsum[1]
\begin{itemize}[label={},itemindent=-2em,leftmargin=2em]
\item \lipsum[1]
\end{itemize}
\end{document}
If you want to do this for every paragraph, that's a bit more involved.
It doesn't appear that amsthm
, or even thm-tools
, provide the means for easily creating a theorem with a hanging indent. But, theorem-like environments are built up from \trivlist
. So, if you know what you want, you can define your own theorem style from a list
environment. You'll probably also want to define your own counter to go with it.
To begin to get a theorem-like structure, you can do something like the following:
\newcounter{mytheoremcounter}[chapter]%% to number within chapters
\newenvironment{mytheorem}
{\refstepcounter{mytheoremcounter}%% so ref/labels work as you expect
\begin{list}
{\bfseries\upshape Theorem \arabic{mytheoremcounter}.}
{\setlength{\labelwidth=2em}
\em%
}
\item
}
{\end{list}}
Per @GonzaloMedina
You can get the amsthm
package to work for this purpose. You cleverly sneak the formatting through the argument of a \newtheoremstyle
for the body font. As in
\documentclass{book}
\usepackage{enumitem}
\usepackage{lipsum}
\pagestyle{empty}
\usepackage{amsthm}
\newtheoremstyle{mythrm}%
{0pt}{0pt}
{\hangindent 2.5em}% body font
{}
{\bfseries}
{.}% punctuation
{0.5em}
{}
\theoremstyle{mythrm}
\newtheorem{mytheorem}{Theorem}
\setlength{\parindent}{0pt}
\pagestyle{empty}
\begin{document}
\chapter{Hi}
\lipsum[2]
\begin{mytheorem}{}
\lipsum[2]
\end{mytheorem}
A second theorem
\begin{mytheorem}{}
\lipsum[3]
\end{mytheorem}
\chapter{There}
\begin{mytheorem}{}
\lipsum[2]
\end{mytheorem}
A second theorem
\begin{mytheorem}{}
\lipsum[3]
\end{mytheorem}
\end{document}
amsthm
is not entirely true, as the following example shows (sorry, but the code formatting gets lost in comments): \documentclass{article} \usepackage{amsthm} \usepackage{lipsum} \newtheoremstyle{hindent} {\topsep}{\topsep} {\hangindent 2.5em}{} {\bfseries}{:} {.5em}{} \theoremstyle{hindent} \newtheorem{theo}{Theorem} \begin{document} \begin{theo} \lipsum[4] \end{theo} \end{document}
- Gonzalo Medina