I defined a personalized theorem environment, such that, there should be a vertical left bar aligned with the environment and the length of the vertical bar should be exactly as long as the text inside the environment, i.e., the length of the vertical bar should not continue before or after the environment.

The problem is: when the environment split between two pages, the next line after the environment stick to the environment without space whereas when the environment is entirely in one page the next line out of environment is correctly spaced with the environment.

Please see the figures 1 & 2. The line right after "Properties 0.0.1: XXXA" is correctly spaced whereas when the environment split between two pages first line after the environment stuck to the end of the environment

enter image description here

enter image description here

Here are my codes,

%% document class
\documentclass[a4paper, 12pt]{book}
\usepackage{amsthm} %needed for theorem enviorment
\usepackage{amsmath} % needed for command eqref
\usepackage{amssymb} % needed for math fonts
\usepackage[framemethod=tikz]{mdframed} %needed for the left vertical line
\usepackage{etoolbox} %needed to add qed
\renewcommand\qedsymbol{$\blacksquare$} % Make qedsymbole black
% Used to remove extra space from top and bottom of the theorem enviorment

% Used to activate skipbelow in the mdframed enviorment


%Theorem style
\newtheoremstyle{break}% name: break
  {} %Space above
  {} %Space below
  {} %Indent amount
  {\bfseries} % Theorem head font
  {{\vspace{\setparskip}}} %Punctuation after theorem head + space
  {\newline} %Space after theorem head
  {\thmname{#1}\thmnumber{ #2}:\thmnote{ #3}} % Manually specify head (headspec)

% Change theoremstyle to break (personalized theorem style)

% Enviorment

this line is not stuck 

this line is stuck

this line not stuck


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.