summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/fbox/doc/fbox.tex
blob: 4cbfc2d36d77e6812d73b4ec958969ef0ef3c21b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
%% $Id: fbox.tex 10 2020-06-22 10:15:39Z herbert $
%
\listfiles\setcounter{errorcontextlines}{100}
\documentclass[paper=a4,fontsize=11pt,DIV=13,parskip=half-,
               captions=tableabove,twoside=on]{scrartcl}
\usepackage{fontspec}
\setmainfont{AccanthisADFStdNo3}[
  UprightFont   =*-Regular,
  BoldFont      =*-Bold,
  ItalicFont    =*-Italic,
  BoldItalicFont=*-BoldItalic,
  RawFeature    = -rlig,
]
\setsansfont{GilliusADF}[
  UprightFont   =*-Regular,
  BoldFont      =*-Bold,
  ItalicFont    =*-Italic,
  BoldItalicFont=*-BoldItalic,
  RawFeature    = -rlig,
]
\setmonofont{Anonymous Pro}[Scale=MatchLowercase,FakeStretch=0.9]

\usepackage[english]{babel}
\usepackage{scrlayer-scrpage}
\usepackage{showexpl}
\usepackage{listings}
\lstset{basicstyle=\ttfamily\small,language=[LaTeX]TeX,rframe=}

\def\Lfile#1{\texttt{#1}\index{#1 file@\texttt{#1} file}}
\def\Lext#1{\texttt{.#1}\index{#1 file extension@\texttt{.#1} file extension}}
\def\Lcs#1{\texttt{\textbackslash#1}\index{#1@\texttt{\textbackslash#1}}}
\def\Lenv#1{\texttt{#1}\index{#1 environment@\texttt{#1} environment}}
\def\Lpack#1{\texttt{#1}\index{#1 package@\texttt{#1} package}}
\def\Lprog#1{\texttt{#1}\index{#1 program@\texttt{#1} program}}
\def\Loption#1{\texttt{#1}\index{#1@\texttt{#1} package option}}
\let\Ldim\Lcs

\def\demoText{DuckDuckGo! Time to spread the word!\par
Equipped with the talking points above, you’re ready to help anyone search and browse protected.}

%\usepackage[bibstyle=dtk]{biblatex}
%\addbibresource{\jobname.bib}

\usepackage{url}
\usepackage[colorlinks,linktocpage]{hyperref}

