2

I use 'mathtoolspackage to define my theorem styles andcleveref` to be able to re-enumerate it. But this package does my old code

\makeatletter
\AtBeginEnvironment{remark}{%
  \patchcmd\@thm{\trivlist}{\list{}{\leftmargin\parindent\rightmargin
\parindent}}{}{}
  \patchcmd\thmt@original@endremark{\endtrivlist}{\endlist}{}{}
}

useless.

Is there a way to get indentation of the body text of the theorem ''remark''? Here is my mwe

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm,thmtools}
\usepackage{lipsum}
\usepackage{cleveref}

\declaretheoremstyle[%
spaceabove=\topsep,
spacebelow=\topsep,
headfont=\small\itshape,
bodyfont=\normalfont\small,
headpunct={.---},
postheadspace=1em,
headformat=\NAME\space\NUMBER,
headindent=\parindent
%   qed=$\blacktriangleleft$
]{remark}
\declaretheorem[style=remark]{remark}


\begin{document}

\begin{remark}
\lipsum[1}
\end{remark}

\end{document}

1 Answer 1

1

With cleveref the patching should be different, because it redefines \@thm.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm,thmtools}
\usepackage{translator}
\usepackage{etoolbox}
\usepackage{cleveref}

\usepackage{lipsum}

\declaretheoremstyle[
  spaceabove=\topsep,
  spacebelow=\topsep,
  headfont=\small\itshape,
  bodyfont=\normalfont\small,
  headpunct={.---},
  postheadspace=1em,
  headformat=\NAME\space\NUMBER,
  %headindent=\parindent,
  %qed=$\blacktriangleleft$,
]{remark}
\declaretheorem[style=remark,name=\translate{Remark}]{remark}

\makeatletter
\preto\remark{%
  \patchcmd\cref@thmnoarg
    {\trivlist}
    {\list{}{\leftmargin\parindent\rightmargin\parindent}}
    {}{}%
  \patchcmd\cref@thmoptarg
    {\trivlist}
    {\list{}{\leftmargin\parindent\rightmargin\parindent}}
    {}{}%
  \patchcmd\thmt@original@endremark{\endtrivlist}{\endlist}{}{}%
}
\makeatother

\begin{document}

\lipsum[3]

\begin{remark}
\lipsum*[4]
\end{remark}

\lipsum[5]

\end{document}

enter image description here

3
  • It works perfectly on LaTeX but not in XeLaTeX. Why? What changes are needed?
    – Dog_69
    Dec 22, 2017 at 16:12
  • @Dog_69 I see no problem with XeLaTeX. Do you get an error or what?
    – egreg
    Dec 22, 2017 at 16:20
  • Yes, it also works. Suddenly it had not effect. But it is working again. Thanks.
    – Dog_69
    Dec 22, 2017 at 16:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .