Math & Sciencentheorem and a twoside book

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
NinV
Posts: 69
Joined: Sun Oct 05, 2008 12:57 pm

ntheorem and a twoside book

Post by NinV »

Hi,

I'm using the package ntheorem in a book just to label rules and definitions.

The labels (eq. numbers) appear always on the right side, but I would like that they toggle between the left and the right side, i.e. they should be always at the outer margin.

I did some searching but I couldn't find a solution.

Can someone help me?

Thanks a lot.
Nino
Window + MiKTeX 2.7
Ubuntu + TexLive + Kile
Xandros (eeePC) + TeTex + TexMaker

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

ntheorem and a twoside book

Post by gmedina »

Hi, Nino

It would be really helpful if you provide a more detailed explanation of your intent as well as a minimal compilable version of the way in which you are using ntheorem.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
NinV
Posts: 69
Joined: Sun Oct 05, 2008 12:57 pm

ntheorem and a twoside book

Post by NinV »

Hi, gmedina!

You're right: sorry!

I attach the minimal compilable version and an image of the pdf I get from the original version. I would like to have the [Reg. X] on the same margin as the page number.

It's wondering that the minimal version behave correctly!

Thank you very much for your attention.
Nino
ntheorem.gif
ntheorem.gif (7.6 KiB) Viewed 3036 times
minimal.tex
(4.7 KiB) Downloaded 268 times
Window + MiKTeX 2.7
Ubuntu + TexLive + Kile
Xandros (eeePC) + TeTex + TexMaker
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

ntheorem and a twoside book

Post by gmedina »

Hi, Nino

you could take advantage of margin notes to easily achieve what you desire. Take a look at the following example in which I used the \marginnote command provided by the homonimous package:

Code: Select all

\documentclass[a5paper,headsepline,titlepage,10pt,normalheadings,DIVcalc,twoside]{scrbook}
\usepackage[marginparsep=4pt]{geometry}
\usepackage[italian]{babel}
\usepackage[thref]{ntheorem}
\usepackage{marginnote}

\makeatletter
\newtheoremstyle{mystyle}%
  {\item[]%
    \leavevmode\raise.2em\hbox{%
      \marginnote{\fbox{\theorem@headerfont##1\ ##2}}%
    }%
  }
  {\item[]%
    \leavevmode\raise.2em\hbox{%
      \marginnote{\fbox{\theorem@headerfont##1\ ##2}}%
      }%
      {\theorem@headerfont##3}\theorem@separator\\\nopagebreak%
  }
\makeatother

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

\begin{document}

\begin{reg}[Semina]\label{reg130a}
\textbf{La direzione di semina si sceglie all'inizio di ogni turno}.
\end{reg}

\begin{reg}[Semina - direzione]\label{reg131}
\textbf{Durante la semina, la direzione di semina non pu\`o cambiare}.
\end{reg}

\clearpage

\begin{reg}[kutakata]\label{kasa0211}
\textbf{Quando l'ultimo seme cade in una buca vuota, finisce il turno di un giocatore}.
\end{reg}

\begin{reg}[kutakata - direzione]\label{kasa17c140}
Durante il \textbf{\textit{kutakata}} non si pu\`o cambiare direzione di semina.
\end{reg}

\end{document}
Of course, with your actual settings (the page layout that you defined for your document) you will have to do some adjustments. By the way, I would suggest you to use the geometry package to do the changes to the page layout.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
NinV
Posts: 69
Joined: Sun Oct 05, 2008 12:57 pm

Re: ntheorem and a twoside book

Post by NinV »

Hi, gmedina!

Thank you very much for your help.

After some adjustments, as you said, it works very well!

Thank you again,

Nino
Window + MiKTeX 2.7
Ubuntu + TexLive + Kile
Xandros (eeePC) + TeTex + TexMaker
Post Reply