\makeatletter% from: doc.sty
\newcommand*\GetFileInfo[1]{%
  \def\filename{#1}%
  \def\@tempb##1 ##2 ##3\relax##4\relax{%
    \def\filedate{##1}%
    \def\fileversion{##2}%
    \def\fileinfo{##3}}%
  \edef\@tempa{\csname ver@#1\endcsname}%
  \expandafter\@tempb\@tempa\relax? ? \relax\relax}
\makeatother

%\GetFileInfo{xltabular.sty}
\usepackage{xspace}
\usepackage{fbox}

\def\setVersion#1{\setVVersion#1!!}
\def\setVVersion#1=#2!!{\def\fboxVersion{#2}} 

\setVersion{version = 0.05}%

\title{Package \texttt{fbox} \\--\\ \normalsize \fboxVersion\ (\today)}
\author{Herbert Voß\thanks{\url{hvoss@tug.org}\newline Thanks to Rolf Niepraschk}}
\begin{document}
\maketitle
%\tableofcontents

This package redefines the \LaTeX-macro \Lcs{fbox} to allow an optional
argument:

\begin{verbatim}
\fbox*[<optargs>]{<contents>}
\fparbox*[<optargs>]{<contents>}
\end{verbatim}

The star version does not put any horizontal space before or behind the argument
if no optional argument \texttt{l} or \texttt{r} is given. The non star version always inserts
\Ldim{fboxsep}.

\Lcs{fparbox} uses the current \Ldim{linewidth} minus two times the box sep and boxrule width.
It does \emph{not} a test for an existing paragraph indenting. It has do be done by the
user, e.g.:

\begin{verbatim}
\noindent
\fparbox ...
\end{verbatim}

The optional argument can be 
\begin{description}
\item[boxrule] The rule width is predefined to the current value of \Ldim{fboxrule} (0.4pt)
\item[boxsep] The box separation is predefined to the current value of \Ldim{fboxsep} (3pt)
\item[<letters>] Any combination of the letters
l, r, b, and t, or altenatively L, R, B, and T for  l)eft, r)right, b)ottom, and t)op
of the frame parts. A missing or an empty argument is the same as the default
\Lcs{fbox} command  from standard \LaTeX.
\end{description}


\begin{LTXexample}
\fbox{foo gar baz}
\end{LTXexample}

\begin{LTXexample}
\fbox[]{foo gar baz}
\end{LTXexample}

\begin{LTXexample}
\fbox[rbt]{foo gar baz}
\fbox[brt]{foo gar baz}
\fbox[bRT]{foo gar baz}
\end{LTXexample}

\begin{LTXexample}
\fbox*[rbt]{foo gar baz}
\fbox*[brt]{foo gar baz}
\fbox*[bRT]{foo gar baz}
\end{LTXexample}

\begin{LTXexample}
\fbox[lT]{foo gar baz}
\end{LTXexample}

\begin{LTXexample}
\fbox*[lT]{foo gar baz}
\end{LTXexample}

\begin{LTXexample}
\fbox[bT]{foo gar baz}
\end{LTXexample}

\begin{LTXexample}
\fbox*[bT]{foo gar baz}
\end{LTXexample}

\begin{LTXexample}
\fbox[Br]{foo gar baz}
\end{LTXexample}

\begin{LTXexample}
\fbox*[Br]{foo gar baz}
\end{LTXexample}

\begin{LTXexample}
\fbox[bT,boxrule=5pt]{foo gar baz}
\end{LTXexample}

\begin{LTXexample}
\fbox*[bT,boxrule=5pt]{foo gar baz}
\end{LTXexample}



\begin{LTXexample}
\fbox[Br,boxrule=5pt]{foo gar baz}
\end{LTXexample}


\begin{LTXexample}
\fbox*[boxrule=5pt,Br]{foo gar baz}
\end{LTXexample}


\begin{LTXexample}
\fbox*[boxsep=5mm,bT,boxrule=2pt]{foo gar baz}
\end{LTXexample}



\begin{LTXexample}
\fparbox{\demoText}
\end{LTXexample}

\begin{LTXexample}
\fparbox[]{\demoText}
\end{LTXexample}


\begin{LTXexample}
\fparbox[rbt]{\demoText}
\fparbox[brt]{\demoText}
\fparbox[bRT]{\demoText}
\end{LTXexample}

\begin{LTXexample}
\fparbox*[rbt]{\demoText}
\fparbox*[brt]{\demoText}
\fparbox*[bRT]{\demoText}
\end{LTXexample}

\begin{LTXexample}
\fparbox[lT]{\demoText}
\end{LTXexample}

\begin{LTXexample}
\fparbox*[lT]{\demoText}
\end{LTXexample}

\begin{LTXexample}
\fparbox[bT]{\demoText}
\end{LTXexample}

\begin{LTXexample}
\fparbox*[bT]{\demoText}
\end{LTXexample}

\begin{LTXexample}
\fparbox[Br]{\demoText}
\end{LTXexample}

\begin{LTXexample}
\fparbox*[Br]{\demoText}
\end{LTXexample}

\begin{LTXexample}
\fparbox[bT,boxrule=5pt]{\demoText}
\end{LTXexample}

\begin{LTXexample}
\fparbox*[bT,boxrule=5pt,boxsep=6pt]{\demoText}
\end{LTXexample}

\begin{LTXexample}
\fparbox*[bT,boxrule=3pt,boxsep=10pt]{\demoText}
\end{LTXexample}


\begin{LTXexample}
\fparbox[Br,boxrule=5pt,boxsep=10pt]{\demoText}
\end{LTXexample}

\begin{LTXexample}
\fparbox*[boxrule=5pt,Br]{\demoText}
\end{LTXexample}







\end{document}