# How to surround text or values with dashed box within paragraph?

I need to put text and values inside a dashed box for focus purposes. within a paragraph, I have tested this Dashed box environment it's not my need

I want it like this way

• Possible duplicate of Dashed box environment – bmv Mar 21 '18 at 13:15
• @bmv my SIr I said in a paragraph, I have already tried that Dashed box environment – azdoud Mar 21 '18 at 13:53

You can do it with TikZ:

\documentclass{article}

\usepackage{tikz}

\newcommand\dboxed[1]{\tikz [baseline=(boxed word.base)] \node (boxed word) [draw, rectangle, dashed, line cap=round] {#1};}

\begin{document}

This is a \dboxed{Test} sentence.

\end{document}


Another solution based in Thomas F. Sturm answer to Dashed box environment. I've just adapted his solution into a tcbox.

\documentclass{article}
\usepackage[most]{tcolorbox}

\newtcbox{\dbox}[1][]{
on line,
enhanced,
frame hidden,
interior hidden,
sharp corners,
size=small,
borderline={0.4pt}{0pt}{dashed},
#1
}

\begin{document}

This is a \dbox{test} with \dbox{tcolorbox}.
\end{document}