LaTeXでハイライトボックスを作成するにはどうすればよいですか?
How Create Highlight Boxes Latex
解決:
あなたは使用することができますbclogoおよび/または
mdframedおよびまたは
tcolorboxパッケージ。
主な違いは、mdframedまたは
tcolorboxはページ分割を許可する場合があります。
ちょっとした例。最初の箱はを使用して製造されましたbclogo; 2つ目は、
mdframed; 3番目のもの(2番目のものと同様)と4番目のものはを使用して作成されました
tcolorbox:
documentclass {book} usepackage {xcolor} usepackage [tikz] {bclogo} usepackage [framemethod = tikz] {mdframed} usepackage {lipsum} usepackage [many] {tcolorbox} definecolor {bgblue} {RGB} { 245,243,253} definecolor {ttblue} {RGB} {91,194,224} mdfdefinestyle {mystyle} {%rightline = true、innerleftmargin = 10、innerrightmargin = 10、outerlinewidth = 3pt、topline = false、rightline = true、bottomline = false、skipabove = topsep、skipbelow = topsep} newtcolorbox {myboxi} [1] [] {breakable、title =#1、colback = white、colbacktitle = white、coltitle = black、fonttitle = bfseries、bottomrule = 0pt、toprule = 0pt 、leftrule = 3pt、rightrule = 3pt、titlerule = 0pt、arc = 0pt、outer arc = 0pt、colframe = black、} newtcolorbox {myboxii} [1] [] {breakable、freelance、title =#1、colback = white 、colbacktitle = white、coltitle = black、fonttitle = bfseries、bottomrule = 0pt、boxrule = 0pt、colframe = white、overlay unbroken and first = { draw [red!75!black、line width = 3pt]([xshift = 5pt] frame.north west)-(frame.north west)-(frame.south west); draw [red!75!black、line width = 3pt]([xshift = -5pt] frame.north east)-(frame.north east)-(frame.south east); }、overlay unbroken app = { draw [red!75!black、line width = 3pt、line cap = rect](frame.south west)-([xshift = 5pt] frame.south west); draw [red!75!black、line width = 3pt、line cap = rect](frame.south east)-([xshift = -5pt] frame.south east); }、オーバーレイ中央と最後= { draw [red!75!black、line width = 3pt](frame.north west)-(frame.south west); draw [red!75!black、line width = 3pt](frame.north east)-(frame.south east); }、overlay last app = { draw [red!75!black、line width = 3pt、line cap = rect](frame.south west)-([xshift = 5pt] frame.south west); draw [red!75!black、line width = 3pt、line cap = rect](frame.south east)-([xshift = -5pt] frame.south east); }、} begin {document} renewcommand bcStyleTitre [1] { large textcolor {ttblue} {#1}} begin {bclogo} [couleur = bgblue、arrondi = 0、logo = bcbombe、barre = none 、noborder = true] {Commomプログラミングエラー} itshape lipsum [4] end {bclogo} begin {mdframed} [style = mystyle、frametitle =テキスト内のWebアドレス] lipsum [4] end {mdframed} begin {myboxi} [テキスト内のWebアドレス] lipsum [4] end {myboxi} begin {myboxii} [テキスト内のWebアドレス] lipsum [4] end {myboxii} end {document}
パッケージは多くのカスタマイズの可能性を提供し、ドキュメントには多くの例が含まれています。
2番目のフレーム付きボックスの場合、次のオプションを使用します。TikZ:
documentclass {book} usepackage {environ} usepackage {xcolor} usepackage [tikz] {bclogo} usepackage {tikz} usetikzlibrary {calc} usepackage {lipsum} 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アドレス} lipsum [4] end {myremark} lipsum [4] end {資料}
ここで使用例mdframedにより、シンボルはパッケージから取得されます絵記号記号の代わりに、すべての画像を使用できます。
documentclass {report} usepackage [framemethod = tikz] {mdframed} usetikzlibrary {calc} usepackage {kantlipsum} usepackage {dingbat}% eye and leftpointright newcounter {error} [chapter] renewcommand * theerror { thechapter。 arabic {error}} tikzset {errorsymbol / .style = {%rectangle、draw = blue 、、 scale = 2、overlay}} tikzset {lampsymbol / .style = {%、scale = 2、overlay} } newmdenv [hidealllines = true、backgroundcolor = blue!5、%frametitle = { stepcounter {error} Comman〜Programming〜Error〜 theerror}、frametitlefont = color {blue!80!black} bfseries、skipabove = topsep、skipbelow = topsep、nobreak、leftmargin = .3cm、rightmargin = .3cm、innerleftmargin = 2cm、singleextra = { path let p1 =(P)、 p2 =(O)in($( x2,0 )+0.5 *(2、 y1)$)node [errorsymbol] { eye};}、%] {error} newmdenv [nobreak、middlelinewidth = .8pt、frametitlefont = bfseries、leftmargin = .3cm、rightmargin = .3cm、innerleftmargin = 2cm、skipabove = topsep、skipbelow = topsep、singleextra = { path let p1 =(P)、 p2 =(O)in($( x2,0)+0.5 *(2 、 y1)$)node [lampsymbol] { leftpointright}; draw [line width = .8pt、white、]($(O | -P)+(。2cm、0)$)-($(P)-(。2cm、0)$); draw [line width = .8pt、white、]($(O)+(。2cm、0)$)-($(P | -O)-(。2cm、0)$); }、%] {lamp} begin {document} begin {error}列挙型定数の名前には大文字のみを使用して、これらの定数をプログラムで目立たせ、列挙型定数が変数であることを示します。 end {error} begin {lamp} [frametitle = {テキスト内のWebアドレス}]列挙定数の名前には大文字のみを使用して、これらの定数をプログラムで目立たせ、列挙定数が変数であることを示します。 end {lamp} end {document}
ほとんどの場合、ページの境界を越えないボックスとして残しておく必要があります。そのため、画像とテキストボックスを使用した従来の「方程式」は、すべて表形式で行う必要があります:
documentclass {article} usepackage {array}%http://ctan.org/pkg/array usepackage {graphicx}%http://ctan.org/pkg/graphicx begin {document} [ left [ begin {tabular} {@ { quad} m {.3 textwidth} @ { qquad} m {.6 textwidth} @ { quad}} includegraphics [width = linewidth] {example-image-a} & raggedright% textbf {テキスト内のWebアドレス} parWebアドレスを植字するために設計された texttt {url}というパッケージがあります。プリアンブルに mbox { texttt { string usepackage string {url string}}}を書き込みます。これにより、コマンド mbox { texttt { string url}}が提供されます。このコマンドは引数のアドレスを取り、タイプライターフォントで出力します。さらに、アンダースコアやパーセント記号などのアドレスの特殊文字を処理できます。アドレスのハイフネーションも有効になり、非常に長い名前のWebサイトに役立ちます。% end {tabular} right] ] end {document}