2

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

enter image description here

azdoud
  • 371

2 Answers2

4

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}

output of the mwe

schtandard
  • 14,892
3

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}

enter image description here

Ignasi
  • 136,588