0

Is there a way to shift a theorem from amsthm ? I mean instead of having :

theorem 1.1 (title): BLABLABLA

You would have theorem 1.1 a little bit on the left and blablabla in the same place. Similarly, it would be something like this : (but without tcolorbox, here I don't need the rest of the functionnalities, the style of amsthm is sufficient)

enter image description here

I want that my definition ( which is for now classic ) has the same behavior as the green and orange box. The dimension is not a problem (I'll set the value of shifting )

enter image description here

1 Answer 1

7

You can try something like this. The main point is that the last argument to \newtheoremstyle allows you to put arbitrary code to format the heading. You can make the heading stay within the margins by adjusting \leftskip at the same time you set the body font, i.e. in the third argument to \newtheoremstyle.

Sample first part

Sample second part

\documentclass{article}

\usepackage{amsthm}
\usepackage{lipsum} % for dummy text

\newtheoremstyle{side}{}{}{\advance\leftskip3cm\relax\itshape}{}
{\bfseries}{}{0pt}{%
\makebox[0pt][r]{%
  \smash{\parbox[t]{2.5cm}{\raggedright\thmname{#1}%
  \thmnumber{\space #2}\thmnote{\newline (#3)}}}%
  \hspace{.5cm}}}

\theoremstyle{side}
\newtheorem{theorem}{Theorem}[section]

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}

\begin{document}

\lipsum[1]

\begin{theorem}
  \lipsum[1]
\end{theorem}

\begin{theorem}[Euclid]
  \lipsum[2]
\end{theorem}

\begin{theorem}[Very long name]
  \lipsum[3]
\end{theorem}

\begin{definition}
  \lipsum[1]
\end{definition}

\end{document}
3
  • thank you for your answer. Unfort. that will not be sufficient in my case... I have really small margin on my document. I would need to also move the text... I'll add a picture of what I've for now done so you understand. I search something similar to the boxes green and orange : Commented Apr 30, 2018 at 14:56
  • you see ? that the title is a little bit moved on the side and the text also a little bit. Sorry if I haven't been clear Commented Apr 30, 2018 at 14:59
  • You can adjust \leftskip, see my updated answer Commented May 1, 2018 at 7:43

You must log in to answer this question.

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