I'm trying to make a floating "Tip" box. This is my MWE:




Hello this is a test

Right now it looks like this: output

And this is what I want:



Define a \newcommand instead of a \newenvironment


        Tip:\\ #2

    \tip {Hello this is a test}
    \tip[5cm]{Hello this a wider box}

enter image description here

  • i cant reproduce your result. first \tip command is correct placed, but it overwrite paragraph text. the second one is below of text. i use recent miktex – Zarko Jan 3 at 12:21
  • @Zarko I have rechecked the code and its output first on overleaf and second with Texlive 2018. For me it's ok! – Hafid Boukhoulda Jan 3 at 12:32
  • than i can only concluded that within mitex is something different as in texlive or in `overleaf`` ... – Zarko Jan 3 at 13:12
  • @zarko I realy don't know what to conclude! I don't use miketex. – Hafid Boukhoulda Jan 3 at 13:19
  • 1
    The reason why a command works and an environment not is that the wrapfigure must not be included into a group, which is added by the environment. This is stated in the manual. Hafids solution works for me with TeXLive 2018. I don't think MikTeX will act any different. The underlying TeX engine is the same! – Martin Scharrer Jan 4 at 8:35

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.