GeneralExamples in LaTeX Companion

LaTeX specific issues not fitting into one of the other forums of this category.
NinV
Posts: 69
Joined: Sun Oct 05, 2008 12:57 pm

Examples in LaTeX Companion

Post by NinV »

OK, I succeeded to 'correct' it! Now it works fine for me.

Code: Select all

\documentclass[10pt,a4paper,twoside]{book}
\usepackage[thref]{ntheorem}
\usepackage{ifthen}

\makeatletter
\newcounter{pl}
\renewtheoremstyle{marginbreak}%
  {\stepcounter{pl}\label{pl-\thepl}%
    \ifthenelse{\isodd{\pageref{pl-\thepl}}}
     {
      \item[\rlap{\vbox{\hbox{\theorem@headerfont
            \llap{\fbox{##1 ##2}}\hskip\labelsep\relax
            \theorem@separator}\hbox{\strut}}}]}
     {
      \item[\hskip1.7cm\rlap{\vbox{\hbox{\theorem@headerfont
            \rlap{\hspace{1.1\textwidth}\fbox{##1 ##2}}\hskip\labelsep\relax
            \theorem@separator}\hbox{\strut}}}]\hskip-1.7cm}
  }
  {\stepcounter{pl}\label{pl-\thepl}%
    \ifthenelse{\isodd{\pageref{pl-\thepl}}}
         {\item[\rlap{\vbox{\hbox{\theorem@headerfont
           \llap{\fbox{##1 ##2}}\hskip\labelsep\relax\
           ##3\theorem@separator}\hbox{\strut}}}]
         }
         {\item[\hskip1.7cm\llap{\vbox{\hbox{\theorem@headerfont
           \rlap{\hspace{1.1\textwidth}\fbox{##1 ##2}}\hskip\labelsep\relax\
           ##3\theorem@separator}\hbox{\strut}}}]\hskip-1.7cm%
         }
  }
\makeatother

\theoremstyle{marginbreak}
  \theoremheaderfont{\normalfont\bfseries}\theorembodyfont{\slshape}
  \theoremsymbol{\ensuremath{\clubsuit}}
  \theoremseparator{:}
  \newtheorem{reg}{Ex.}

\begin{document}

text text text text text text text text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text
\begin{reg}[Test 01]\label{t01}
  Test example one
\end{reg}

\newpage

text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
\begin{reg}[Test 02]\label{t02}
  Test example two
\end{reg}

\end{document}
Thank you very much for your help!
Window + MiKTeX 2.7
Ubuntu + TexLive + Kile
Xandros (eeePC) + TeTex + TexMaker

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply