1

I would like to use \thesheetsequence in the trim area (sheet-number.tex) as described in the Memoir documentations but the counter does not increment (it always shows 1) and \thelastsheet is always 0. Any idea what may cause this?

[Update] I must also add that this happens in a big project with a lot of packages and small customized configurations. The packages loaded are available here: packages.tex. Unfortunately, ATM I cannot share the complete project or provide a minimal example.

[Update2] I have found that the problem is caused when bidi is loaded. Now the question is how to fix it.

[Update3] Example of code not working is added (also thanks to @daleif):

\documentclass[a4paper]{memoir}
\usepackage{etoolbox}
\usepackage{bidi}
\begin{document}

\def\do#1{\thesheetsequence\newpage}
\docsvlist{1,2,3,4,5,6,7,8,9}

\end{document}
  • 2
    Welcome to TeX.SX! Can you show a small example of what you are attempting to? – egreg Aug 25 '15 at 10:13
  • @egreg Thank you for your answer. An example of what I want to do will follow in the next comment. It works in a "simple" document, but not in my overly sophisticated project. I think I am facing this problem because of some package incompatibility or misconfiguration. Any idea where and how I can find more clues? – Shayanlinux Aug 26 '15 at 20:37
  • code snippet on Gist \quarkmarks \renewcommand*{\tmarktl}{\registrationColour{% \begin{picture}(0,0) \setlength{\unitlength}{1bp}\thicklines \put(-36,0){\line(1,0){24}} \put(0,12){\line(0,1){24}} \put(3,27){\normalfont\ttfamily\fontsize{8bp}{10bp}\selectfont\ Sheet \thesheetsequence} \end{picture}}} \checkandfixthelayout – Shayanlinux Aug 26 '15 at 20:37
  • @Shayanlinux erh, what are we suppose to do with that sniplet in the comment? – daleif Aug 27 '15 at 7:42
  • As for your update, without code, we cannot help. Then you have to learn one of the most basic debugging concepts for your self. Copy the entire project to a new folder. Then start removing stuff, bit by bit. Compile each time. If the problem persists, then the bit you removed probably did not matter. At the end you end up with either knowing exactly what went wrong. Or a minimal example that you can post here. Until then, there is not much we can do. – daleif Aug 27 '15 at 7:45
1

Too big for a comment. As Egreg says you need to show us an example of this.

This MWE works just fine

\documentclass[a4paper]{memoir}
\usepackage{etoolbox}
\begin{document}

\def\do#1{\thesheetsequence\newpage}
\docsvlist{1,2,3,4,5,6,7,8,9}

\end{document}

I'm using etoolbox to give me a loop to produce several pages


bidi is a bit of a beast. In this case bidi happily overwrites \@outputpage without taking into account that others may have added to it.

The sheetsequence is implemented in memoir via

\g@addto@macro{\@outputpage}{\stepcounter{sheetsequence}}

that is, by adding to \@outputpage. That is now gone because of bidi

You can bring it back by adding

\makeatletter
\g@addto@macro{\@outputpage}{\stepcounter{sheetsequence}}
\makeatother

after loading bidi.

  • Thank you for your answer, yes, MWE works fine. Please see my comments on the question. I understand without the example it is not possible to comment on, however I hoped I could get some advice on where and how to look for clues. – Shayanlinux Aug 26 '15 at 20:47
  • @Shayanlinux The best advice on where and how to look for clues is: make a Minimal Working Example. Most likely, you'll find the problem. If not, you've got an example you can post here when asking for help. – cfr Aug 27 '15 at 1:34
  • @daleif Thank you for your advice. I ended up removing packages until it is working. Now I know that there is a conflict between memoir and bidi packages. I don't know anything about LaTeX macros, therefore I don't know if this is something to be fixed from bidi side or from memoir side. I tagged bidi and updated title of the question so its maintainer would also get notified. – Shayanlinux Aug 27 '15 at 8:43
  • oh, I overlooked the author of last comment, thanks @cfr – Shayanlinux Aug 27 '15 at 9:15

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.