When using the TikZ externalization library within a \ffigbox from the floatrow package, the external image is created two times. The reason is, that the argument of \ffigbox gets parsed two times. Obviously the result is as expected, but I would nevertheless like to prevent the generation of those unnecessary duplicates. How can one achieve that?

Here's a MWE to start with:




  • 1
    Welcome to TeX.SX! You may have a look on our starter guide. May 19, 2013 at 22:19
  • Please note that using \tikzsetnextfilename does avoid the duplicate files. However the external image will contain two pages with the same content. So, strictly speaking, this does not prevent the redundancy.
    – michel
    May 19, 2013 at 23:35
  • I guess you need to dig in the bowels of the package and add \tikzexternaldisable and \tikzexternalenable around the 2nd parsing of the file argument. Maybe possible with the \patchcmd command from etoolbox?
    – Martin H
    May 20, 2013 at 1:41
  • @MartinH Thanks for suggesting \patchcmd – I wasn't aware of it. But I was already fearing I would need to dive in the code of floatrow.sty and had a quick look. I am not sure if I can read that (it looks a lot like Fortran to me...)
    – michel
    May 20, 2013 at 8:49

1 Answer 1


As a preliminary solution I propose a dirty hack:





\usepackage{calc} % needed just for demonstration


Obviously a real use case would look more complicated, but often one is in the lucky position of knowing width and height of one's graphics. (In the example I worked around it with the help of \widthof{a} from the calc package.)

Of course it is annoying to type the if clause every time one uses a \ffigbox. This may be circumvented by defining a macro.

I would have preferred a solution using \tikzifexternalizing or similar. The problem with this approach is, that when disabling externalization of a usually externalized image only during externalization itself, makes the externalization dizzy...

You must log in to answer this question.

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