summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/morehype/blog.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-06-01 00:22:45 +0000
committerKarl Berry <karl@freefriends.org>2012-06-01 00:22:45 +0000
commit2ac35adc5ecd45f8855d340dd51c54b54c8baffc (patch)
tree3a33214fa67b7c5513d171e69b3c2b7877bb8555 /Master/texmf-dist/tex/latex/morehype/blog.sty
parent338e91cd3a8d49148c9fc68823f26b28dff0f77e (diff)
morehype (30may12)
git-svn-id: svn://tug.org/texlive/trunk@26758 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/morehype/blog.sty')
-rw-r--r--Master/texmf-dist/tex/latex/morehype/blog.sty897
1 files changed, 606 insertions, 291 deletions
diff --git a/Master/texmf-dist/tex/latex/morehype/blog.sty b/Master/texmf-dist/tex/latex/morehype/blog.sty
index 947ebabfe96..174ef0c5638 100644
--- a/Master/texmf-dist/tex/latex/morehype/blog.sty
+++ b/Master/texmf-dist/tex/latex/morehype/blog.sty
@@ -1,6 +1,5 @@
-\NeedsTeXFormat{LaTeX2e}[1994/12/01] %% \newcommand* etc.
-\ProvidesPackage{blog}[2011/10/22 v0.62 simple fast HTML (UL)]
-%% copyright (C) 2010 2011 Uwe Lueck,
+\ProvidesPackage{blog}[2012/05/15 v0.7 simple fast HTML (UL)]
+%% copyright (C) 2010 2011 2012 Uwe Lueck,
%% http://www.contact-ednotes.sty.de.vu
%% -- author-maintained in the sense of LPPL below.
%%
@@ -16,62 +15,27 @@
%% http://www.contact-ednotes.sty.de.vu
%%
%% == Processing ==
-%% We are building on the 'fifinddo' package:
-\RequirePackage{fifinddo}
-%% |\CLBrk| is a \emph{code line break}
-%% (also saving subsequent comment mark):
-\newcommand*{\CLBrk}{^^J}
+%% \label{sec:process}
+%% === Requirement ===
+%% We are building on the 'fifinddo' package
+%% (using `\protected@edef' for \secref{ligs}):
+\RequirePackage{fifinddo}[2011/11/21]
+%%
+%% === Output File Names ===
%% |\htmakeext| is the extension of the generated file.
%% Typically it should be `.html', as set here,
%% but my Atari emulator needs `.htm'
%% (see `texblog.fdf'):
\newcommand*{\htmakeext}{.html}
-%% |\BlogCopyFile[<changes>]{<src-file>}|
-%% ``copies" the \TeX\ source file <src-file>
-%% into the file specified by `\ResultFile'.
-%% As in \TeX\ an empty line starts a new paragraph,
-%% we ``interpret" an empty source line as
-%% \HTML\ tag \xmltagcode{p} for starting a new paragraph.
-%% Empty source lines following some first empty source
-%% line immediately are ignored
-%% (``compression" of empty lines).---However,
-%% I am not entirely sure that this won't have
-%% unwanted effects, so it must be required
-%% explicitly by |\BlogAutoPars|, or by calling the
-%% package with option |[autopars]|.
-%% In the latter case, it can be turned off by
-%% |\noBlogAutoPars|
-\newif\ifBlogAutoPars
-\newcommand*{\BlogAutoPars}{\BlogAutoParstrue}
-\newcommand*{\noBlogAutoPars}{\BlogAutoParsfalse}
-\DeclareOption{autopars}{\BlogAutoPars}
-\ProcessOptions
-\MakeOther\< \MakeOther\> %% TODO ...
-\newcommand*{\BlogCopyFile}[2][]{%
-% \typeout{^^J\screenqtd{blog.sty} generating %% 2011/10/05
-% \screenqtd{\htmljob\htmakeext}}%
-%% <- 2011/10/22: such a message should be in driver file
-%% when it is clear how many source files the target file has.
- \ProcessFileWith[\BlogCodes
- \let\ProvidesFile\BlogProvidesFile %% 2011/02/24
- \let\protect\@empty %% 2011/03/24
- #1]{#2}{%
- \IfFDinputEmpty
- {\IfFDpreviousInputEmpty
- \relax
- {\WriteResult{\ifBlogAutoPars<p>\fi}}}%
- \CopyLine
- }%
-}
-%% For a while, line endings swallowed inter-word spaces,
-%% until I found the setting of `\endlinechar'
-%% ('fifinddo''s default is `-1')
-%% in |\BlogCodes|:
-\newcommand*{\BlogCodes}{% %% 2010/09/07
- \endlinechar`\ \catcode`\~\active \BasicNormalCatCodes}
-%% The tilde is active as in Plain~TeX too, it is so natural to
-%% use it for abbreviating \HTML's `&nbsp;'!
%%
+%% === General Insertions ===
+%% |\CLBrk| is a \emph{code line break}
+%% (also saving subsequent comment mark in macro definitions):
+\newcommand*{\CLBrk}{^^J}
+%% |\ | is turned into an alias for `\space',
+%% so it inserts a blank space. It even works at line ends,
+%% thanks to the choice of `\endlinechar' in \secref{catcodes}.
+\let\ \space
%% %% v0.42:
%% |\ProvidesFile{<file-name>.tex}[<file-info>]| \ is supported
%% for use with the \CtanPkgRef{morehype}{myfilist}
@@ -85,7 +49,9 @@
\comment{ generated from\CLBrk\CLBrk
\ \ \ \ \ \ \ \ \ #1, #2,\CLBrk\CLBrk
\ \ \ \ \ with blog.sty,
- \GenDate\ }}} %% TODO predefine?
+ \isotoday\ }}}
+\edef\isotoday{%% texblog 2011/11/02, here 2011/11/20
+ \the\year-\two@digits{\the\month}-\two@digits{\the\day}}
%% %% changes 2011/02/24:
%% (TODO: customizable style.)---Due to the limitations
%% of the approach reading the source file
@@ -94,9 +60,166 @@
%% the closing brace of its mandatory argument.
%% The feature may require inserting
%% \[`\let\ProvidesFile\BlogProvidesFile'\]
-%% somewhere, e.g., in `\BlogCopyFile'.
+%% somewhere, e.g., in `\BlogProcessFile'.
+%%
+%% === Category Codes etc. ===
+%% \label{sec:catcodes}
+%% For a while, line endings swallowed inter-word spaces,
+%% until I found the setting of `\endlinechar'
+%% ('fifinddo''s default is `-1')
+%% in |\BlogCodes|:
+\newcommand*{\BlogCodes}{% %% 2010/09/07
+ \endlinechar`\ %
+%% <- Comment character to get space rather than `^^M'!%%% 2011/11/08
+%% ---The tilde |~| is active as in Plain~TeX too, it is so natural to
+%% use it for abbreviating \HTML's `&nbsp;'! %% moved up 2011/11/08
+% \catcode`\~\active
+ \MakeActiveDef\~{&nbsp;}%% for \FDpseudoTilde 2012/01/07
+%% \qtd{&'} for \HTML\ convenience (cf. \secref{quotes}):
+ \MakeActiveDef\'{&rsquo;}% %% here 2011/11/08
+ \BasicNormalCatCodes}
+% \MakeOther\< \MakeOther\> %% rm. 2011/11/20
+%%
+%% === The Processing Loop ===
+%% \[|\BlogProcessFile[<changes>]{<source-file>}|\]
+%% %% <- display 2011/11/06
+%% ``copies" the \TeX\ source file <source-file>
+%% into the file specified by `\ResultFile'.
+\newcommand*{\BlogProcessFile}[2][]{% %% 2011/11/05
+ \ProcessFileWith[\BlogCodes
+ \let\ProvidesFile\BlogProvidesFile %% 2011/02/24
+ \let\protect\@empty %% 2011/03/24
+ \let\@typeset@protect\@empty %% 2012/03/17
+ #1]{#2}{%
+ \IfFDinputEmpty
+ {\IfFDpreviousInputEmpty
+ \relax
+ {\WriteResult{\ifBlogAutoPars<p>\fi}}}%
+ \BlogProcessLine %% 2011/11/05
+ }%
+}
+%% 'fifinddo' v0.5 allows the following %% 2011/11/20
+%% \[|\BlogProcessFinalFile[<changes>]{<source-file>}|\]
+%% working just like `\BlogProcessFile' except that the final
+%% `\CloseResultFile' is issued automatically, no more need
+%% having it in the driver file.
+\newcommand*{\BlogProcessFinalFile}{%
+ \FinalInputFiletrue\BlogProcessFile}
+%% TODO: %% 2011/11/20
+%% optionally include `.css' code with \xmltagcode{style}.
+%% === \emph{Executing} Source File Code Optionally ===
+%% For v0.7, %% 2011/11/05
+%% `\BlogCopyFile' is renamed `\BlogProcessFile'; and in its code,
+%% `\CopyLine' is replaced by `\BlogProcessLine'. The purpose
+%% of this is supporting 'blogexec.sty' that allows intercepting
+%% certain commands in the line. We provide initial versions of
+%% 'blogexec''s switching commands that allow invoking 'blogexec'
+%% ``on the fly":
+\newcommand*{\ProvideBlogExec}{\RequirePackage{blogexec}}
+%% \CtanPkgRef{dowith}{dowith.sty} is used in the %% 2012/01/06
+%% present package to reduce package code and documentation space:
+\RequirePackage{dowith}
+\setdo{\providecommand*#1{\ProvideBlogExec#1}}
+\DoDoWithAllOf{\BlogInterceptExecute \BlogInterceptEnvironments
+ \BlogInterceptExtra \BlogInterceptHash }
+%% %% <- Hash 2011/11/08
+%% |\BlogCopyLines| switches to the ``copy only"
+%% (``compressing" empty lines) functionality of the original
+%% `\BlogCopyFile':
+\newcommand*{\BlogCopyLines}{%
+% \let\BlogProcessLine\CopyLine}
+ \def\BlogProcessLine{% %% 2011/11/21, corr. 2012/03/14:
+ \WriteResult{\ProcessInputWith\BlogOutputJob}}}
+%% <- This is a preliminary support for ``ligatures"---see
+%% \secref{ligs}. %%% --, not working inside braces.
+%% |\NoBlogLigs| sets the default to mere copying:
+\newcommand*{\NoBlogLigs}{\def\BlogOutputJob{LEAVE}}
+\NoBlogLigs
+%% TODO more from `texblog.fdf' here, problems with `writings.fdf',
+%% see its `makehtml.tex'
+%% %% 2011/11/06:
+%% % ... and this will be the setting with pure 'blog.sty':
+%%
+%% `\BlogCopyLines' %% 2011/11/21
+%% will be the setting with pure 'blog.sty':
+\BlogCopyLines
+%% OK, let's not remove |\BlogCopyFile| altogether, rebirth:
+\newcommand*{\BlogCopyFile}{\BlogCopyLines\BlogProcessFile}
+%%
+%% === ``Ligatures" ===
+%% \label{sec:ligs}
+%% With v0.7, we introduce a preliminary method to use the
+%% ``ligatures" `--' and `---' with pure expansion.
+%% At this occasion, we also can support the notation
+%% \code{\dots} for `\dots', as well as arrows
+%% (as in `mdoccorr.cfg'). Note that this is somewhat
+%% \strong{dangerous}, especially the source must not
+%% contain ``explicit" \HTML\ comment, comments must use
+%% 'blog.sty''s `\comment' or the `{commentlines}'
+%% environment. Therefore these ``ligatures" must be activated
+%% explicitly by |\UseBlogLigs|:
+\newcommand*{\UseBlogLigs}{\def\BlogOutputJob{BlogLIGs}}
+%% In order to work inside braces, the source file better should
+%% be preprocessed in ``plain text mode."
+%% (TODO: Use `\ifBlogLigs', and in a group use
+%% `\ResultFile' for an intermediate `\htmljob.lig'.
+%% And TODO: Use `\let\BlogOutputJob'.)
+%% On the other hand, the present approach allows switching
+%% while processing with `\EXECUTE'! Also, intercepted commands
+%% could apply the replacements on their arguments---using
+%% |\ParseLigs{<arg>}|: %% 2011/11/27
+\newcommand*{\ParseLigs}[1]{\ProcessStringWith{#1}{BlogLIGs}}
+%% (`\ProcessStringWith' is from 'fifinddo'.)
+%%
+%% The replacement chain follows (TODO move to `.cfg').
+%% As opposed to `mdoccorr.cfg' for 'makedoc.sty',
+%% we are dealing with ``normal \TeX" code
+%% (regarding category codes, 'fifinddo.sty'
+%% as of 2011/11/21 is needed for `\protect').
+%% Moreover, space tokens after patterns are already there
+%% and need not be inserted after control sequences.
+\FDpseudoTilde
+\StartPrependingChain
+\PrependExpandableAllReplacer{blog...}{...}{\protect\dots}
+\PrependExpandableAllReplacer{blog--}{--}{\protect\endash}
+\PrependExpandableAllReplacer{blog---}{---}{\protect\emdash}
+%% <- Cf. thin surrounding spaces with
+%% `\enpardash' ('texblog', maybe \meta{hair space} U+200A
+%% instead of thin space), difficult at code line beginnings
+%% or endings and when a paragraph starts with an emdash.
+%% I.e., perhaps better don't use it if you want to have
+%% such spaces.---\qtd{`---'} must be replaced before \qtd{`--'}!
+\PrependExpandableAllReplacer{blog->}{->}{\protect\to}
+\PrependExpandableAllReplacer{blog<-}{<-}{\protect\gets}
+%% You also could set `\BlogOutputJob' to a later part of the chain,
+%% or more globally change the following:
+\CopyFDconditionFromTo{blog<-}{BlogLIGs}
+%% % TODO: Seems to slow down processing by a major part of a second.
+%% % Reduce replacements? Maybe do all of this within source file!?
+%%
+%% === \xmltagcode{p} from Empty Line, Package Option ===
+%% \label{sec:autopars}
+%% As in \TeX\ an empty line starts a new paragraph,
+%% we might ``interpret" an empty source line as
+%% \HTML\ tag \xmltagcode{p} for starting a new paragraph.
+%% Empty source lines following some first empty source
+%% line immediately are ignored
+%% (``compression" of empty lines).
+%% However, this sometimes has unwanted effects
+%% (comment lines TODO), %% 2011/11/20
+%% so it must be required explicitly by |\BlogAutoPars|,
+%% or by calling the package with option |[autopars]|.
+%% In the latter case, it can be turned off by
+%% |\noBlogAutoPars|
+\newif\ifBlogAutoPars
+\newcommand*{\BlogAutoPars}{\BlogAutoParstrue}
+\newcommand*{\noBlogAutoPars}{\BlogAutoParsfalse}
+%% `\BlogAutoPars' is issued by package option %% 2011/11/20
+%% |[autopars]|:
+\DeclareOption{autopars}{\BlogAutoPars}
+\ProcessOptions
+%% See \secref{p-br} for other ways of breaking paragraphs.
%%
-%% \pagebreak %% 2011/10/10
%% == General \HTML\ Matters ==
%% The following stuff is required for any web page
%% (or hardly evitable).
@@ -141,31 +264,32 @@
\def\reserved@a{@#1}%
\@ifundefined{@#1}%
{\@namedef{@#1}##1{#1="##1"}}%
- \@notdefinable}
+ \@notdefinable}
%% So after `\declareHTMLattrib{<attr>}', `\@<attr>' is a
%% \TeX\ macro expecting one parameter for the specification.
%%
+%% % |\declareHTMLattribs{{<attr>}<list>}| essentially issues
+%% % \[`\declareHTMLattrib{<attr>}\declareHTMLattribs{<list>}'\]
+%% % while `\declareHTMLattribs{}' essentially does nothing---great,
+%% % this is an explanation by recursion!
+%% % % \newcommand*{\declareHTMLattribs}{\DoWithAllOf\declareHTMLattrib}
%% A few frequent attributes are declared this way here.
%% %% 2011/09/27:
%% |@class|, |@id|, |@style|, |@title|, |@lang|, and |@dir|
%% are the ones named on
%% \wikienref{HTML\#Attributes}{\meta{Wikipedia}}:
\let\@class\relax %% for tab/arr in latex.ltx
-\declareHTMLattrib{class}
-\declareHTMLattrib{id}
-\declareHTMLattrib{style}
-\let\@title\relax %% for \title in latex.ltx
-\declareHTMLattrib{title} %% 2011/04/26
-\declareHTMLattrib{lang}
-\declareHTMLattrib{dir}
+\let\@title\relax %% for \title in latex.ltx, %% 2011/04/26
+\DoWithAllOf\declareHTMLattrib{{class}{id}{style}{title}{lang}{dir}}
%% |@type| is quite frequent too: %% doc. 2011/09/27
\declareHTMLattrib{type}
%% |@href| is most important for that ``hyper-text:"
\declareHTMLattrib{href}
%% ... and |@name| (among other uses) is needed for
-%% |@name| for %% 2011/04/26
%% hyper-text anchors:
\declareHTMLattrib{name} %% 2010/11/06
+%% |@content| appears with `\MetaTag' below: %% 2011/11/05
+\declareHTMLattrib{content}
%% |@bgcolor| is used in tables as well as
%% for the appearance of the entire page:
\declareHTMLattrib{bgcolor}
@@ -206,53 +330,55 @@
%% \emph{either} this reference to attributes cannot be used in
%% ``author" source files for generating HTML---\emph{or} `@'
%% cannot be used for ``private" (internal) macros.
-%% Cf. |\ContentAtt| for \xmltagcode{meta} tags ...
-%% well, not so bad, as the main purpose of this namespace
-%% is saving tokens \emph{in macros.}
+%% % Cf. |\ContentAtt| for \xmltagcode{meta} tags ...
+%% % well, not so bad, as the main purpose of this namespace
+%% % is saving tokens \emph{in macros.}
%%
-%% === \HTML's Special Symbols ===
+%% === Hash Mark ===
%% |#| is needed for numerical specifications in \HTML,
-%% especially colors and Unicode symbols,
+%% especially colours and Unicode symbols,
%% while it plays a different (essential) role in our
%% definitions of \TeX\ macros here.
%% We redefine \LaTeX's |\#|
-%% for a kind of ``quoting" `#' in macro definitions
-%% in order to refer to their \HTML\ meaning.---I \textbf{wonder}
-%% what I had in mind with the |&| things here.
-%% I cannot find any use of |\AmpMark| in my code
-%% (including my web pages). There is no real problem
-%% with calling special \HTML\ symbols, `&' is simply
-%% made `other' already here for macros calling those symbols
-%% (below), and in processing source files, it is as well
-%% `other' by default. The symbols section, however, redefines |\&|
-%% for calling \HTML's ampersand symbol.
-{\catcode`\&=12 \catcode`\#=12
- \gdef\AmpMark{&} \gdef\#{#}}
+%% for a kind of ``quoting" `#'
+%% (in macro definitions) %% (...) 2011/11/08
+%% in order to refer to their \HTML\ meaning.%%%---I wonder
+%% %% <- rm. 2011/11/08 ->
+%% % what I had in mind with the |&| things here.
+%% % I cannot find any use of |\AmpMark| in my code
+%% % (including my web pages). There is no real problem
+%% % with calling special \HTML\ symbols, `&' is simply
+%% % made `other' already here for macros calling those symbols
+%% % (below), and in processing source files, it is as well
+%% % `other' by default. The symbols section, however, redefines |\&|
+%% % for calling \HTML's ampersand symbol.
+{ \MakeOther\# \gdef\#{#} %% \M... 2011/11/08
+% \catcode`\&=12 \gdef\AmpMark{&} %% rm. 2011/11/08
+}
%% ... `\CompWordMark' etc.?
%%
+%% === ``Escaping" \HTML\ Code for ``Verbatim" ===
+%% \label{sec:html-verb} %% 2011/11/23
+%% |\xmltagcode{<chars>}| yields \qtd{\xmltagcode{<chars>}}:
+\newcommand*{\xmltagcode}[1]{\code{\lt#1\gt}}
+%% |\xmlentitycode{<name>}| yields the code \qtd{`&&<name>;'} for an
+%% entity with name <name>:
+\newcommand*{\xmlentitycode}[1]{\code{\&#1;}}
+%%
%% === Head ===
%% |\head| produces the first two tags that an \HTML\ file must start:
\newcommand*{\head}{<html><head>} %% ^^J rm 2010/10/10
-%% |\MetaTag{<inside>}| and |\ContentAtt{<value>}|
-%% are internal shortcuts:
-\newcommand*{\MetaTag}[1]{\space\space<meta #1>}
-\newcommand*{\ContentAtt}[1]{content="#1"}
+%% |\MetaTag{<inside>}| creates a \xmltagcode{meta} tag:
+\newcommand*{\MetaTag}[1]{\indenti<meta #1>} %% \indenti 2011/11/05
%% |\charset{<code-page>}|
\newcommand*{\charset}[1]{%
- \MetaTag{http-equiv="Content-Type" \ContentAtt{text/html; #1}}}
-%% |\description{<text>}| for web searches (I think):
-% \newcommand*{\description}[1]{%
-% \MetaTag{\@name{description} \ContentAtt{#1}}}
-%% ... an outright \textbf{mistake!} %% commented out 2011/10/05
-%% The definition is overridden
-%% to get the \HTML\ equivalent to \LaTeX's `description' environment.
-%% `\newcommand' did not warn here because we don't load any \LaTeX\
-%% class for text-processing macros and code generation.---And so
-%% some |\MetaDescr| should be defined---and used finally! TODO
+ \MetaTag{http-equiv="Content-Type" \@content{text/html; #1}}}
+%% TODO: \xmltagcode{meta \@name{description} \@content{<text>}}
+%% %% <- 2011/11/05
%%
%% |\robots{<instructions>}|:
\newcommand*{\robots}[1]{%% juergenf: index, follow, noarchive
- \MetaTag{\@name{robots} \ContentAtt{#1}}}
+ \MetaTag{\@name{robots} \@content{#1}}}
%% |\norobots| for privacy: %% 2011/03/16
\newcommand*{\norobots}{\robots{noarchive,nofollow,noindex}}
%% |\stylesheet{<media>}{<css>}| uses <css>`.css' for
@@ -265,13 +391,15 @@
%% %% 2011/10/05:
%% Alternatively, style declarations may occur in the
%% \xmltagcode{style} element. It can be accessed by the
-%% |{style}| environment (cf. Sec.~\ref{sec:env}):
+%% |{style}| environment (cf. \secref{env}):
\newenvironment*{style}[1]
{<style \@type{text/css} media="#1">}
{</style>}
%% With |\title{<text>}|, <text> heads %% grammar? TODO 2010/04/08
%% the browser window:
-\renewcommand*{\title}[1]{\space\space<title>#1</title>}
+%% % \renewcommand*{\title}[1]{\space\space<title>#1</title>}
+%% %% <- 2011/12/12 ->
+\renewcommand*{\title}{\space\space\SimpleTagSurr{title}}
%%
%% === Body ===
%% |\body| separates the `head' element from the `body' element
@@ -283,8 +411,55 @@
%% elements.
\newcommand*{\finish}{</body></html>}
%%
+%% === Comments ===
+%% |\comment{<comment>}| produces a one-line \HTML\ comment.
+%% By contrast, there is an environment
+%% |{commentlines}{<comment>}|
+%% for multi-line comments. %% was mult-l... 2011/09/08
+%% It is convenient for ``commenting out"
+%% code (unless the latter contains other \HTML\ comments ...)
+%% where <comment> is a \emph{comment} for explaining what is
+%% commented out. %% 2010/11/14
+\newcommand*{\comment}[1]{<!--#1-->}
+% \newcommand{\commentlines}[1]{\comment{^^J#1^^J}} %% 2010/05/07
+% %% <- TODO bzw. \endlinechar=`\^^J 2010/05/09 back 2010/05/10
+\newenvironment{commentlines}[1] %% 2010/05/17
+ {<!--#1}
+ {-->}
+%%
+%% == Paragraphs and Line Breaks ==
+%% \label{sec:p-br}
+%% 2010/04/28:
+%% \xmltagcode{br} for manual line breaking
+%% can be generated either by |\newline| or by |\\|:
+\renewcommand*{\newline}{<br>}
+\let\\\newline
+%% Automatical insertion of \xmltagcode{p} tags
+%% for starting new paragraphs according to
+%% \secref{autopars} has been difficult,
+%% especially comment lines so far insert unwanted
+%% paragraph breaks (TODO 2011/11/20).
+%% So here are some ways to use \LaTeX/ Plain \TeX\
+%% commands---or ...: %% 2011/11/23
+% \def\par{<p>} %% + empty lines !? 2010/04/26
+%% <- difficult with `\stop'; 2010/09/10:
+%% |\endgraf| produces \xmltagcode{/p}---TODO!? %% todo 2011/11/23
+\renewcommand*{\endgraf}{</p>}
+%% %% 2011/11/23:
+%% However, I rather have decided for inserting a literal
+%% \qtd{\xmltagcode{p}} using an editor (keyboard) shortcut.
+%%
+%% |\rightpar{<text>}| places <text> flush right.
+%% I have used this for \qtd{Last revised \dots} and for placing
+%% navigation marks.
+\newcommand*{\rightpar}{\TagSurr p\@align@r} %% 2010/06/17
+%% %% 2011/04/29:
+%% Often I use `\rightpar' with \textit{italics},
+%% now there is |\rightitpar{<text>}| for this purpose:
+\newcommand*{\rightitpar}[1]{\rightpar{\textit{#1}}}
%%
%% == Fonts ==
+%% \label{sec:fonts}
%% |\heading{<level>}{<text>}| prints <text> with size dependent
%% on <level>. The latter may be one out of
%% `1', `2', `3', `4', `5', `6'. %% 2011/05/12
@@ -309,7 +484,7 @@
%% |\textcolor| is from \LaTeX's 'color' package
%% that we won't load for generating \HTML,
%% so it is ``new" here, it is just natural to use it
-%% for colored text. %% (2010/05/15):
+%% for coloured text. %% (2010/05/15):
%% \xmltagcode{font} is deprecated, use %% 2011/10/20
%% \xmltagcode{span} instead:
% \newcommand*{\textcolor}[1]{\TagSurr{font}{color="#1"}}
@@ -332,10 +507,22 @@
%% %% 2011/03/09:
%% |\var{<symbol(s)>}| accesses the \xmltagcode{var} element:
\newcommand*{\var}{\SimpleTagSurr{var}}
-%% |\acronym{<chars>}| ... there is `\acro' in the TUGboat
-%% macros, while \HTML\ provides an \xmltagcode{acronym}
-%% environment ... %% 2011/09/21
+%% %% 2011/09/21, 2012/01/06:
+%% For tagging acronyms,
+%% \HTML\ offers the \xmltagcode{acronym} element,
+%% and the \httpref{ctan.org/pkg/tugboat}{\acro{TUG}boat macros}
+%% provide |\acro{<chars>}|. I have used the latter for some
+%% time in my package documentations anyway. For v0.7, %% 2012/01/06
+%% I add the latter here as an alias for |\acronym{<chars>}|
+%% (supporting both naming policies mentioned in Sec.~\ref{name-policy}):
\newcommand*{\acronym}{\SimpleTagSurr{acronym}}
+\newcommand*{\acro}{} \let\acro\acronym
+%% %% 2012/02/04:
+%% |\newacronym{<LETTERS>}| saves you from doubling the <LETTERS>
+%% when you want to create the shorthand macro `\<LETTERS>':
+\newcommand*{\newacronym}[1]{%
+ \expandafter\newcommand\expandafter*\csname#1\endcsname{%
+ \acronym{#1}}}
%%
%% == Environments ==
%% \label{sec:env}
@@ -362,7 +549,10 @@
%% ... moving |{english}| to `xmlprint.cfg'
%% 2010/05/22 ...%% doc 2010/11/06
%%
-%% As formerly with ``fonts," we have \emph{two} policies for
+%% As formerly with
+%% \hyperref[sec:fonts]{fonts}, %% \hyperref 2012/01/06
+%% we have \emph{two} policies for
+%% \label{name-policy} %% 2012/01/06
%% \textbf{choosing macro names}:
%% (i)~using an \emph{existing} \HTML\ element name,
%% (ii)~using a \LaTeX\ command name for accessing a somewhat
@@ -380,7 +570,7 @@
\@ifstar{\@useHTMLelement[</li>]}{\@useHTMLelement}}
\newcommand*{\@useHTMLelement}[3][]{%
\@namedef{#2}{<#3>}%
- \@namedef{end#2}{#1</#3>}}
+ \@namedef{end#2}{#1\CLBrk</#3>}} %% \CLBrk 2012/04/03
%% Applications:
%%
%% \acro{CARE:} |{small}| is an environment here,
@@ -526,11 +716,11 @@
%% |\httpsref| is the analogue of `\httpref' for `https://':
\newcommand*{\httpsref}{\hnewref{https://}}
%%
-%% == Characters/Symbols == %% `Symbols' until 2011/09/25
+%% == Characters/Symbols == %% `Symbols' until 2011/09/25
%% === Basic Preliminaries ===
%% |&| is made `other' for using it to call \HTML's
%% ``character entities." %% dot inside 2011/02/25
-\@makeother\&
+\MakeOther\&
%% Again we have the two policies about choosing macro names
%% and respectively two new definition commands.
%% |\declareHTMLsymbol{<name>}| defines a macro `\<name>'
@@ -538,6 +728,12 @@
%% hasn't been implemented yet.
%% (TODO; but sometimes redefining ...) %% 2011/02/26
\newcommand*{\declareHTMLsymbol}[1]{\@namedef{#1}{&#1;}}
+%% %% TODO replace \@namedef with \defcsname
+%% |\declareHTMLsymbols{{<name>}<list>}| essentially issues
+%% \[`\declareHTMLsymbol{<attr>}\declareHTMLsymbols{<list>}'\]
+%% while `\declareHTMLsymbols{}' essentially does nothing---great,
+%% this is an explanation by recursion!
+\newcommand*{\declareHTMLsymbols}{\DoWithAllOf\declareHTMLsymbol}
%% |\renderHTMLsymbol{<macro>}{<name>}| \emph{redefines}
%% macro <macro> to expand to `&<name>;':
\newcommand*{\renderHTMLsymbol} [2]{\renewcommand*{#1}{&#2;}}
@@ -547,80 +743,41 @@
\renderHTMLsymbol{\&}{amp}
\let\%\PercentChar
%%
-%% \pagebreak %% output routine problem 2011/10/05
-%% === Diacritics === %% changed 2011/03/04
+%% === Diacritics === %% changed 2011/03/04
%% For the difference between \dqtd{diacritic} and
-%% \dqtd{accent,} see \wikienref{Diacritic}{Wikipedia}.
+%% \dqtd{accent,} see \wikienref{Diacritic}{\meta{Wikipedia.}}
%%
-%% |\ccedil|: %%%, |\eacute|, |\ocirc| (``r\^ole")
-\declareHTMLsymbol{ccedil}
-%% %% 2011/03/04:
-%% \HTML\ entities |&eacute;|, |&ocirc;| etc. can be accessed
-%% by \TeX's accent commands |\'|, |\^|, |\`|, |\"|:
+%% %% replacing \ccedil 2011/11/23:
+%% %%|\ccedil|: %%%, |\eacute|, |\ocirc| (``r\^ole")
+%% % \declareHTMLsymbol{ccedil}
+%% %% 2011/03/04, added example results 2011/11/24:
+%% \HTML\ entities |&eacute;| (\'e),
+%% |&ccedil| (\c{c}), %% 2011/11/23
+%% |&ocirc;| (\^o) etc. can be accessed
+%% by \TeX's accent commands |\'|, |\c|, |\^|, |\`|, |\"|:
% \declareHTMLsymbol{eacute}
% \declareHTMLsymbol{ocirc}
\renewcommand*{\'}[1]{&#1acute;}
+\renewcommand*{\c}[1]{&#1cedil;}
\renewcommand*{\^}[1]{&#1circ;}
\renewcommand*{\`}[1]{&#1grave;}
\renewcommand*{\"}[1]{&#1uml;}
-%% |\uml{<char>}| % yields the umlaut for <char>
-%% may have been overestimated:
-%% % (useful in macro definitions): %% 2010/11/13
-% \newcommand* {\uml}[1] {&#1uml;} %% 2010/08/24
+%% %% 2012/05/13:
+%% former |\uml{<char>}| is obsolete, use |\"<char>|
+%% (or `\"<char>') instead.
+%% % may have been overestimated:
+%% % (useful in macro definitions): %% 2010/11/13
+%% % \newcommand* {\uml}[1] {&#1uml;} %% 2010/08/24
%%
-%% === Greek === %% 2011/02/26
-\declareHTMLsymbol{Alpha}
-\declareHTMLsymbol{alpha}
-\declareHTMLsymbol{Beta}
-\declareHTMLsymbol{beta}
-\declareHTMLsymbol{Gamma}
-\declareHTMLsymbol{gamma}
-\declareHTMLsymbol{Delta}
-\declareHTMLsymbol{delta}
-\declareHTMLsymbol{Epsilon}
-\declareHTMLsymbol{epsilon}
-\declareHTMLsymbol{Zeta}
-\declareHTMLsymbol{zeta}
-\declareHTMLsymbol{Eta}
-\declareHTMLsymbol{eta}
-\declareHTMLsymbol{Theta}
-\declareHTMLsymbol{theta}
-\declareHTMLsymbol{Iota}
-\declareHTMLsymbol{iota}
-\declareHTMLsymbol{Kappa}
-\declareHTMLsymbol{kappa}
-\declareHTMLsymbol{Lambda}
-\declareHTMLsymbol{lambda}
-\declareHTMLsymbol{My}
-\declareHTMLsymbol{my}
-\declareHTMLsymbol{Ny}
-\declareHTMLsymbol{ny}
-\declareHTMLsymbol{Xi}
-\declareHTMLsymbol{xi}
-\declareHTMLsymbol{Omikron}
-\declareHTMLsymbol{omikron}
-\declareHTMLsymbol{Pi}
-\declareHTMLsymbol{pi}
-\declareHTMLsymbol{Rho}
-\declareHTMLsymbol{rho}
-\declareHTMLsymbol{Sigma}
-\declareHTMLsymbol{sigma}
-\declareHTMLsymbol{sigmaf}
-\declareHTMLsymbol{Tau}
-\declareHTMLsymbol{tau}
-\declareHTMLsymbol{Upsilon}
-\declareHTMLsymbol{upsilon}
-\declareHTMLsymbol{Phi}
-\declareHTMLsymbol{phi}
-\declareHTMLsymbol{Chi}
-\declareHTMLsymbol{chi}
-\declareHTMLsymbol{Psi}
-\declareHTMLsymbol{psi}
-\declareHTMLsymbol{Omega} %% render -> declare 2011/02/26
-\declareHTMLsymbol{omega}
-\declareHTMLsymbol{thetasym}
-\declareHTMLsymbol{upsih}
-\declareHTMLsymbol{piv}
+%% === Greek === %% 2011/02/26
+\declareHTMLsymbols{{Alpha}{alpha} %% 2012/01/06
+ {Beta}{beta}{Gamma}{gamma}{Delta}{delta}{Epsilon}{epsilon}
+ {Zeta}{zeta}{Eta}{eta}{Theta}{theta}{Iota}{iota}{Kappa}{kappa}
+ {Lambda}{lambda}{My}{my}{Ny}{ny}{Xi}{xi}{Omikron}{omikron}
+ {Pi}{pi}{Rho}{rho}{Sigma}{sigma}{sigmaf}{Tau}{tau}
+ {Upsilon}{upsilon}{Phi}{phi}{Chi}{chi}{Psi}{psi}
+ {Omega}{omega} %% render -> declare 2011/02/26
+ {thetasym}{upsih}{piv} }
%%
%% === Arrows ===
%% Arrows: |\gets|, |\to|, |\uparrow|, |\downarrow| ...
@@ -662,56 +819,67 @@
\newcommand*{\figurespace}{&\#8199;}
%%
%% === Quotes, Apostrophe, Prime ===
+%% \label{sec:quotes}
%% |\lq|, |\rq|
\renderHTMLsymbol{\lq} {lsquo}
\renderHTMLsymbol{\rq} {rsquo}
%% In order to use the right single quote for the \HTML\ apostrophe,
%% we must save other uses before.
-%% |\screentqtd{<text>}| is used for screen messages,
-%% and |\urlapostr| is the version of the right single quote
-%% for \acro{URL}s of Wikipedia articles: %% 2011/08/31
-\newcommand*{\screenqtd}[1]{`#1'}
-\newcommand*{\urlapostr} {'} %% 2010/09/10
-%% Here finally is the change of |'|:
-\MakeActiveDef\'{&rsquo;}
-%% ... TODO \verb+\MakeActiveLet\'\rq+!
-%% And this might better be in `\BlogCodes'! would
-%% save `\screenqtd'! Tilde likwise!?
-%% ... TODO change `\catcode`\`'!? 2010/04/26
+%% %% rm. \screenqtd 2011/11/08:
+%% % |\screentqtd{<text>}| is used for screen messages, and
+%% |\urlapostr| is the version of the right single quote
+%% for \acro{URL}s of Wikipedia articles: %% 2011/08/31
+% \newcommand*{\screenqtd}[1]{`#1'} %% rm. 2011/11/08
+\newcommand*{\urlapostr} {'} %% 2010/09/10
+%% The actual change of |'| is in `\BlogCodes'
+%% (\secref{process}).
%%
%% |\bdquo|, |\ldquo|, |\rdquo|, |\sbquo|, |\prime|, |\Prime| ...
-\declareHTMLsymbol{bdquo} %% 2011/09/23
+\declareHTMLsymbol{bdquo} %% 2011/09/23
\declareHTMLsymbol{ldquo}
\declareHTMLsymbol{rdquo}
-\declareHTMLsymbol{sbquo} %% 2010/07/01
+\declareHTMLsymbol{sbquo} %% 2010/07/01
\renewcommand*{\prime}{&prime;}
\declareHTMLsymbol{Prime}
-% \newcommand*{\Prime}{&Prime;}
+%% A special 'blog.sty' service is |\asciidq| for a ``straight"
+%% double quotation mark. It is useful for \emph{typesetting code}
+%% and also can be used to get around automatical conversion
+%% of straight into typographical quotation marks as with
+%% `\catchdq': %% 2011/12/21
+\newcommand*{\asciidq}{\string"}
+%% |\quot| accesses the same symbol in \HTML's terms
+%% (e.g., for displaying code):
+\declareHTMLsymbol{quot} %% 2012/01/21
%% |\endqtd{<text>}| quotes in the English style using double quote
-%% marks, |\enqtd{<text>}| uses single quote marks instead, and
-%% |\dedqtd{<text>}| quotes in German style:
+%% marks, |\enqtd{<text>}| uses single quote marks instead,
+%% |\dedqtd{<text>}| quotes in German style, %% 2011/12/21:
+%% and |\asciidqtd{<text>}| and |\quoted{<text>}| %% 2012/01/21
+%% use straight double quotation marks:
\def\endqtd#1{\ldquo#1\rdquo} %% \newcommand: ``\end"
\newcommand*\enqtd[1]{\lq#1\rq} %% 2010/09/08, \new... 2010/11/08
-\newcommand*{\dedqtd}[1]{\bdquo#1\ldquo}
-\newcommand*{\deqtd}[1]{&sbquo;#1&lsquo;} %% corr. 2011/05/14
-%% TODO `\glqq' from 'german.sty' etc. %% 2011/09/22
+\newcommand*{\dedqtd} [1]{\bdquo#1\ldquo}
+\newcommand*{\deqtd} [1]{&sbquo;#1&lsquo;} %% corr. 2011/05/14
+\newcommand*{\asciidqtd}[1]{\asciidq#1\asciidq} %% 2011/12/21
+\newcommand*{\quoted} [1]{\quot#1\quot} %% 2012/01/21
+%% |\squoted{<text>}| surrounds <text> with ``straight"
+%% single quotation marks, useful for other kinds
+%% of quoting in computer code:
+\newcommand*{\squoted}[1]{\urlapostr#1\urlapostr} %% 2012/01/21
+%% TODO `\glqq' from 'german.sty' etc. %% 2011/09/22
%%
%% === Math ===
%% %% doc. extended 2011/05/08:
%% Because \verb+<+ and \verb+>+ are used for \HTML's
%% element notation, we provide aliases |\gt|, |\lt|
-%% for mathematical $\lt$ and $\gt$:
-\declareHTMLsymbol{gt}
-\declareHTMLsymbol{lt}
+%% for mathematical $\lt$ and $\gt$---and for reference
+%% to \HTML\ (or just \acro{XML}) code %% 2011/11/23
+%% (see \secref{html-verb}):
+\declareHTMLsymbols{{gt}{lt}}
%% |\ge|, |\le|, and |\ne| for $\geq$, $\leq$, and $\neq$ resp.:
-\declareHTMLsymbol{ge}
-\declareHTMLsymbol{le}
-\declareHTMLsymbol{ne}
+\declareHTMLsymbols{{ge}{le}{ne}}
%% We also provide their \TeX\ aliases
-%% |\geq|, |\leq|, |\neq|: %% 2011/05/11
-\let\geq\ge
-\let\leq\le
-\let\neq\ne
+%% |\geq|, |\leq|, |\neq|: %% 2011/05/11
+\let\geq\ge \let\leq\le \let\neq\ne
%% Angle braces |\langle| and |\rangle|:
\renderHTMLsymbol{\langle}{lang}
\renderHTMLsymbol{\rangle}{rang}
@@ -725,36 +893,34 @@
\endgroup
%% \TeX's |\ast| corresponds to the ``lower" version
%% of the asterisk:
-\renderHTMLsymbol{\ast}{lowast} %% 2011/03/29
+\renderHTMLsymbol{\ast}{lowast} %% 2011/03/29
%% Besides \TeX's |\subset| and |\subseteq|,
-%% we provide short versions |\sub| and |\sube| %% 2011/05/08
+%% we provide short versions |\sub| and |\sube| %% 2011/05/08
%% inspired by \HTML:
-\declareHTMLsymbol{sub} %% 2011/04/04
-\let\subset\sub %% 2011/05/08
-\declareHTMLsymbol{sube} %% 2011/03/29
-\let\subseteq\sube %% 2011/05/08
-%% \TeX\ and \HTML\ agree on |\cap|, |\cup|, %% 2011/05/08
-%% and |\times|:
-\declareHTMLsymbol{cap} %% 2011/04/04
-\declareHTMLsymbol{cup} %% 2011/04/04
-\declareHTMLsymbol{times} %% 2011/04/04
-%% We stick to \TeX's |\emptyset| %% 2011/05/08
-\renderHTMLsymbol{\emptyset}{empty} %% 2011/04/14
+\declareHTMLsymbol{sub} %% 2011/04/04
+\let\subset\sub %% 2011/05/08
+\declareHTMLsymbol{sube} %% 2011/03/29
+\let\subseteq\sube %% 2011/05/08
+%% \TeX\ and \HTML\ agree on |\cap|, |\cup|, %% 2011/05/08
+%% and |\times|: %% 2011/04/04
+\declareHTMLsymbols{{cap}{cup}{times}} %% 2012/01/06
+%% We stick to \TeX's |\emptyset| %% 2011/05/08
+\renderHTMLsymbol{\emptyset}{empty} %% 2011/04/14
%% We need |\minus| since math mode switching is
-%% not supported by 'blog': %% 2011/05/08
-\declareHTMLsymbol{minus} %% 2011/03/31
-%% We override \HTML's \lq`&circ;'\rq\ %% \lq\rq 2011/09/08
+%% not supported by 'blog': %% 2011/05/08
+\declareHTMLsymbol{minus} %% 2011/03/31
+%% We override \HTML's \lq`&circ;'\rq\ %% \lq\rq 2011/09/08
%% to get \TeX's \cs{circ}
-%% (i.e., $\circ$; %% 2011/05/08:
+%% (i.e., $\circ$; %% 2011/05/08:
%% \textcolor{red}{but I cannot see it
%% on my own pages!?}):
-\renderHTMLsymbol{\circ}{\#x2218} %% 2011/04/28
-\renderHTMLsymbol{\cdot}{middot} %% 2011/05/07
+\renderHTMLsymbol{\circ}{\#x2218} %% 2011/04/28
+\renderHTMLsymbol{\cdot}{middot} %% 2011/05/07
%% |\sdot| generates `&sdot,', a variant of of `&middot;'
%% reserved for the \Wikienref{dot product} according to
%% the \wikideref{Malzeichen\#Skalarprodukt}
-%% {German \meta{Wikipedia}} %% 2011/09/08!
-\declareHTMLsymbol{sdot} %% 2011/05/08
+%% {German \meta{Wikipedia}} %% 2011/09/08!
+\declareHTMLsymbol{sdot} %% 2011/05/08
%% I provide |\degrees| for the degree symbol.
%% \LaTeX\ already has `\deg' as an operator,
%% therefore I do not want to use `\declareHTMLsymbol'
@@ -763,19 +929,22 @@
%%
%% === Other ===
%% The tilde |~| is used for its wonderful purpose,
-%% by analogy to \TeX:
+%% by analogy to \TeX (TODO overridden by `\FDpseudoTilde'):
\renderHTMLsymbol{~}{nbsp}
%% But now we need a replacement |\tilde| for URLs involving
%% home directories of institution members
%% (should better be |\tildechar| or `\TildeChar',
%% cf.~'fifinddo'): %% 2011/04/29
-{\@makeother\~ \gdef\tilde{~} \gdef\tildechar{~}}
+{ \MakeOther\~ \gdef\tilde{~} \gdef\tildechar{~}}
%% % <- more elegant macro %% 2011/05/18
%% % \newcommand*{\StoreOtherCharAs}[2]{%
%% % \edef#2{\expandafter\@gobble\string#1}}
%% Horizontal ellipsis: |\dots| ...
\renderHTMLsymbol {\dots} {hellip}
-%%
+%% %% 2012/05/13:
+%% |\ss| from Plain~\TeX\ and \LaTeX\ is used for the ``s-z ligature",
+%% the German ``\Wikienref{sharp s}":
+\renderHTMLsymbol{\ss}{szlig}
%% |\copyright|:
\renderHTMLsymbol{\copyright}{copy}
%% |\bullet| %% 2011/03/29
@@ -789,9 +958,21 @@
%% |\dagger|, |\ddagger|: %% 2011/10/01
\renderHTMLsymbol{\dagger}{dagger}
\renderHTMLsymbol{\ddagger}{Dagger}
+%% Sometimes (due to certain local settings) the notations
+%% \dqtd{`&&<characters>;'} or \dqtd{`&&&#<number>;'}
+%% (for \Wikienref{Unicode}) may not be available.
+%% We provide
+%% \[|\htmlentity{<characters>}|\]
+%% as well as
+%% \[|\unicodeentity{<decimal>}|\]
+%% and
+%% \[|\unicodehexentity{<hexadecimal>}|\]
+%% for such situations:
+\newcommand*{\htmlentity}[1]{&#1;}
+\newcommand*{\unicodeentity}[1]{&\##1;}
+\newcommand*{\unicodehexentity}[1]{&\#x#1;}
%%
-%%
-%% == \TeX-related == %% 2010/08/24
+%% == \TeX-related == %% 2010/08/24
%% Somebody actually using 'blog.sty' must have a need to put down
%% notes about \TeX\ for her own private purposes at least---I expect.
%% === Logos ===
@@ -816,6 +997,7 @@
%% === Describing Macros ===
%% With v0.4, \TeX-related \emph{links} are moved to 'texlinks.sty'.
%%
+%% \leavevmode % \errorcontextlines=15 %% TODO 2011/11/05
%% |\texcs{\<tex-cmd-name>}| or `\texcs\<tex-cmd-name>'
%% (care for spacing yourself):
\newcommand*{\texcs}[1]{\code{\string#1}} %% 2010/11/13
@@ -826,6 +1008,7 @@
%%
%% == Tables ==
%% %% 2011/04/24: rm. remark on doubtful stability, ordered
+%% I am not so sure about this section ...
%% === Indenting ===
%% There are three levels of indenting:
%% \[|\indenti|, \quad
@@ -836,19 +1019,29 @@
\gdef\indenti{ }\gdef\indentii{ }\gdef\indentiii{ }}
%%
%% === Starting/Ending Tables ===
-%% 2010/07/17:
+%% |\startTable{<attributes>}| and |\endTable| have been made
+%% for appearing in different macros, such as in the two parts
+%% of a `\newenvironment':
+%% %% 2010/07/17:
\newcommand*{\startTable}[1]{<table #1>}
\def\endTable{</table>}
+%% |\@frame@box| among the `\startTable' <attributes>
+%% draws a frame about the table, |\@frame@groups|
+%% separates ``groups" by rules:
\newcommand*{\@frame@box}{\@frame{box}}
\newcommand*{\@frame@groups}{\@frame{groups}}
+%% |\begin{allrulestable}{<cell-padding>}{<width>}|
+%% starts a table environment with all possible rules
+%% and some code cosmetic. <width> may be empty ...
\newenvironment{allrulestable}[2]
{\startTable{\@cellpadding{#1} \@width{#2}
\@frame@box\ rules="all"}\CLBrk %% \ 2011/10/12
- \indenti\tbody} %% <- tbody 2011/10/13 ->
- {\indenti\endtbody\CLBrk\endTable}
+ \ \tbody} %% <- tbody 2011/10/13, `\ ' 2011/11/09 ->
+ {\ \endtbody\CLBrk\endTable}
%% \xmltagcode{tbody}...\xmltagcode{/tbody} seemed to be
%% better with `\HVspace' for 'blogdot.sty', %% 2011/10/13
-%% so it gets a macro:
+%% so it gets an environment |{tbody}|
+%% (i.e., macros |\tbody| and |\endtbody|):
\useHTMLelement{tbody}{tbody}
%%
%% === Rows ===
@@ -857,34 +1050,80 @@
%% the content of some column, row, or cell.
%% But this is troublesome when you want to comment out
%% an entire table ...
+%%
+%% |\begin{TableRow}{<comment>}{<attributes>}|\\ starts an environment
+%% producing an \HTML\ comment <comment> and a table row
+%% with attributes <attributes>, including code cosmetic.
\newenvironment*{TableRow}[2]{%% lesser indentation 2011/04/25
\ \comment{ #1 }\CLBrk
\indenti<tr #2>%
}{%
- \indenti</tr>}
+ \indenti\endtr} %% \endtr 2011/11/08
+%% |\begin{tablecoloredrow}{<comment>}{<background-color>}|\\
+%% is a special case of `{TableRow}' where `@bgcolor' is the only
+%% attribute:
\newenvironment{tablecoloredrow}[2]
{\TableRow{#1}{\@bgcolor{#2}}}
{\endTableRow}
-%% ``top" 2010/05/18:
+%% |\begin{tablecoloredboldrow}{<comment>}{<background-color>}|\\
+%% is like `{tablecoloredrow}' except that content text is
+%% rendered in boldface (TODO horizontal centering?):
+\newenvironment{tablecoloredboldrow}[2] %% 2011/11/03/08
+ {\TableRow{#1}{\@bgcolor{#2}
+ \@style{font-weight:bold}}}
+ {\endTableRow}
+%% |\begin{tablerow}{<comment>}| %% rm. {<b...>} 2011/12/19
+%% is a special case of `{TableRow}' where the only attribute
+%% yields ``top" vertical alignment (TODO strange):
+%% %% ``top" 2010/05/18:
\newenvironment{tablerow}[1]{\TableRow{#1}{\@valign@t}}
{\endTableRow}
-%% 2010/07/18:
+%% |\starttr| and |\endtr| delimit a row; these commands again
+%% have been made for appearing in different macros.
+%% There is \emph{no} code indenting, probably for
+%% heavy table nesting where indenting was rather useless
+%% (? TODO only in 'texblog.fdf'? there indents would have
+%% been useful).
+%% %% 2010/07/18:
\newcommand*{\starttr}{<tr>}
\def\endtr{</tr>}
%%
%% === Cells ===
+%% |simplecell{<content>}| produces the most \emph{simple} kind of
+%% an \HTML\ table cell:
\newcommand*{\simplecell}{\SimpleTagSurr{td}} %% 2010/07/18
-% \newcommand*{\TableCell}[2]{\indentiii<td #1>#2</td>}
-% \newcommand*{\TableCell}[2]{\indentiii\TagSurr{td}{#1}{#2}}
- %% <- 2010/07/18 ->
+%% |\TableCell{<attributes>}{<content>}| produces the most
+%% \emph{general} kind of a cell, together with a code indent:
+%% % \newcommand*{\TableCell}[2]{\indentiii<td #1>#2</td>}
+%% % \newcommand*{\TableCell}[2]{\indentiii\TagSurr{td}{#1}{#2}}
+%% %% <- 2010/07/18 ->
\newcommand*{\TableCell}[2]{\indentiii\startTd{#1}#2\endTd}
-%% 2010/06/15:
+%% |\colorwidthcell{<color>}{<width>}{<content>}|
+%% uses just the `@bgcolor' and the `@width' attribute:
+%% %% 2010/06/15:
\newcommand*{\colorwidthcell}[2]{\TableCell{\@bgcolor{#1}\@width{#2}}}
+%% |\tablewidthcell{<color>}{<width>}{<content>}|
+%% uses just the `@bgcolor' and the `@width' attribute:
\newcommand*{\tablewidthcell}[1]{\TableCell{\@width{#1}}}
-\newcommand*{\tablecell} {\TableCell{}}
-\newcommand*{\tableCell} {\TableCell\@align@c}
+%% %% |\tablewidthcell{<color>}{<width>}{<content>}| %% 2011/11/09
+%% %% uses just the `@bgcolor' and the `@width' attribute:
+%% %\newcommand*{\tablecolorcell}[1]{\TableCell{\@bgcolor{#1}}}
+%% |\tablecell{<content>}| is like `\simplecell{<content>}',
+%% except that it has a code indent:
+\newcommand*{\tablecell}{\TableCell{}}
+%% |\tableCell{<content>}| is like `\tablecell{<content>}',
+%% except that the content <content> is horizontically centered.
+%% The capital `C' in the name may be considered indicating
+%% ``\strong{c}entered":
+\newcommand*{\tableCell}{\TableCell\@align@c}
%% Idea: use closing star for environment variants!?
-% %% 2010/05/19:
+%%
+%% |\begin{bigtablecell}{<comment>}|
+%% starts an \emph{environment} yielding a table cell element
+%% without attributes, preceded by a \HTML\ comment
+%% <comment> unless <comment> is empty. At least the \HTML\ tags
+%% are indented:
+%% %% 2010/05/19:
\newenvironment{bigtablecell}[1]{\BigTableCell{#1}{}}
{\endBigTableCell}
% {\ifx\\#1\\% %% 2010/05/30
@@ -892,23 +1131,100 @@
% \fi
% \indentiii<td>}
% {\indentii</td>} %% !? 2010/05/23
-%% 2010/06/05:
+%% |\begin{BigTableCell}{<comment>}{<attributes>}|\\
+%% is like `\begin{bigtablecell{<comment>}}' except that it uses
+%% attributes <attributes>:
+%% %% 2010/06/05:
\newenvironment{BigTableCell}[2]
{\ifx\\#1\\\indentii\ \comment{#1}\CLBrk\fi
\indentiii\startTd{#2}}
{\indentii\endTd} %% TODO indent? 2010/07/18
-%% 2010/07/18:
+%% |\startTd{<attributes>}| and |\endTd| delimit a cell element
+%% and may appear in separate macros, e.g., in an environment
+%% definition. There is no code cosmetic. And finally there is
+%% |\StartTd| that yields less confusing code without attributes:
+%% %% 2010/07/18:
\newcommand*{\startTd}[1]{<td #1>}
+\newcommand*{\StartTd}{<td>} %% 2011/11/09
\def\endTd{</td>}
-\newcommand*{\emptycell}{<td />} %% 2011/10/07
+%% |\emptycell| uses \xmltagcode{td /} instead of
+%% \xmltagcode{td}\xmltagcode{/td} for an empty cell:
+\newcommand*{\emptycell}{<td />} %% 2011/10/07
+%%
+%% === ``Implicit" Attributes and a ``\TeX-like" Interface ===
+%% %% <- 2011/11/08 ->
+%% After some more experience, much musing, and trying new tricks,
+%% I arrive at the following macros (v0.7). \
+%% (i)\enspace When a page or a site has many tables that use the same
+%% attribute values, these should not be repeated for the single
+%% tables, rather the values should be invoked by shorthand macros,
+%% and the values should be determined at a single separate place.
+%% We will have |\stdcellpadding|, %%% |\stdtableheadrow|,
+%% |\stdtableheadcolor| and
+%% |\stdtableheadstyle|. \
+%% (ii)\enspace As with \TeX, `\cr' should suffice to \emph{close}
+%% a \emph{cell} and a \emph{row}, and then to \emph{open} another
+%% \emph{row} and its first \emph{cell}. And there should be a
+%% single command to close a cell within a row and open a next one.
+%%
+%% We use `\providecommand' so the user can determine the values
+%% in a file for 'blog' where 'blogexec' is loaded later.
+%% |\stdcellpadding| should correspond to the \CSS\ settings,
+%% the value of `6' you find here is just what I used recently.
+\providecommand*{\stdcellpadding}{6}
+%% For |\stdtableheadcolor|, I provide a
+%% % ``web-safe" %% very wrong 2012/05/13
+%% gray, `#EEEEEE', that the German Wikipedia uses for articles about
+%% \Wikienref{networking protocol}s
+%% (unfortunately, it doesn't have a
+%% \wikienref{Web colors\#X11_color_names}{%
+%% \CSS-3}\wikienref{X11 color names}{X11} color name):
+\providecommand*{\stdtableheadcolor}{\#EEEEEE}
+%% |\stdtableheadstyle| demands a boldface font.
+%% In general, it is used for the `@style' attribute:
+\providecommand*{\stdtableheadstyle}{font-weight:bold}
+%% |\begin{stdallrulestable}| starts an `{allrulestable}'
+%% environment with ``standard" cell padding and empty width
+%% attribute, then opens a ``standard" row element
+%% with a ``standard" comment as well as a cell:
+\newenvironment{stdallrulestable}{%
+ \allrulestable{\stdcellpadding}{}\CLBrk
+ \TableRow{standard all-rules table}%
+ {\@bgcolor{\stdtableheadcolor}
+ \@style{\stdtableheadstyle}}\CLBrk
+ \indentii\StartTd
+%% `\end{stdallrulestable}' will provide closing of a cell
+%% and a row, including a code cosmetic:
+ }{\indenti\endTd\CLBrk\endTableRow\CLBrk
+ \endallrulestable}
+%% |\endcell| closes a cell and opens a new one. The idea behind
+%% this is that an active character will invoke it. The name is
+%% inspired by `\endgraf' and `\endline' from Plain \TeX\ and
+%% \LaTeX\ (`\newcommand' does not work with `\end'\code{\dots}):
+\def\endcell{\endTd\StartTd}
+%% Plain \TeX's and \LaTeX's |\cr| and |\endline| are redefined
+%% for closing and opening rows and cells, including code cosmetic:
+\renewcommand*{\cr}{\indentii\endTd\CLBrk\indenti\endtr\CLBrk
+ \indenti\starttr\CLBrk\indentii\StartTd}
+\let\endline\cr
+%% TODO variants like `\CR' for special (colored, boldface?) cells
+%% starting row
%%
%% === Filling a Row with Dummy Cells ===
-%% Generalization 2010/06/28:
-% \newcommand*{\FillRow}[2]{% %% broke line 2011/01/24
-% \indentiii\TagSurr{td}{\@colspan{#1} #2}{}}
- %% <- 2010/07/18 ->
+%% These macros were made, e.g., for imitating a program window
+%% with a title bar (spanning someting more complex below),
+%% perhaps also for a Gantt chart.
+%% |\FillRow{<span>}{<attributes>}| produces a cell without text,
+%% spanning <span> columns, with additional attributes <attributes>.
+%% %% Generalization 2010/06/28:
+%% % \newcommand*{\FillRow}[2]{% %% broke line 2011/01/24
+%% % \indentiii\TagSurr{td}{\@colspan{#1} #2}{}}
+%% %% <- 2010/07/18 ->
\newcommand*{\FillRow}[2]{\indentiii\startTd{\@colspan{#1} #2}\endTd}
+%% |\fillrow{<span>}| instead only uses the `@colspan' attribute:
\newcommand*{\fillrow}[1]{\FillRow{#1}{}}
+%% |\fillrowcolor{<span>}{<color>}| just uses the `@colspan'
+%% and the `@bgcolor' attributes:
\newcommand*{\fillrowcolor}[2]{\FillRow{#1}{\@bgcolor{#2}}}
%% === Skipping Tricks ===
%% %% 2011/10/13
@@ -940,50 +1256,9 @@
\renewcommand*{\vspace}[1]{\hvspace{}{#1}}
%%
%% == Misc ==
-%% |\comment{<comment>}| produces a one-line \HTML\ comment.
-%% By contrast, there is an environment
-%% |{commentlines}{<comment>}|
-%% for multi-line comments. %% was mult-l... 2011/09/08
-%% It is convenient for ``commenting out"
-%% code (unless the latter contains other \HTML\ comments ...)
-%% where <comment> is a \emph{comment} for explaining what is
-%% commented out. %% 2010/11/14
-\newcommand*{\comment}[1]{<!--#1-->}
-% \newcommand{\commentlines}[1]{\comment{^^J#1^^J}} %% 2010/05/07
-% %% <- TODO bzw. \endlinechar=`\^^J 2010/05/09 back 2010/05/10
-\newenvironment{commentlines}[1] %% 2010/05/17
- {<!--#1}
- {-->}
%% \TeX's |\hrule| (rather deprecated in \LaTeX) is redefined
%% to produce an \HTML\ horizontal line:
\renewcommand*{\hrule}{<hr>}
-%% Redefining |\ | to be the same as `\space' may be helpful
-%% for manual indenting or spacing of \HTML\ code.
-%% Or better (just now remembering): I used it for making
-%% ``ASCII trees" with the \xmltagcode{pre} element
-%% (redefined `verbatim').
-\let\ \space
-%% I couldn't find a perfect way to generate \xmltagcode{p}.
-%% Actually I started completing the present documentation
-%% when I had decided to implement automatic generation
-%% of \xmltagcode{p} from empty lines.
-% \def\par{<p>} %% + empty lines !? 2010/04/26
-%% <- difficult with `\stop'; 2010/09/10:
-%% |\endgraf| produces \xmltagcode{/p}!?
-\renewcommand*{\endgraf}{</p>}
-%% 2010/04/28:
-%% \xmltagcode{br} can be generated either by |\newline|
-%% or by |\\|:
-\renewcommand*{\newline}{<br>}
-\let\\\newline
-%% |\rightpar{<text>}| places <text> flush right.
-%% I have used this for \qtd{Last revised \dots} and for placing
-%% navigation marks.
-\newcommand*{\rightpar}{\TagSurr p\@align@r} %% 2010/06/17
-%% %% 2011/04/29:
-%% Often I use `\rightpar' with \textit{italics},
-%% now there is |\rightitpar{<text>}| for this purpose:
-\newcommand*{\rightitpar}[1]{\rightpar{\textit{#1}}}
%% For references, there were
% \catcode`\^=\active
% \def^#1{\SimpleTagSurr{sup}{#1}}
@@ -992,10 +1267,10 @@
%% as of 2010/05/01, inspired by the \xmltagcode{ref} element
%% of MediaWiki; moved to `xmlprint.tex' 2010/06/02.
%%
-%% == The End ==
+%% == Leaving and HISTORY ==
\endinput
%%
-%% == VERSION HISTORY ==
+ VERSION HISTORY
v0.1 2010/08/20 final version for DFG
v0.2 2010/11/08 final documentation version before
moving some functionality to 'fifinddo'
@@ -1084,3 +1359,43 @@ v0.62 2011/10/16 \hyperlink, \hypertarget; doc. fixes there
2011/10/21 \ctanref now in texlinks.sty;
doc.: grammar with `that'
2011/10/22 \BlogCopyFile message removed
+part of MOREHYPE RELEASE r0.52
+v0.7 2011/11/03 {tablecoloredboldrow}
+ 2011/11/05 \ContentAtt -> \@content,
+ \BlogCopyFile -> \BlogProcessFile (blogexec),
+ doc. different \pagebreak's
+ 2011/11/06 run \BlogCopyLines, doc. \[...\]
+ 2011/11/07 \ProvideBlogExec
+ 2011/11/08 \endtr in \endTableRow, using \MakeOther,
+ right quote change moves to \BlogCodes,
+ \BlogInterceptHash; rm. \AmpMark & doc. about it,
+ mod. on #; doc. for tables; start doc. "implicit"
+ table attributes and "TeX-like" interface
+ 2011/11/09 \tablecolorcell(?); cont. "implicit" etc.;
+ \StartTd
+ 2011/11/20 \isotoday, \BlogProcessFinalFile,
+ catcodes of `<' `>' untouched; restructured,
+ structured processing, misc -> ordinary
+ 2011/11/21 BlogLIGs
+ 2011/11/23 \xmltagcode, \xmlentitycode, \c;
+ doc: <p>, \secref, \pagebreak
+ 2011/11/24 doc: example results for diacritics
+ 2011/11/27 \ParseLigs; doc. rm. \pagebreak
+ 2011/12/12 \title uses \SimpleTagSurr
+ 2011/12/19 doc. fix {tablerow}
+ 2011/12/21 \asciidq, \asciidqtd
+ 2012/01/06 \acro; using dowith.sty (\declareHTMLsymbols);
+ doc.: cross-referring for naming policies
+ 2012/01/07 \MakeActiveDef\~ for \FDpseudoTilde
+ 2012/01/11 (C)
+ 2012/01/21 \quot, \quoted. \squoted
+ 2012/02/04 \newacronym
+ 2012/03/14 removed hidden and another comment with
+ \BlogCopyLines, fixed latter, TODO on \NoBlogLigs
+ 2012/03/17 tweaked \@typeset@protect for \EXECUTE
+ 2012/03/30 space in stdallrules... after @bgcolor
+ 2012/04/03 \CLBrk in \@useHTMLelement
+ 2012/04/09 \htmlentity, \unicodeentity
+ 2012/05/13 \ss; better comment on \uml;
+ #EEEEEE not "web-safe"
+ 2012/05/15 xEDIT folding in tables section