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
|
\ProvidesPackage{lnavicol}[2011/10/13
left navigation column with blog.sty]
%%
%% Copyright (C) 2011 Uwe Lueck,
%% http://www.contact-ednotes.sty.de.vu
%% -- author-maintained in the sense of LPPL below --
%%
%% This file can be redistributed and/or modified under
%% the terms of the LaTeX Project Public License; either
%% version 1.3c of the License, or any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% We did our best to help you, but there is NO WARRANTY.
%%
%% Please report bugs, problems, and suggestions via
%%
%% http://www.contact-ednotes.sty.de.vu
%%
%% == 'blog.sty' Required ==
%% ---but what about options (TODO)? %% 2011/10/09
\RequirePackage{blog}
%%
%% == Switches ==
%% %% introduced 2011/04/29, it seems
%% There is a ``standard" page width and a ``tight one"
%% (the latter for contact forms)---|\iftight|:
\newif\iftight
%% In order to move an anchor to the \emph{top} of the screen
%% when the anchor is near the page end, the page must get
%% some extra length by adding empty space at its
%% bottom---|\ifdeep|:
\newif\ifdeep
%%
%% == Page Style Settings (to be set locally) ==
% \newcommand*{\pagebgcolor}{\#f5f5f5} %% CSS whitesmoke
% \newcommand*{\pagespacing}{\@cellpadding{4} \@cellspacing{7}}
% \newcommand*{\pagenavicolwidth}{125}
% \newcommand*{\pagemaincolwidth}{584}
% \newcommand*{\pagewholewidth} {792}
%% == Possible Additions to 'blog.sty' ==
%% === Tables ===
%% |\begin{spancolscell}{<number>}{<style>}|
%% opens an environment that contains a row and a single cell
%% that will span <number> table cells and have style <style>:
\newenvironment{spancolscell}[2]{%
\starttr\startTd{\@colspan{#1} #2 %
\@width{100\%}}% %% TODO works?
}{\endTd\endtr}
%% The |{hiddencells}| einvironment contains cells that do not align
%% with other cells in the surrounding table. The purpose is using
%% cells for horizontal spacing.
\newenvironment{hiddencells}
{\startTable{}\starttr}
{\endtr\endTable}
%% |{pagehiddencells}| is like `{hiddencells}' except that
%% the \HTML\ code is indented:
\newenvironment{pagehiddencells}
{\indentii\hiddencells}
{\indentii\endhiddencells}
%% |\begin{FixedWidthCell}{<width>}{<style>}| \ opens the
%% `{FixedWidthCell}' environment. The content will form a cell
%% of width <width>. <style> are additional formatting parameters:
\newenvironment{FixedWidthCell}[2]
{\startTd{#2}\startTable{\@width{#1}}%
\starttr\startTd{}}
{\endTd\endtr\endTable\endTd}
%% |\tablehspace{<width>}| is a variant of \LaTeX's `\hspace{<glue>}'.
%% It may appear in a table row:
\newcommand*{\tablehspace}[1]{\startTd{\@width{#1} /}}
%%
%% === Graphics ===
%% The command names in this section are inspired by the names
%% in the standard \LaTeX\ \ctanpkgref{graphics} package.
%% (They may need some re-organization TODO.)
%%
%% |\simpleinclgrf{<file>}| embeds a graphic file <file> without
%% the tricks of the remaining commands.
\newcommand*{\simpleinclgrf}[1]{\IncludeGrf{alt="" \@border{0}}%
{#1}}
%% |\IncludeGrf{<style>}{<file>}| embeds a graphic file <file>
%% with style settings <style>:
\newcommand*{\IncludeGrf}[2]{<img #1 src="#2">}
%% |\includegraphic{<width>}{<height>}{<file>}{<border>}{<alt>}{<tooltip>}|
%% ...: %% fine with mdoccorr 2011/10/13
\newcommand*{\includegraphic}[6]{%
\IncludeGrf{%
\@width{#1} \@height{#2} %% data; presentation:
\@border{#4}
alt="#5" \@title{#6}}%
{#3}}
%% |\insertgraphic{<wd>}{<ht>}{<f>}{<b>}{<align>}{<hsp>}{<vsp>}{<alt>}{<t>}|
%% \\adds <hsp> for the `@hspace' and <vsp> for the `@vspace'
%% attribute:
\newcommand*{\insertgraphic}[9]{%
\IncludeGrf{%
\@width{#1} \@height{#2} %% data; presentation:
\@border{#4}
align="#5" hspace="#6" vspace="#8"
alt="#8" \@title{#9}}%
{#3}}
%% |\includegraphic{<wd>}{<ht>}{<file>}{<anchor>}{<border>}{<alt>}{<tooltip>}|
%% \\uses an image with `\includegraphic' parameters as a link to
%% <anchor>:
\newcommand*{\inclgrfref}[7]{%
\fileref{#4}{\includegraphic{#1}{#2}{#3}%
{#5}{#6}{#7}}}
%%
%% === \acro{HTTP}/Wikipedia tooltips ===
%% |\httptipref{<tip>}{<www>}{<text>}| \ works like \
%% `\httpref{<www>}{<text>}' except that <tip> appears as ``tooltip":
\newcommand*{\httptipref}[2]{%
\TagSurr a{\@title{#1}\@href{http://#2}\@target@blank}}
%% |\@target@blank| abbreviates the `@target' setting for
%% opening the target in a new window or tab:
\newcommand*{\@target@blank}{target="_blank"}
%% % |\wikitipref{<language-code>}{<lemma>}{<text>}| \
%% |\wikitipref{<lc>}{<lem>}{<text>}|
%% works like
%% % \\
%% % `\wikiref{<language-code>}{<lemma>}{<text>}'
%% `\wikiref{<lc>}{<lem>}{<text>}'
%% except that
%% ``Wikipedia" appears as ``tooltip".
%% |\wikideref| and |\wikienref| are redefined to use it:
\newcommand*{\wikitipref}[2]{%
\httptipref{Wikipedia}{#1.wikipedia.org/wiki/#2}}
\renewcommand*{\wikideref}{\wikitipref{de}}
\renewcommand*{\wikienref}{\wikitipref{en}}
%%
%% == Page Structure ==
%% The body of the page is a table of three rows and two columns.
%% === Page Head Row ===
%% |\PAGEHEAD| opens the head row and a single cell that will span
%% the two columns of the second row.
\newcommand*{\PAGEHEAD}{%
\startTable{%
\@align@c\
\@bgcolor{\pagebgcolor}%
\@border{0}%% %% TODO local
\pagespacing
\iftight \else \@width\pagewholewidth \fi
}\CLBrk
%% omitting <tbody>
\ \comment{ HEAD ROW }\CLBrk
\indenti\spancolscell{2}{}%
}
% \newcommand*{\headgrf} [1]{% %% rm. 2011/10/09
% \indentiii\simplecell{\simpleinclgrf{#1}}}
% \newcommand*{\headgrfskiptitle}[3]{%
% \pagehiddencells
% \headgrf{#1}\CLBrk
% \headskip{#2}\CLBrk
% \headtitle1{#3}\CLBrk
% \endpagehiddencells}
%% |\headuseskiptitle{<grf>}{<skip>}{<title>}|
%% first places <grf>, then skips horizontally by <skip>,
%% and then prints the page title as \xmltagcode{h1}:
\newcommand*{\headuseskiptitle}[3]{%
\pagehiddencells\CLBrk
\indentiii\simplecell{#1}\CLBrk
\headskip{#2}\CLBrk
\headtitle1{#3}\CLBrk
\endpagehiddencells}
%% |\headskip{<skip>}| is like `\tablehspace{<skip>}'
%% except that the \HTML\ code gets an indent.
\newcommand*{\headskip} {\indentiii\tablehspace}
%% Similarly, |\headtitle{<digit>}{<text>}| is like
%% `\heading<digit>{<text>}' apart from an indent and
%% being put into a cell:
\newcommand*{\headtitle}[2]{\indentiii\simplecell{\heading#1{#2}}}
%%
%% === Navigation and Main Row ===
%% |\PAGENAVI| closes the head row and opens the ``navigation"
%% column, actually including an `{itemize}' environment.
%% Accordingly, `writings.fdf' has a command `\fileitem'.
%% But it seems that I have not been sure ...
\newcommand*{\PAGENAVI}{%
\indenti\endspancolscell\CLBrk
\indenti\starttr\CLBrk
\ \comment{NAVIGATION COL}\CLBrk
\indentii\FixedWidthCell\pagenavicolwidth
{\@class{paper}
%% <- using `@class'=`paper' here is my brother's idea,
%% not sure about it ...
\@valign@t}
%% omitting `\@height{100\%}'
\itemize}
%% |\PAGEMAINvar{<width>}| closes the navigation column
%% and opens the ``main content" column. The latter gets
%% width <width>:
\newcommand*{\PAGEMAINvar}[1]{%
\indentii\enditemize\ \endFixedWidthCell\CLBrk
\ \comment{ MAIN COL }\CLBrk
\indentii\FixedWidthCell{#1}{}}
%% ... The width may be specified as |\pagemaincolwidth|,
%% then |\PAGEMAIN| works like `\PAGEMAINvar{\pagemaincolwidth}':
\newcommand*{\PAGEMAIN}{\PAGEMAINvar\pagemaincolwidth}
%%
%% === Footer Row ===
%% |\PAGEFOOT| closes the ``main content" column as well as
%% the second row, and opens the footer row:
\newcommand*{\PAGEFOOT}{%
\indentii\endFixedWidthCell\CLBrk
% \indentii\tablehspace{96}\CLBrk %% vs. \pagemaincolwidth
%% <- TODO margin right of foot
\indenti\endtr\CLBrk
\ \comment{ FOOT ROW / }\CLBrk
\indenti\spancolscell{2}{\@class{paper} \@align@c}%
%% <- again class ``paper"!?
}
%% |\PAGEEND| closes the footer row and provides all the rest
%% ... needed?
\newcommand*{\PAGEEND}{\indenti\endspancolscell\endTable}
%%
%% == The End and HISTORY ==
\endinput
HISTORY
2011/04/29 started (? \if...)
2011/09/01 to CTAN as `twocolpg.sty'
2011/09/02 renamed
2011/10/09f. documentation more serious
2011/10/13 `...:' OK
|