summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/morehype/blogdot.sty
blob: 08f4779a0997c4287664bb6e01aa214fd5c266e2 (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
\NeedsTeXFormat{LaTeX2e}[1994/12/01] %% \newcommand* etc. 
\ProvidesPackage{blogdot}[2011/10/10 v0.2 HTML presentations (UL)]
%% 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' Required ==
%% 'blogdot' is an extension of 'blog' 
%% (but what about options? TODO):
\RequirePackage{blog}
%% == Size Parameters ==
%% \label{sec:dot-size}
%% I assume that it is clear what the following
%% six page dimension parameters 
%% \begin{quote}
%% |\leftpagemargin|, |\rightpagemargin|, 
%% |\upperpagemargin|,\\|\lowerpagemargin|, 
%% |\typeareawidth|, |\typeareaheight|
%% \end{quote}
%% mean. 
%% The choices are what I thought should work best 
%% on my 1024$\times$600 screen; but I had to optimize 
%% the left and right margins experimentally
%% (with Mozilla Firefox~3.6.22 for Ubuntu canonical~-~1.0);
%% see `blogdot.cfg':
\newcommand*{\leftpagemargin}{192}
\newcommand*{\rightpagemargin}{\leftpagemargin}
%% So |\rightpagemargin| ultimately is the same as 
%% |\leftpagemargin| as long as you don't redefine it, 
%% and it suffices to `\renewcommand' `\leftpagemargin'
%% in order to get a horizontically centered type area 
%% with user-defined margin widths.---Something analogous
%% applies to |\upperpagemargin| and |\lowerpagemargin|:
\newcommand*{\upperpagemargin}{80}
\newcommand*{\lowerpagemargin}{\upperpagemargin}
%% A difference to the ``horizontal" parameters is 
%% (I expect) that the position of the type area on the 
%% screen is affected by |\upperpagemargin| only, 
%% and you may choose |\lowerpagemargin| just large enough 
%% that the next slide won't be visible on any computer screen 
%% you can think of.
\newcommand*{\typeareawidth}{640}
\newcommand*{\typeareaheight}{440}
%% Centering with respect to web page body may work better on 
%% different screens (2011/10/03), but it doesn't work here
%% (2011/10/04).
% \renewcommand*{\body}{%
%     </head>\CLBrk
%     <body \@bgcolor{\bodybgcolor} \@align@c>}
%%
%% == (Backbone for) Starting a ``Slide" ==
%% \label{sec:dot-start}
%% |\startscreenpage{<style>}{<anchor-name>}|
\newcommand*{\startscreenpage}[2]{%% 0 2011/09/25!?:
    \startTable{%
        \@cellpadding{0} \@cellspacing{0}%
        \maybe@showmargins
    }%
    \CLBrk                              %% 2011/10/03
    \starttr
%% First cell determines both
%% height of upper page margin |\upperpagemargin|
%% and
%% width of left page margin |\leftpagemargin|:
      \startTd{\@width {\leftpagemargin }%
               \@height{\upperpagemargin}}%
%         \textcolor{\bodybgcolor}{XYZ}%
      \endTd
%% Using |\typeareawidth|:
%       \startTd{\@width{\typeareawidth}}\endTd
      \simplecell{%
        \CLBrk
        \hanc{#2}{\hvspace{\typeareawidth}% 
                          {\upperpagemargin}}%
        \CLBrk
      }%
%% Final cell of first row determines right margin width:
      \startTd{\@width{\leftpagemargin}}\endTd
    \endtr
%     \tablerow{#1}%
    \starttr
    \emptycell\startTd{\@height{\typeareaheight}#1}%
}
%% |\ShowBlogDotMargins| shows borders of the page margins:
%% %% 2011/10/03
\let\maybe@showmargins\@empty
\newcommand*{\ShowBlogDotMargins}{%
    \def\maybe@showmargins{\@frame@box rules="all"}}
%% However, the rules seem to affect horizontal positions ...
%%
%% |\titlescreenpage| (`\STARTscreenpage' TODO?) %% 2011/10/03
%% opens the title page (I thought). To get it to your screen, 
%% (make and) click a link like 
%% \[`\ancref{START}{start presentation}':\]
\newcommand*{\titlescreenpage}{%
    \startscreenpage{\@align@c}{START}}
%% 
%% == Finishing a ``Slide" and ``Restart" (Backbone) ==
%% \label{sec:dot-fin}
%% |\screenbottom{<next-anchor>}| finishes the current slide 
%% and links to the <next-anchor>, the anchor of a slide opened by 
%% \[`\startscreenpage{<style>}{<next-anchor>}'.\] 
%% More precisely, the margin below the type area is that link.
%% The corner at its right is a link to the anchor to whose name 
%% |\BlogDotRestart| expands. 
\newcommand*{\screenbottom}[1]{%
    \endTd\emptycell
    \endtr
    \CLBrk
    \starttr
      \emptycell
      \CLBrk
      \simplecell{\ancref{#1}%
                         {\hvspace{\typeareawidth}% 
                                  {\lowerpagemargin}}}%
      \CLBrk
      \simplecell{\ancref{\BlogDotRestart}% 
                         {\hvspace{\rightpagemargin}% 
                                  {\lowerpagemargin}}}%
    \endtr
    \CLBrk
    \endTable
}
%% The default for |\BlogDotRestart| is |START|---the title page. 
%% You can `\renew'\-`command' it so you get to a slide 
%% containing an overview of the presentation.
\newcommand*{\BlogDotRestart}{START}
%% 
%% == Moving to Next ``Slide" (User Level) == 
%% \label{sec:dot-next}
%% |\nextscreenpage{<style>}{<anchor-name>}|
%% puts closing the previous slide and opening the next 
%% one---having anchor name `<anchor-name>'---together.
%% <style> is for style settings for the next page, 
%% made here for choosing between centering the page/slide content 
%% and aligning it flush left.
\newcommand*{\nextscreenpage}[2]{%
    \screenbottom{#2}\CLBrk
    \hrule           \CLBrk
    \startscreenpage{#1}{#2}}
%% |\nextcenterscreenpage{<anchor-name>}| chooses centering 
%% the slide content:
\newcommand*{\nextcenterscreenpage}{\nextscreenpage{\@align@c}}
%% |\nextnormalscreenpage{<anchor-name>}| chooses flush left
%% on the type area determined by |\typeareawidth|:
\newcommand*{\nextnormalscreenpage}{\nextscreenpage{}}
%% 
%% == Constructs for Type Area ==
%% \label{sec:dot-type}
%% If you want to get centered titles with \xmltagcode{h2} etc., 
%% you should declare this in `.css' files. But you may consider 
%% this way too difficult, and you may prefer to declare this 
%% right in the \HTML\ code. That's what I do! I use 
%% |\cheading{<digit>}{<text>}| for this purpose. 
\newcommand*{\cheading}[1]{\TagSurr{h#1}{\@align@c}}
%% |\begin{textblock}{<width>}| opens a |{textblock}| 
%% environment. The latter will contain text that will be flush left
%% in a narrower text area---of width <width>---than the one 
%% determined by |\typeareawidth|. It may be used on 
%% "centered" slides. It is made for lists whose entries are 
%% so short that the page would look unbalanced under a 
%% centered title with the list adjusted to the left 
%% of the entire type area. (Thinking of standard \LaTeX, 
%% it is almost the `{minipage}' environment, however lacking 
%% the footnote feature, in that respect it is rather 
%% similar to `\parbox' which however is not an environment.)
\newenvironment*{textblock}[1]
    {\startTable{\@width{#1}}\starttr\startTd{}}
    {\endTd\endtr\endTable}
%%
%% == Test for `blogdot.cfg' ==
\InputIfFileExists{blogdot.cfg}{%
    \typeout{
        * Using local settings from \string`blogdot.cfg\string' *}%
}{}
%% == The End ==
\endinput
%%
%% == VERSION HISTORY ==
v0.1    2011/09/21f.  started
        2011/09/25    spacing/padding off
        2011/09/27    \CLBrk
        2011/09/30    \BlogDotRestart
v0.2    2011/10/03    four possibly independent page margin 
                      parameters; \hvspace moves to texblog.fdf
        2011/10/04    renewed \body commented out
        2011/10/07    documentation
        2011/10/08    added some labels
        2011/10/10    v etc. in \ProvidesPackage