2

I use a rather complex class, built on top of extarticle with twocolumn option. It loads a lot of packages. One of them is floatrow.

Sometimes, I get a very annoying error that can be seen in the screenshot below:


issue


As you can see, the two columns are badly shifted (left column to the right and right column to the left). This only happens when there are figures (not necessarily on the same page of the issue) inside a floatrow environment. Without floatrow, I never got into trouble.

I did not succeed in making a minimal example that reproduces the issue. So I'm looking at a way to track down the issue maybe with some \tracing... commands. How should I proceed?

cjorssen
  • 10,032
  • 4
  • 36
  • 126
  • 2
    I'm afraid this is too generic even for making a guess. – egreg Sep 13 '13 at 11:14
  • @egreg What kind of extra information should I provide? I can provide the whole file and the class but I'm afraid it could be flaged as too localized. That's why I was looking for a "generic" solution. – cjorssen Sep 13 '13 at 11:17
  • I suspect a bad package interaction. Something changes or hooks in the output routine in incompatible ways. – egreg Sep 13 '13 at 11:24
  • 1
    usual rules apply, start with that document and remove all text that you can while it still does it, then (and only then:-) start tracing the output routine, or post it here so someone can. – David Carlisle Sep 13 '13 at 11:27
  • @DavidCarlisle How can I trace the output routine? – cjorssen Sep 13 '13 at 11:33
  • add \tracingall (but this will fill your disk with literally megabytes of log file if you don't agressively trim the example first. Or just the classic "add print statements" debugging system, edit the source and add \show1 \show2 etc at the places you think it should be executing and move them around until you find where it is making the wrong choice. – David Carlisle Sep 13 '13 at 11:42
  • @DavidCarlisle Ok. Thanks to both of you. What should I do with this question? Delete it? – cjorssen Sep 13 '13 at 11:44
  • No leave it open, if you find out which packages clash you could self answer unless it is just a local error, in which case you could close then, or perhaps you will be able to make a postable example... – David Carlisle Sep 13 '13 at 11:47

1 Answers1

2

I finally managed to apply what @egreg and @David Carlisle told me in comments.

Well, I don't know why (and I would be interested in understanding why...), but the culprit seems to be located in the forth line of the definition of \flrow@restyle (in floatrow.sty). Commenting \textwidth\columnwidth out seems to make the issue disappear.

\newcommand\flrow@restyle[1]{%
  \@namedef{#1}{\killfloatstyle\def\@captype{#1}\FR@redefs
    \flrow@setlist{{#1}}%
    %\textwidth\columnwidth <- Error here
    \edef\FBB@wd{\the\columnwidth}%
    \FRifFBOX\@@setframe\relax\@@FStrue\@float{#1}}%
  \@namedef{#1*}{\killfloatstyle\def\@captype{#1}\FR@redefs
    \flrow@setlist{{#1}{widefloat}{wide#1}}%
    \FRifFBOX\@@setframe\relax\@@FStrue\edef\FBB@wd{\the\textwidth}%
    \let\@xdblfloat\@xfloat\relax
    \FR@ifdoubleaswide
     {\if@twocolumn\else\let\@dblfloat\@float\fi}\relax
    \@dblfloat{#1}}%
  \expandafter\let\csname end#1\endcsname\float@end
  \expandafter\let\csname end#1*\endcsname\float@dblend
 \@ifundefined{@rotfloat}{}{%
  \@namedef{sideways#1}{\killfloatstyle\def\@captype{#1}\FR@redefs
    \flrow@setlist{{#1}{rotfloat}{rot#1}}%
    \columnwidth\textheight\edef\FBB@wd{\the\textheight}%
    \FRifFBOX\@@setframe\relax\@@FStrue
    \let\rotfloat@@makebox\float@makebox
    \let\float@makebox\rotfloat@makebox
    \@float{#1}}%
  \@namedef{endsideways#1}{\FBbuildtrue\float@end}
  \ifx\@rotdblfloat\undefined
   \@namedef{sideways#1*}{%
     \flrow@error{%
      You need rotating version 2.10 or newer to do this}%
     \@nameuse{sideways#1}}%
  \else
   \@namedef{sideways#1*}{\killfloatstyle\def\@captype{#1}\FR@redefs
     \flrow@setlist{{#1}{rotfloat}{rot#1}{widerotfloat}{widerot#1}}%
     \columnwidth\textheight\edef\FBB@wd{\the\textheight}%
     \FRifFBOX\@@setframe\relax\@@FStrue
     \let\@xdblfloat\@xfloat
     \let\rotfloat@@makebox\float@makebox
     \let\float@makebox\rotdblfloat@makebox
     \@dblfloat{#1}}%
  \fi
  \@namedef{endsideways#1*}{\FBbuildtrue\float@dblend}}
 \@ifundefined{wrapfloat}{}{%
   \@ifundefined{flrow@WF@rapt}{\let\flrow@WF@rapt\WF@rapt
   \def\WF@rapt[##1]##2{\FRifFBOX\@@setframe\relax\@@FStrue
     \dimen@##2\relax
     \ifdim\dimen@>\z@
       \edef\FBB@wd{\the\dimen@}\FB@fs@wd\dimen@\FBo@wd
     \fi
     \flrow@WF@rapt[##1]{\dimen@}%
       \the\FR@everyfloat\ignorespaces}%
   }{}%
   \@namedef{wrap#1}{\killfloatstyle\def\@captype{#1}%
     \FR@redefs\FBc@wd\z@
     \flrow@setlist{{#1}{wrapfloat}{wrap#1}}%
     \def\WF@floatstyhook{\let\@currbox\WF@box
       \ifFBbuild
         \global\setbox\WF@box\flrow@FB{\wd\WF@box}%
       \else
         \global\let\flrow@typ@tmpset\undefined
         \global\let\WF@box\@currbox
       \fi}%
     \@ifnextchar[\WF@wr{\WF@wr[]}}%]
   \@namedef{endwrap#1}{\endwrapfloat
     \@ifundefined{FloatHBarrier}{}\FloatHBarrier
     }}
 \@ifundefined{sf@@@subfloat}{}{\@ifundefined{c@sub#1}{\newsubfloat{#1}}{}}}
cjorssen
  • 10,032
  • 4
  • 36
  • 126