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

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

2 Answers 2

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

0
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .