I'm trying to create a document that has labels on different sides on even and odd pages. I would like the labels were on the even-numbered pages on the right and on the odd-numbered pages on the left.




%stare wartości: \textheight 26cm \textwidth 17cm \topmargin -2cm \oddsidemargin -0.5cm

\textwidth 15.5cm 
\textheight 23.5cm 
\topmargin -1cm 
\oddsidemargin 0cm 
\evensidemargin 0cm 



H(0,t)=ue^{-t} \sum_{i=0}^{\infty} \frac{(tu)^i}{i!} = ue^{-t(1-u)}



Is it possible to do this?


A simple hack to achieve is as given below:

  \expandafter\gdef\csname eqn@#1\endcsname{#2}%
                        \hskip -\displaywidth(\theequation)}}
     {\expandafter\ifodd\csname eqn@\theequation\endcsname\hbox{\@reqnnum}%
    \ifcase\@eqcnt \def\reserved@a{& & &}\or \def\reserved@a{& &}%
     \or \def\reserved@a{&}\else%
       \@latex@error{Too many columns in eqnarray environment}\@ehc\fi%
     \reserved@a \if@eqnsw\eqnWrite%
     {\expandafter\ifodd\csname eqn@\theequation\endcsname\@reqnnum%

Place this code just before \begin{document}.

  • Now on the pages where the equation is at the top of the page (before the equation on the site is max one line of text), label for this equation is on the opposite side. The program does not recognize the reference to the labels \eqref{} inserts instead "(??)".
    – Agnieszka
    Jul 7 '13 at 11:18
  • Pardon me, but where is makeatother? ;) Pretty cool TeXhack! Jul 7 '13 at 12:28
  • @Agnieszka I have updated the code, now cross-reference and equation appearing after pagebreak will appear correctly. Please note that you need to run twice to get the equation number appear correctly in the margins. @SeanAllred \makeatother is not a must :-)
    – Jagath
    Jul 7 '13 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.