I need to render the minipage environment ineffective (the reason is that I need to sometimes compile latex documents for a visually impaired reader with a huge point size, not compatible with the general layout of the document).


fails because of the optional arguments sometimes passed to \begin{minipage}

I guess I can use \renewcommand on \minipage and \endminipage to adapt their definitions from latex.ltx but I was wondering if there isn't a more straightforward way to do it.

  • 1
    Use the xparse package to make a new version of the minipage with 3 optional and one mandatory argument. Something like (untested) \RenewDocumentEnvironment{minipage}{ o o o m }{}{}. – daleif Sep 8 '20 at 10:51
  • 1
    I might have misunderstood. Should the contents of the minipage go away as well? Becasue xparse can handle that as well: just add +b after m in the argument list in my previous comment – daleif Sep 8 '20 at 11:20
  • 1
    Another option is \usepackage{comment}\excludecoment{minipage} – user30471 Sep 8 '20 at 12:54
  • @daleif solution works just fine thanks. And no, I didn't need to clear the contents of the minipage. You should post it as an answer so that I can accept it :-) – wilk Sep 9 '20 at 12:10

Nowadays making macros with multiple optional args is super easy using the xparse package (the contents of which will be added to the latex kernel in a near future)

Minipage takes three optional and one mandatory. So if you just want to remove the effect of Minipage leaving the contents intact use

 \RenewDocumentEnvironment{minipage}{ o o o m }{}{}

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.