0

I know this is a long shot since I cannot really post a minimal working example, but I'll try to describe the issue to the best of my capabilities. I'm running pdflatex twice for the compilation.

I have the following testing macro, which produces the expected result at the beginning of the chapter.

\def\myTest{
Text1. \marginnote[left]{right}

Some more text. \marginnote[left]{right}

More text, longer sentence. \marginnote[left]{right}}

enter image description here

Unfortunately, after a few pages, marginnote gets confused.

enter image description here

It looks like the first call to \marginnote[left]{right} fixes the alignment for the following two instances.

One could simply use marginpar. I noticed this issue when trying to use sidecaption, which was putting the text over the figure rather than in the margin.

Original issue

\begin{figure}[H]
  \centering
  \sidecaption{Something.}
  \sidecaption{Something.}
  \caption{Disappeared.}
  \input{inference-figs/activation}
\end{figure}

enter image description here

6
  • Seems difficult, I've no idea either. There's always the brute force way of learning how it work in the lowest level (read the TeXbook) and trace through the package code (also is there any error/warning message in the log? Don't ignore them)
    – user202729
    Commented Jul 15, 2022 at 6:17
  • No errors. I'll check the warnings. I'm planning to comment/uncomment out sections of the chapter until I identify the culprit. The bad practice of defining macros within the chapter is going to bite back now. Also, I think the right/left counter got corrupted, since I've noticed some quirks in the previous sidecaption text alignment. Anyway, this is much pain…
    – Atcold
    Commented Jul 15, 2022 at 15:22
  • Figured out… Jeez… It was due to \includeonly{}… Running the whole document without it fixed the issue. I mean, life is unfair… Shall I delete this issue? Answer it myself? What's the expected behaviour here?
    – Atcold
    Commented Jul 15, 2022 at 18:42
  • I guess you could answer it yourself (after making a proper MWE...?) Or better, reporting a bug on appropriate places (if it's really a bug)?
    – user202729
    Commented Jul 16, 2022 at 0:00
  • Hum… The MWE would consist in having multiple files and outdated aux outputs. The library is no longer maintained and it's a collection of hacks, which explains why it broke. I think I should simple close or erase this.
    – Atcold
    Commented Jul 18, 2022 at 18:30

2 Answers 2

1

So, it turns out that marginnote relies on updated aux files. If you have outdated ones, caused by using the \includeonly{} and several \include{} commands, you may incur in some glitches.

The solution was generating the whole document without \includeonly{}.

I decided not to delete this question for indexing purposes. Hopefully, it'll help others not waste plenty of time on bug hunting.

1
  • 1
    Right, sometimes it‘s a good idea to delete all files besides your .tex files and compile again.
    – MS-SPO
    Commented Jul 18, 2022 at 18:49
1

For a systematic approach to identify the trouble makers you may want to adapt this one: How to declutter your main.tex .

Including the preamble an adaptation which converges quickly is „50:50“. If your relevant document part consist of A+B, create two versions, with A or B alone. Say A compiles, but B generates errors. Next dive into part B and repeat.

Many times this ends up at faulty or „shady“ lines of code. Sometimes the (nothing-to-see-here) result forces you to think outside the box, which might suggest deleting a file as you did.

1
  • 1
    Yeah, I've used \iffalse-\fi construct to ‘comment out code’ without deleting it or actually commenting it (I already have comments, and I didn't want to get confused). Finally, I noticed that the bug was connected to the number of pages that were generated and not to any particular section. Hence, re-generating without \includeonly{} came to my mind.
    – Atcold
    Commented Jul 20, 2022 at 4:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .