How to draw a highlighted box around a bulleted item.
Asked
Active
Viewed 2,128 times
1
-
Related Question: Box around a few items in an itemize environment. – Peter Grill May 23 '13 at 20:54
-
You got two answers and did not accept one. Any special reason? – Dr. Manuel Kuehner Feb 18 '18 at 15:51
2 Answers
3
Use the color package and \colorbox, like so:
\documentclass{report}
\usepackage{color}
\begin{document}
\begin{itemize}
\item Hello
\item \colorbox{yellow}{I rule}
\item World
\end{itemize}
\end{document}
If you meant something else by "highlighted box", let me know.
Emre
- 6,337
-
-
-
\fbox {\item {Test}} is not working.i also want to blink that rectangle – user4852 Apr 14 '11 at 08:25
-
Put the
\fboxafter the\item:\item \fbox{Text}I believe it blinks if you convert it to HTML
– Emre Apr 14 '11 at 08:31 -
-
1Before itemize insert
– Emre Apr 14 '11 at 08:51\newlength\mybox \settowidth{\mybox}{rule} \addtolength{\mybox}{0.4in}then use\item \hspace{-0.25in}\framebox[\mybox][r]{Boxed text} -
2
Here a solution of the German forum MrUnix
\documentclass{article}
\usepackage{picture,}
\makeatletter
\newcommand\fboxitem[1]{%
\setlength\@tempdima{\itemsep}%
\addtolength\@tempdima{\dimexpr\labelsep+\fboxsep+\fboxrule\relax}%
\item\leavevmode\put(-\the\@tempdima,0){%
\fbox{\hspace*{\dimexpr\itemsep+\labelsep\relax}%
\parbox[t]{\dimexpr\linewidth-\fboxsep-\fboxrule\relax}{%
#1}}}}
\makeatother
\begin{document}
\begin{itemize}
\item Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen
\fboxitem{Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen Text im Rahmen}
\end{itemize}
\end{document}

Marco Daniel
- 95,681