diff options
author | Karl Berry <karl@freefriends.org> | 2013-04-23 22:17:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-04-23 22:17:44 +0000 |
commit | c0605257da4328774f6e42c1bcadefcac129f5aa (patch) | |
tree | 45647ed211a2b6b2e5b077287765d2c14782c813 /Master/texmf-dist/tex | |
parent | ce96f93eee04e6c89a60b819a43ec27e85fce25e (diff) |
minibox (21apr13)
git-svn-id: svn://tug.org/texlive/trunk@30083 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/minibox/minibox.sty | 69 |
1 files changed, 56 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/latex/minibox/minibox.sty b/Master/texmf-dist/tex/latex/minibox/minibox.sty index 55fa4220619..039620799e9 100644 --- a/Master/texmf-dist/tex/latex/minibox/minibox.sty +++ b/Master/texmf-dist/tex/latex/minibox/minibox.sty @@ -1,15 +1,58 @@ -%% LaTeX2e file `minibox.sty' -%% generated by the `filecontents' environment -%% from source `minibox' on 2009/04/22. -%% -\ProvidesPackage{minibox}[2009/04/21 v0.1 - Another type of box.] +% \begin{macrocode} +\RequirePackage{expl3} +\ProvidesExplPackage + {minibox} + {2013/04/20} + {0.2} + {Another type of box.} +% \end{macrocode} +% +% \begin{macrocode} +\bool_new:N \l_minibox_frame_bool +\keys_define:nn {minibox} + { + frame .choice: , + frame / true .code:n = { \bool_set_true:N \l_minibox_frame_bool } , + frame / false .code:n = { \bool_set_false:N \l_minibox_frame_bool } , + frame .default:n = { true } , -% This is the simplest definition I can get away with. -% Expect changes in the future. -\newcommand\minibox[2][l]{% - \begin{tabular}{@{}#1@{}} - #2 - \end{tabular}% -} + l .code:n = { \tl_set:Nn \l_minibox_tabular_preamble_tl {l} } , + c .code:n = { \tl_set:Nn \l_minibox_tabular_preamble_tl {c} } , + r .code:n = { \tl_set:Nn \l_minibox_tabular_preamble_tl {r} } , + t .code:n = { \tl_set:Nn \l_minibox_tabular_valign_tl {t} } , + m .code:n = { \tl_set:Nn \l_minibox_tabular_valign_tl {c} } , + b .code:n = { \tl_set:Nn \l_minibox_tabular_valign_tl {b} } , + + rule .dim_set:N = \l_minibox_rule_dim , + pad .dim_set:N = \l_minibox_pad_dim , + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_new:Npn \miniboxsetup #1 { \keys_set:nn {minibox} {#1} } +\miniboxsetup {l,m,rule=\fboxrule,pad=\fboxsep} +% \end{macrocode} +% +% \begin{macrocode} +\newcommand\minibox[2][] + { + \group_begin: + \keys_set:nn {minibox} {#1} + \bool_if:NTF \l_minibox_frame_bool + { + \setlength\fboxrule{\l_minibox_rule_dim} + \setlength\fboxsep{\l_minibox_pad_dim} + \fbox + } + { \use:n } + { + \begin{tabular} + [\l_minibox_tabular_valign_tl] + { @{} \l_minibox_tabular_preamble_tl @{} } + #2 + \end{tabular} + } + \group_end: + } +% \end{macrocode} |