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:
To get that in Latex, the following code is enough for the purpose (non serif out of the mwe):
\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[portuguese]{babel}
\usepackage[framemethod=TikZ]{mdframed}
\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}}
\newcommand\es[1]{\textsf{\mybox[]{#1}}}
\begin{document}
\mybox{"noProb}\\
\mybox{Still fine: =IF(1<2,"Yes","No")}\\
\mybox{="whyItDoesNotLikeThis:"}\\
\end{document}
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
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.
tcolorbox
instead ofmdframed
. The main issue here is Portuguese babel which makes"
into an active char. What exactly does"..."
mean in your output?"..."
in output?="whyItDoesNotLikeThis:"
represent?here
in stackexchange"
shorthand in your text, then you can add\shorthandoff{"}
to the start of the document to disable the active"