\documentclass{book} \usepackage{environ} \usepackage{xcolor} \usepackage[tikz]{bclogo,rotating} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{lipsum} \DeclareGraphicsRule{.mps}{eps}{.mps}{} \NewEnviron{myremark}[1] {\par\medskip\noindent \begin{tikzpicture} \node[inner sep=0pt] (box) {\parbox[t]{.99\textwidth}{% \begin{minipage}{.3\textwidth} \centering\tikz[scale=5]\node[scale=3,rotate=30]{\bclampe}; \end{minipage}% \begin{minipage}{.65\textwidth} \textbf{#1}\par\smallskip \BODY \end{minipage}\hfill}% }; \draw[red!75!black,line width=3pt] ( $ (box.north east) + (-5pt,3pt) $ ) -- ( $ (box.north east) + (0,3pt) $ ) -- ( $ (box.south east) + (0,-3pt) $ ) -- + (-5pt,0); \draw[red!75!black,line width=3pt] ( $ (box.north west) + (5pt,3pt) $ ) -- ( $ (box.north west) + (0,3pt) $ ) -- ( $ (box.south west) + (0,-3pt) $ ) -- + (5pt,0); \end{tikzpicture}\par\medskip% } \begin{document} \lipsum[4] \begin{myremark}{Web addresses in texts} \lipsum[4] \end{myremark} \lipsum[4] \end{document}
效果截图:选自:http://tex.stackexchange.com/questions/66820/how-to-create-highlight-boxes-in-latex
发表评论 取消回复