4

I have a document where sometimes proofs start on a separate page than where their associated claims were stated.

Is it possible to force is so that (unless the statement of the claim is more than one page) the proof will always start on the page where the claim was stated?

Example:

enter image description here

LaTeX Code:

%% LyX 2.2.0dev created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[oneside,english,reqno]{amsart}
\usepackage[T1]{fontenc}
\usepackage[utf8]{luainputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=1cm,bmargin=1cm,lmargin=1cm,rmargin=1cm}
\setcounter{secnumdepth}{5}
\usepackage{amsthm}
\usepackage{amssymb}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\swapnumbers
\theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}[section]
  \theoremstyle{remark}
  \newtheorem{claim}[thm]{\protect\claimname}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage[breaklinks,colorlinks=true,linkcolor=blue,
citecolor=blue, urlcolor=blue]{hyperref}
\usepackage{braket}
\usepackage{mathtools}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}%
\DeclarePairedDelimiter\norm{\lVert}{\rVert}%
\let\oldnorm\norm
\def\norm{\@ifstar{\oldnorm}{\oldnorm*}}
\makeatother
\usepackage{amsfonts}
\usepackage{dsfont}
\renewcommand{\vec}[1]{\mathbf{#1}}
\usepackage[scaled=0.88]{beraserif}
\usepackage[scaled=0.85]{berasans}
\usepackage[scaled=0.84]{beramono}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}
\usepackage[T1,small,euler-digits]{eulervm}
%\numberwithin{section}{chapter}
% make boxes around proofs:
%-------------------
\usepackage[framemethod=tikz]{mdframed}
\surroundwithmdframed[
  hidealllines=true,
  leftline=true,
  bottomline=true,
  innertopmargin=0pt,
  skipabove=\dimexpr\topsep+6pt\relax,
  skipbelow=\topsep,
  innerrightmargin=0pt,
]{proof}
%-------------------

\AtBeginDocument{
  \def\labelitemii{\(\circ\)}
  \def\labelitemiv{\(\star\)}
}

\makeatother

\usepackage{babel}
  \providecommand{\claimname}{Claim}
\providecommand{\theoremname}{Theorem}

\begin{document}
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. 
\begin{claim}
This is a claim.
\begin{proof}
This is the associated proof. 
\begin{eqnarray*}
\hbar & = & \hbar\\
 & = & \hbar\\
 & = & \hbar\\
 & = & \hbar\\
 & = & \hbar\\
 & = & \hbar\\
 & = & \hbar\\
 & = & \hbar\\
 & = & \hbar
\end{eqnarray*}
\end{proof}
\end{claim}
\end{document}
7
  • 2
    Using the theorem and the proof in a minipage should provide them on the same page, but not necessarily on the one you want to have them ;-)
    – user31729
    Commented Dec 23, 2015 at 14:23
  • 1
    If you know how much space is needed for the theorem and the start of the proof, you can use the needspace package. BTW, \rule{1pt}{\dimexpr\textheight-5\baselineskip} is a better way to fill up a page. Commented Dec 23, 2015 at 15:25
  • is this helpful ? tex.stackexchange.com/questions/104098/…
    – Elad Den
    Commented Dec 28, 2015 at 9:28
  • @EladDen, I guess this line: {\leavevmode\unskip\penalty9999 \hbox{}\nobreak\hfill\quad\hbox{$\blacksquare$}} is where it's at but I am not sure exactly how to implement it in my situation.
    – PPR
    Commented Dec 29, 2015 at 7:12
  • I am sorry, the link was not helpful, @ChristianHupfer is, however...
    – Elad Den
    Commented Dec 30, 2015 at 6:47

2 Answers 2

1

You can use needspace (but I don't know in the least how you can do this with LyX).

\documentclass[oneside,english,reqno]{amsart}
\usepackage[T1]{fontenc}
\usepackage[utf8]{luainputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=1cm,bmargin=1cm,lmargin=1cm,rmargin=1cm}
\setcounter{secnumdepth}{5}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{needspace}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\swapnumbers
\theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}[section]
\theoremstyle{remark}
\newtheorem{claimINNER}[thm]{\protect\claimname}
\newenvironment{claim}
 {\par\Needspace{2\baselineskip}\claimINNER}
 {\endclaimINNER}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage[breaklinks,colorlinks=true,linkcolor=blue,
citecolor=blue, urlcolor=blue]{hyperref}
\usepackage{braket}
\usepackage{mathtools}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}%
\DeclarePairedDelimiter\norm{\lVert}{\rVert}%
\let\oldnorm\norm
\def\norm{\@ifstar{\oldnorm}{\oldnorm*}}
\makeatother
\usepackage{amsfonts}
\usepackage{dsfont}
\renewcommand{\vec}[1]{\mathbf{#1}}
\usepackage[scaled=0.88]{beraserif}
\usepackage[scaled=0.85]{berasans}
\usepackage[scaled=0.84]{beramono}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}
\usepackage[T1,small,euler-digits]{eulervm}
%\numberwithin{section}{chapter}
% make boxes around proofs:
%-------------------
\usepackage[framemethod=tikz]{mdframed}
\surroundwithmdframed[
  hidealllines=true,
  leftline=true,
  bottomline=true,
  innertopmargin=0pt,
  skipabove=\dimexpr\topsep+6pt\relax,
  skipbelow=\topsep,
  innerrightmargin=0pt,
]{proof}
%-------------------

\AtBeginDocument{
  \def\labelitemii{\(\circ\)}
  \def\labelitemiv{\(\star\)}
}

\makeatother

\usepackage{babel}
  \providecommand{\claimname}{Claim}
\providecommand{\theoremname}{Theorem}

\begin{document}
A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.

A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.

A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.

A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.

A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. A lot of text
goes here. A lot of text goes here. A lot of text goes here. A lot
of text goes here. A lot of text goes here. A lot of text goes here.
A lot of text goes here. A lot of text goes here. A lot of text goes
here. A lot of text goes here. A lot of text goes here. 
\begin{claim}
This is a claim.
\begin{proof}
This is the associated proof. 
\begin{align*}
A & = B \\
  & = B \\
  & = B \\
  & = B \\
  & = B \\
  & = B \\
  & = B \\
  & = B \\
  & = B 
\end{align*}
\end{proof}
\end{claim}
\end{document}

enter image description here

0

The answer is in @Christian Hupfer's comment.

You mentioned using lyx, so you need to add ERT before your claim starting a minipage.

\begin{minipage}[]{1 \textwidth}

and an ERT after your proof closing the minipage:

\end{minipage}

Make sure your ERT is always in "standard" environment.

For more information about minipage and it's use look it up in ctan, or take a look at this website

Another way is using samepage: add ERT before claim with

\begin{samepage}

And after proof close with

\end{samepage}

As @Christian Hupfer said the minipage might not put the claim and the proof where you want it, changing the options within the minipage [...] or using samepage might solve your placing problem

enter image description here

You must log in to answer this question.

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