0

I'm using LuaTex to draw some UML diagrams in MetaUML. The diagrams appear left align in the page. How do I center them?

I tried \centering before the mplibcode environment and also tried enclosing the environment in center environment. But did not work.

  • 1
    I know you have found the answer, but even so a small MWE would enhance your question. (And the answer...) – Thruston May 19 at 18:40
  • Okay. I will add it to the question and answer – BBloggsbott May 20 at 12:31
2

I just found the solution. Adding \mplibforcehmode makes \centering work for mplibcode environments.

\mplibforcehmode When this macro is declared, every mplibcode figure box will be type- set in horizontal mode, so \centering, \raggedleft etc will have effects. \mplibnoforcehmode, being default, reverts this setting. (Actually these commands redefine \prependtomplibbox. You can define this command with anything suitable before a box.)

Source

| improve this answer | |

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.