5

This question already has an answer here:

Problem:

I am getting the error message Option clash for package adjustbox. and am wondering what could be wrong? Any advice how to figure out which of the other packages are generating this error?

Minimal Working Example:

\documentclass{article}
\usepackage{lipsum}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{makeidx}
\usepackage{multicol}
\usepackage{ragged2e}
\usepackage{fancyvrb}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{menukeys}
\usepackage{tikz}
\usepackage{cellspace, graphicx, makecell}
\usepackage{xparse}
\usepackage{cellspace,tabularx}
\usepackage[export]{adjustbox}

\begin{document}

On pc it looks like \tabwin\nobreakspace and on Mac it looks like \tab.

\end{document}

marked as duplicate by Heiko Oberdiek, user11232, Svend Tveskæg, user13907, clemens Aug 30 '15 at 13:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Use \documentclass[export]{article} and then \usepackage{adjustbox} . – user11232 Aug 30 '15 at 11:33
  • 2
    The issue arises because adjustbox is also loaded (indirectly) by tikz. Either issue the instruction \usepackage[export]{adjustbox} before \usepackage{tikz} or, better still, follow Harish's advice to provide the global option export to the \documentclass option. That way, you won't have to worry about how to sequence the loading of these two packages. – Mico Aug 30 '15 at 11:39
  • Thanks for the explanation Mico and for the solution @HarishKumar – kexxcream Aug 30 '15 at 11:40
  • Are you aware you're trying to load cellspace and graphicx twice? (Not that it would matter much but things like this just clutter the preamble…) – clemens Aug 30 '15 at 12:00
  • @clemens Would you care to elaborate and suggest what I could do to improve the preamble? – kexxcream Aug 30 '15 at 12:04
3

adjustbox is explicitly loaded by menukeys, without any options. You can either set the option as an option to \documentclass, or use

\PassOptionsToPackage{export}{adjustbox}

in the preamble. Also, needless to load adjustbox if you load menukeys.

Comment aside, don't load cellspace twice.

  • 2
    It is not needless to load adjustbox explicitly. The fact that the current version of menukeys loads adjustbox is just an implementation detail, which can change in later versions. – Heiko Oberdiek Aug 30 '15 at 11:57

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