Vous êtes sur la page 1sur 3

4.

6
N 2015-05-07

Text Alignment

/tcb/halign=halignmenti
(no default, initially justify)
If there is no lower part, halign determines the horizontal halignmenti of the text content.
Otherwise, halign determines the horizontal halignmenti of the upper part of the box
only. The feasible values for halignmenti are more or less identical to the corresponding
/tikz/align settings, even if the implementation differs.
justify: usual left and right justified type setting.
left: left border justification in analogy to plain TEX.
flush left: left border justification with \raggedright of LATEX.
right: right border justification in analogy to plain TEX.
flush right: right border justification with \raggedleft of LATEX.
center: centering in analogy to plain TEX.
flush center: centering with \centering of LATEX.
The differences between the flush and non-flush version are explained in detail in the TikZ
manual [20]. The short story is that the non-flush versions will often look more balanced
but with more hyphenations.
\tcbset{colback=red!5!white,colframe=red!75!black,size=small,
fonttitle=\bfseries,width=3.5cm,box align=top,
nobeforeafter}
\begin{tcolorbox}[adjusted title=flush center,halign=flush center]
This is a demonstration text for showing how line breaking works.
\end{tcolorbox}
\begin{tcolorbox}[adjusted title=flush left,halign=flush left]
This is a demonstration text for showing how line breaking works.
\end{tcolorbox}
\begin{tcolorbox}[adjusted title=flush right,halign=flush right]
This is a demonstration text for showing how line breaking works.
\end{tcolorbox}
\begin{tcolorbox}[adjusted title=center,halign=center]
This is a demonstration text for showing how line breaking works.
\end{tcolorbox}
\begin{tcolorbox}[adjusted title=left,halign=left]
This is a demonstration text for showing how line breaking works.
\end{tcolorbox}
\begin{tcolorbox}[adjusted title=right,halign upper=right]
This is a demonstration text for showing how line breaking works.
\end{tcolorbox}
flush center

flush left

This is a
demonstration text
for showing how line
breaking works.

This is a
demonstration text
for showing how line
breaking works.

center

left

This is a demonstration text for


showing how line
breaking works.
N 2015-05-07

flush right
This is a
demonstration text
for showing how line
breaking works.
right

This is a demonstration text for showing


how line breaking
works.

This is a demonstration text for


showing how line
breaking works.

(no default, initially justify)

/tcb/halign upper=halignmenti
Alias for /tcb/halign.

30

N 2015-05-07

/tcb/halign lower=halignmenti
(no default, initially justify)
halign lower determines the horizontal halignmenti of the lower part of the box. The
feasible values for halignmenti are the same as for /tcb/halign P. 30 .
\begin{tcbraster}[raster columns=3,fonttitle=\bfseries,
colback=red!5!white,colframe=red!75!black]
\begin{tcolorbox}[adjusted title=flush center,halign lower=flush center]
Upper part. \tcblower Lower part.
\end{tcolorbox}
\begin{tcolorbox}[adjusted title=flush left,halign lower=flush left]
Upper part. \tcblower Lower part.
\end{tcolorbox}
\begin{tcolorbox}[adjusted title=flush right,halign lower=flush right]
Upper part. \tcblower Lower part.
\end{tcolorbox}
\begin{tcolorbox}[adjusted title=center,halign lower=center]
Upper part. \tcblower Lower part.
\end{tcolorbox}
\begin{tcolorbox}[adjusted title=left,halign lower=left]
Upper part. \tcblower Lower part.
\end{tcolorbox}
\begin{tcolorbox}[adjusted title=right,halign lower=right]
Upper part. \tcblower Lower part.
\end{tcolorbox}
\end{tcbraster}
flush center

flush left

flush right

Upper part.

Upper part.

Upper part.

Lower part.

Lower part.

Lower part.

center

left

right

Upper part.

Upper part.

Upper part.

Lower part.

Lower part.

31

Lower part.

N 2015-05-07

/tcb/halign title=halignmenti
(no default, initially justify)
halign lower determines the horizontal halignmenti of the title of the box. The feasible
values for halignmenti are the same as for /tcb/halign P. 30 .
\begin{tcbraster}[raster columns=3,fonttitle=\bfseries,
colback=red!5!white,colframe=red!75!black]
\begin{tcolorbox}[adjusted title=flush center,halign title=flush center]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\begin{tcolorbox}[adjusted title=flush left,halign title=flush left]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\begin{tcolorbox}[adjusted title=flush right,halign title=flush right]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\begin{tcolorbox}[adjusted title=center,halign title=center]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\begin{tcolorbox}[adjusted title=left,halign title=left]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\begin{tcolorbox}[adjusted title=right,halign title=right]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{tcbraster}
flush center
This is a tcolorbox.
center
This is a tcolorbox.

flush left
This is a tcolorbox.

flush right
This is a tcolorbox.

left

right

This is a tcolorbox.

This is a tcolorbox.

U 2015-05-07

/tcb/flushleft upper
Shortcut for setting /tcb/halign P. 30 to flush left.

(style, no value)

U 2015-05-07

/tcb/center upper
Shortcut for setting /tcb/halign P. 30 to flush center.

(style, no value)

U 2015-05-07

/tcb/flushright upper
Shortcut for setting /tcb/halign P. 30 to flush right.

(style, no value)

U 2015-05-07

/tcb/flushleft lower
Shortcut for setting /tcb/halign lower P. 31 to flush left.

(style, no value)

U 2015-05-07

/tcb/center lower
Shortcut for setting /tcb/halign lower P. 31 to flush center.

(style, no value)

U 2015-05-07

/tcb/flushright lower
Shortcut for setting /tcb/halign lower P. 31 to flush right.

(style, no value)

U 2015-05-07

/tcb/flushleft title
Shortcut for setting /tcb/halign title to flush left.

(style, no value)

U 2015-05-07

/tcb/center title
Shortcut for setting /tcb/halign title to flush center.

(style, no value)

U 2015-05-07

/tcb/flushright title
Shortcut for setting /tcb/halign title to flush right.

(style, no value)

32

Vous aimerez peut-être aussi