I have a problem, that seems to be quite common : code expansion.

I have declared a command, that use an other command that use adjustbox. So far so good, until I need to pass to the first command a itemsize as an argument.

Here is my code :




    \adjustbox{margin=10mm 0 0 0}{
        First arg : #1
        \textbf{Second arg} : #2

\section{This works ok}
    first argument, no code, works ok
    second argument, no code works ok too

\section{This doen't works}
        \item item 1
        \item item 2
        \item item 3

I think I have to use commands like \expandafter and such, but I really don't manage to understand where to put it to make it works.


  • Maybe useful latex.org/forum/viewtopic.php?t=11357 – Bobyandbob Feb 9 '18 at 9:10
  • Ok, but isn't a solution for list only ? couldn't it happen on other kind of usage ? – iXô Feb 9 '18 at 9:17
  • Yes it is. But you could put itemes into list. Just an idea. – Bobyandbob Feb 9 '18 at 11:07
  • The problem is not expansion but the box. Why do you use \adjustbox here? – Ulrike Fischer Mar 23 '18 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.