There is a problem with the code below, it doesn't work if the environment just starts on the new page (see the attached file, the position of the first \bigoplus on page 2 should be the same as the position of the second!). How could I prevent that? Help is highly appreciated.
Btw, I have no other margin types so this could even be set as a general default for the margins, not only in "dokaz" environment.
Code: Select all
Code, edit and compile here:
\documentclass[b5paper,11pt]{book}\usepackage[frame,a4,center]{crop}\usepackage[latin2]{inputenc}\usepackage{amssymb}\usepackage{lipsum}\usepackage{ifthen}%the position depends on whether the page is odd or even\newenvironment{dokaz}{\noindent{\sc Dokaz.{}} \marginpar{\ifthenelse{\isodd{\thepage}}{\flushleft$\bigoplus$}{\flushright$\bigoplus$}}}{\hspace*{\fill}\nolinebreak[1]\hspace*{\fill}$\square$\vskip.3cm}\begin{document}\lipsum[1]\begin{dokaz}\lipsum[1-2]\end{dokaz}\begin{dokaz}\lipsum[3]\end{dokaz}\begin{dokaz}\lipsum[4]\end{dokaz}\end{document}