From bcdd727cf125ed31eca233342d885b79c0ac1bb9 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 20 Mar 2014 22:51:31 +0000 Subject: efbox (20mar14) git-svn-id: svn://tug.org/texlive/trunk@33236 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/efbox/efbox.sty | 134 ++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/efbox/efbox.sty (limited to 'Master/texmf-dist/tex/latex/efbox') diff --git a/Master/texmf-dist/tex/latex/efbox/efbox.sty b/Master/texmf-dist/tex/latex/efbox/efbox.sty new file mode 100644 index 00000000000..94754e240c5 --- /dev/null +++ b/Master/texmf-dist/tex/latex/efbox/efbox.sty @@ -0,0 +1,134 @@ +%% +%% This is file `efbox.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% efbox.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright (C) 2014 by José Romildo Malaquias +%% -------------------------------------------------------------------------- +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{efbox} + [2014/03/19 1.0 An enhanced fbox command.] +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{efbox}[2014/03/19 v1.0 An enhanced fbox command] +\RequirePackage{color} +\RequirePackage{pgfkeys} +\newif\if@efbox@leftline +\newif\if@efbox@rightline +\newif\if@efbox@topline +\newif\if@efbox@bottomline +\pgfkeys{ + /efbox/.cd, + leftline/.is if = @efbox@leftline, + rightline/.is if = @efbox@rightline, + topline/.is if = @efbox@topline, + bottomline/.is if = @efbox@bottomline, + hidealllines/.style = {leftline=false,rightline=false,topline=false,bottomline=false}, + backgroundcolor/.store in = \efbox@backgroundcolor, + linecolor/.store in = \efbox@linecolor, + linewidth/.store in = \efbox@linewidth, + margin/.store in = \efbox@margin, + font/.store in = \efbox@font, + baselinestretch/.store in = \efbox@baselinestretch, +} +\pgfqkeys{/efbox}{ + leftline = true, + rightline = true, + topline = true, + bottomline = true, + linecolor = black, + linewidth = \fboxrule, + margin = \fboxsep, +} +\newif\if@efbox@hasframe +\def\efbox@global@options{} +\newcommand\efboxsetup[1]{% + \def\efbox@global@options{#1}% +}% +\newcommand*\mypgfqkeys@with@saved@options[3]{% + % #1 => path + % #2 => macro holding saved options + % #3 => keys + \def\@pgfqkeys@##1{\pgfqkeys{#1}{##1}}% + \expandafter\@pgfqkeys@\expandafter{#2,#3}% +}% +\newcommand\efbox[2][]{% + \begingroup% + \mypgfqkeys@with@saved@options{/efbox}{\efbox@global@options}{#1}% + %\expandafter\pgfqkeys\expandafter{/efbox}\expandafter{\efbox@global@options,#1}% + \ifdefined\efbox@font\efbox@font\fi + \ifdefined\efbox@baselinestretch + \def\baselinestretch{\efbox@baselinestretch}% + \fi + \@efbox@hasframefalse + \if@efbox@topline\@efbox@hasframetrue\else\fi + \if@efbox@bottomline\@efbox@hasframetrue\else\fi + \if@efbox@leftline\@efbox@hasframetrue\else\fi + \if@efbox@rightline\@efbox@hasframetrue\else\fi + \ifdefined\efbox@backgroundcolor\@efbox@hasframetrue\else\fi + \if@efbox@hasframe + \ifdefined\efbox@backgroundcolor\else\def\efbox@backgroundcolor{white}\fi + \fboxsep=\efbox@margin + \fboxrule=\efbox@linewidth + \let\@frameb@x\@my@frameb@x + \fboxsep=\efbox@margin + \def\efbox@body{\fcolorbox{\efbox@linecolor}{\efbox@backgroundcolor}{#2}}% + \else + \def\efbox@body{#2}% + \fi + \ifdefined\efbox@title + \ifx\@empty\efbox@title + \noindent\efbox@body + \else + \vbox{% + \nobreak\vskip\fboxsep + \rlap{\frametitle{\efbox@title}}% + \nobreak\nointerlineskip + \vskip-\baselineskip + \vskip \fboxsep + \noindent\efbox@body + }% + \fi + \else + \efbox@body + \fi + \endgroup +} +\def\@my@frameb@x#1{% + \@tempdima\fboxrule + \advance\@tempdima\fboxsep + \advance\@tempdima\dp\@tempboxa + \hbox{% + \lower\@tempdima\hbox{% + \vbox{% +\if@efbox@topline\hrule\@height\fboxrule\fi +\hbox{% + \if@efbox@leftline\vrule\@width\fboxrule\fi + #1% + \vbox{% + \vskip\fboxsep + \box\@tempboxa + \vskip\fboxsep}% + #1% + \if@efbox@rightline\vrule\@width\fboxrule\fi +}% + \if@efbox@bottomline\hrule\@height\fboxrule\fi + }% + }% + }% +}% +\endinput +%% +%% End of file `efbox.sty'. -- cgit v1.2.3