From d1aabb29e481aad4a643be8d336a443a54059418 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Mon, 6 Nov 2017 18:00:15 +0100 Subject: [PATCH] padding in epub and pdf (cherry picked from commit 3be94db) --- librarian/epub/style.css | 1 + librarian/pdf/wl.cls | 60 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/librarian/epub/style.css b/librarian/epub/style.css index 176614d..d4782d2 100644 --- a/librarian/epub/style.css +++ b/librarian/epub/style.css @@ -285,6 +285,7 @@ div.dedication div.paragaph .frame { border: 1px darkgray solid; + padding: 1em; } hr.spacer diff --git a/librarian/pdf/wl.cls b/librarian/pdf/wl.cls index a747754..de506ae 100644 --- a/librarian/pdf/wl.cls +++ b/librarian/pdf/wl.cls @@ -350,8 +350,66 @@ Letters={Uppercase} \end{em}% } +\newlength{\fboxhsep} +\newlength{\fboxvsep} + +\newlength{\fboxtoprule} +\newlength{\fboxbottomrule} +\newlength{\fboxleftrule} +\newlength{\fboxrightrule} + +\setlength{\fboxhsep}{5\fboxsep} +\setlength{\fboxvsep}{20\fboxsep} + +\setlength{\fboxtoprule}{\fboxrule} +\setlength{\fboxleftrule}{\fboxrule} +\setlength{\fboxrightrule}{\fboxrule} +\setlength{\fboxbottomrule}{\fboxrule} + + + +\def\@frameb@xother#1{% + \@tempdima\fboxtoprule + \advance\@tempdima\fboxvsep + \advance\@tempdima\dp\@tempboxa + \hbox{% + \lower\@tempdima\hbox{% + \vbox{% + \hrule\@height\fboxtoprule + \hbox{% + \vrule\@width\fboxleftrule + #1% + \vbox{% + \vskip\fboxvsep + \box\@tempboxa + \vskip\fboxvsep}% + #1% + \vrule\@width\fboxrightrule}% + \hrule\@height\fboxbottomrule}% + }% + }% +} + + +\long\def\fboxother#1{% + \leavevmode + \setbox\@tempboxa\hbox{% + \color@begingroup + \kern\fboxhsep{#1}\kern\fboxhsep + \color@endgroup}% + \@frameb@xother\relax} + +\newcommand{\myfbox}[3]{% + \begingroup + \setlength{\fboxhsep}{#1} + \setlength{\fboxvsep}{#2} + \fboxother{#3} + + \endgroup +} + \newcommand{\ramka}[1]{% -\noindent\fbox{% +\noindent\myfbox{1em}{1em}{% \parbox{\textwidth}{% #1% }}% -- 2.20.1