8

Lyx question here, I think it applies to no particular version. When I include external graphics, Lyx automatically adds

\usepackage{graphicx}

to the beginning of the generated TEX file. However, my layout file requires a \usepackage import to be called before graphicx is imported. The only way I can currently render my document correctly is by generating the tex, and then manually moving the line \usepackage{graphicx} down to the % User specified LaTeX commands. section.

Is there any way to tell LyX NOT to add this package automatically?

5

Go to Document > Settings > Local Layout and put

provides graphicx 1

Click on Validate, then click "OK".

What this does is it tells LyX "I'm taking care of loading the graphicx package, don't worry about." Then the responsibility is on you.

To find out more details, consider reading Help > Customization > 5.3.4 General text class parameters. (thanks to Davïd for pointing this out).

  • 1
    Hi, can't upvote, would've done. If i forget tomorrow, please ping me. To the point: Any thoughts on chat.stackexchange.com/transcript/message/30136736#30136736? – Johannes_B Jun 5 '16 at 19:12
  • 1
    Perhaps worth adding that documentation on this solution is found in the LyX Help: Help > Customization > 5.3.4 General text class parameters > Provides.... – Dɑvïd Jun 5 '16 at 21:21
  • @Johannes_B thanks for letting me know about that. A community wiki is a good idea. We have a wiki at wiki.lyx.org and it is open to anyone. The developers already put comments regarding the transition in the release notes, but it would be great to have a user-led effort that is less technical than what the developers write. – scottkosty Jun 6 '16 at 4:09
  • @Davïd great idea, I updated the answer. Thank you. – scottkosty Jun 6 '16 at 4:10
  • @Johannes_B by the way I just started a new room with the user who mentioned it. Thanks for making me aware of the issue. – scottkosty Jun 6 '16 at 4:12

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.