frames around the web UI elements, as requested by Natureshadow
authormirabilos <t.glaser@tarent.de>
Fri, 22 Jan 2016 16:57:24 +0000 (17:57 +0100)
committermirabilos <t.glaser@tarent.de>
Fri, 22 Jan 2016 16:57:24 +0000 (17:57 +0100)
References:
• rounded corners, not used: http://tex.stackexchange.com/a/34091/43807
• rounded corners, ovalbox: http://tex.stackexchange.com/q/50959/43807
• uniform height, manual padding: http://tex.stackexchange.com/a/86619/43807
• dimension retrieval: http://tex.stackexchange.com/q/3166/43807
• dimension conversion, for debugging and testing a proof of concept:
  http://tex.stackexchange.com/a/8337/43807
• automatic length calculation:
  https://www.teckids.org/gitweb/?p=verein.git;a=blob;f=templates/template_bilderwand.tex;h=5b05205852d54842c70821d037a9980afbe69c91;hb=HEAD
• putting it all together: pure mirabilos genius ;-)

src/main/latex/common/tarentstyle.sty
src/main/latex/common/text-anleitung.tex

index 9c241f7..aa4a3c0 100644 (file)
@@ -45,7 +45,7 @@
 % Kopfzeile 1.1 cm (Abstand 0.6 cm); Fußzeile 0.6 cm (Abstand 0.6 cm)
 \RequirePackage[a4paper,includeheadfoot,inner=2.1cm,outer=1.6cm,top=1.78cm,bottom=1.5cm,twoside,headheight=1.1cm,headsep=0.9cm,foot=1.2cm,marginparsep=2.5mm]{geometry}
 \savegeometry{tarentstyle}
-\RequirePackage{framed}
+\RequirePackage{fancybox}
 \linespread{1.15}
 \RequirePackage{pxfonts}
 \renewcommand{\familydefault}{\sfdefault}
index a5b3615..c94d755 100644 (file)
 % - neuer Mail-Kram
 
 \makeatletter%
-\newcommand{\myinlinepic}[2][\@empty]{\mbox{\resizebox{!}{1.25ex}%
-{\includegraphics{#2}}\ifx#1\@empty\else{ #1}\fi}}%
+% fbox and ovalbox line will be inside the box
+\setlength{\fboxsep}{-2\fboxrule}%
+% to calculate horizontal padding inside the frame
+\newdimen{\myinlinesep}%
+% to store dimensions of box without padding
+\newsavebox{\myinlinebox}%
+\newcommand{\myinlinepic}[2][\@empty]{%
+ % first, generate a box with square content and w/o padding
+ \savebox{\myinlinebox}{\ovalbox{\strut\hspace{1.25ex}}}%
+ % get its real height (Teχ height + depth)
+ \myinlinesep=\ht\myinlinebox%
+ \advance\myinlinesep by \dp\myinlinebox%
+ % subtract its real width
+ \advance\myinlinesep by -\wd\myinlinebox%
+ % we want half of it on either side
+ \divide\myinlinesep by 2%
+ % now render the actual box
+ \ovalbox{%
+  % left padding
+  \hspace{\myinlinesep}%
+  % ensure standard height
+  \strut%
+  % the graphic
+  \resizebox{!}{1.25ex}{\includegraphics{#2}}%
+  % the text, if any
+  \ifx#1\@empty\else{ #1}\fi%
+  % right padding
+  \hspace{\myinlinesep}%
+}}%
 \makeatother%
 
 \ifupgradeanleitung