thanks in advance for your precious help. I am trying to highlight non seriffed text commands inside a grey box ="easy here". Something like this:

enter image description here

To get that in Latex, the following code is enough for the purpose (non serif out of the mwe):

\newcommand\mybox[2][]{\tikz[overlay]\node[draw=gray!10, fill=gray!10, inner sep=1.5pt, anchor=text, rectangle, rounded corners=0.5mm,#1] {#2};\phantom{#2}}
\mybox{Still fine: =IF(1<2,"Yes","No")}\\

However, quotes marks after text produce and odd "extra }" error:

linha 10: Argument of \language@active@arg" has an extra }. \mybox{="whyItDoesNotLikeThis:"}
linha 10: Paragraph ended before \language@active@arg" was complete. \mybox{="whyItDoesNotLikeThis:"}
linha 8: Underfull \hbox (badness 10000) in paragraph

enter image description here

PS: Need to use mdframed for other purpose in the real doc, however, even if only use tikz package, the problem remains. Perhaps there is a proper way to this stuf, as this syntax is more than common all over the internet.

Any hint more than welcome. Have a nice day.

  • Note that I would probably move to tcolorbox instead of mdframed. The main issue here is Portuguese babel which makes " into an active char. What exactly does "..." mean in your output?
    – daleif
    Apr 4, 2021 at 16:04
  • HI @daleif, thanks for your comment. What do you mean with with "..." in output?
    – user30586
    Apr 4, 2021 at 17:09
  • What exactly does ="whyItDoesNotLikeThis:" represent?
    – daleif
    Apr 4, 2021 at 17:14
  • This represents how to enter text in an Excel formula. ="string". I want to highlight whenever mention to commands with the grey box around it, pretty much as we do here in stackexchange
    – user30586
    Apr 4, 2021 at 17:22
  • 1
    If you don't use the " shorthand in your text, then you can add \shorthandoff{"} to the start of the document to disable the active "
    – daleif
    Apr 4, 2021 at 17:36


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.