3

I've made this enviroment:

\newenvironment{rjesenje}{
\emph{\textbf{Rješenje:}}}{\vspace{0.1cm} 
\begin{flushright}
$\clubsuit $
\end{flushright}
}

And in my work I've got this output. enter image description here

How do I force the symbol to stay on the same page?

1 Answers1

1

Try using ntheorem and the nonumberplaintheorem style. The placement of endmarks is automatic (even if the environment ends up in displayed equations). Here is a possible code:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{lipsum}

\usepackage{amsmath}
\usepackage[thmmarks, amsmath, thref]{ntheorem}


\theoremstyle{nonumberplain}
\theoremheaderfont{\itshape\bfseries}
\theoremseparator{:}
\theorembodyfont{\normalfont}
\theoremsymbol{\ensuremath{\clubsuit}}
\newtheorem{rjesenje}{\hskip\parindent Rješenje}

\begin{document}

\begin{rjesenje}
  \lipsum[2-6] So
  \begin{equation*}
    \{x  ∈ E: x = 2\} = \{2\}\text{.}
  \end{equation*}
\end{rjesenje}

\end{document} 

enter image description here

Bernard
  • 271,350
  • It says: ! Package ntheorem Error: Theorem style plain already defined. – zermelovac May 23 '16 at 20:03
  • 1
    Probably you're loading amsthm. You can't use it with ntheorem. However you have a compatibility mode for ntheoremwith the amsthm option. – Bernard May 23 '16 at 20:10