~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to fpcdocs/fakehtml.sty

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%
 
2
%   $Id: fakehtml.sty,v 1.3 2001/09/22 00:40:30 carl Exp $
 
3
%   This file is part of the FPC documentation.
 
4
%   Copyright (C) 1997, by Michael Van Canneyt
 
5
%
 
6
%   The FPC documentation is free text; you can redistribute it and/or
 
7
%   modify it under the terms of the GNU Library General Public License as
 
8
%   published by the Free Software Foundation; either version 2 of the
 
9
%   License, or (at your option) any later version.
 
10
%
 
11
%   The FPC Documentation is distributed in the hope that it will be useful,
 
12
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
%   Library General Public License for more details.
 
15
%
 
16
%   You should have received a copy of the GNU Library General Public
 
17
%   License along with the FPC documentation; see the file COPYING.LIB.  If not,
 
18
%   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
19
%   Boston, MA 02111-1307, USA.
 
20
%
 
21
\ProvidesPackage{fakehtml}[2001/07/01]
 
22
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
23
% based upon Eijkhout's  comment.sty v2.0
 
24
% with modifications to avoid conflicts with later versions
 
25
% of this package, should a user be requiring it.
 
26
%       Ross Moore,  10 March 1999
 
27
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
28
% Comment.sty   version 2.0, 19 June 1992
 
29
% selectively in/exclude pieces of text: the user can define new
 
30
% comment versions, and each is controlled separately.
 
31
% This style can be used with plain TeX or LaTeX, and probably
 
32
% most other packages too.
 
33
%
 
34
% Examples of use in LaTeX and TeX follow \endinput
 
35
%
 
36
% Author
 
37
%    Victor Eijkhout
 
38
%    Department of Computer Science
 
39
%    University Tennessee at Knoxville
 
40
%    104 Ayres Hall
 
41
%    Knoxville, TN 37996
 
42
%    USA
 
43
%
 
44
%    eijkhout@cs.utk.edu
 
45
%
 
46
% Usage: all text included in between
 
47
%    \comment ... \endcomment
 
48
% or \begin{comment} ... \end{comment}
 
49
% is discarded. The closing command should appear on a line
 
50
% of its own. No starting spaces, nothing after it.
 
51
% This environment should work with arbitrary amounts
 
52
% of comment.
 
53
%
 
54
% Other 'comment' environments are defined by
 
55
% and are selected/deselected with
 
56
% \includecomment{versiona}
 
57
% \excludecoment{versionb}
 
58
%
 
59
% These environments are used as
 
60
% \versiona ... \endversiona
 
61
% or \begin{versiona} ... \end{versiona}
 
62
% with the closing command again on a line of its own.
 
63
%
 
64
% Basic approach:
 
65
% to comment something out, scoop up  every line in verbatim mode
 
66
% as macro argument, then throw it away.
 
67
% For inclusions, both the opening and closing comands
 
68
% are defined as noop
 
69
%
 
70
% Changed \next to \html@next to prevent clashes with other sty files
 
71
% (mike@emn.fr)
 
72
% Changed \html@next to \htmlnext so the \makeatletter and
 
73
% \makeatother commands could be removed (they were causing other
 
74
% style files - changebar.sty - to crash) (nikos@cbl.leeds.ac.uk)
 
75
% Changed \htmlnext back to \html@next...
 
76
 
 
77
\def\makeinnocent#1{\catcode`#1=12 }
 
78
\def\csarg#1#2{\expandafter#1\csname#2\endcsname}
 
79
 
 
80
\def\ThrowAwayComment#1{\begingroup
 
81
    \def\CurrentComment{#1}%
 
82
    \let\do\makeinnocent \dospecials
 
83
    \makeinnocent\^^L% and whatever other special cases
 
84
%%RRM
 
85
%%  use \xhtmlComment for \xComment
 
86
%%  use \html@next    for \next
 
87
    \endlinechar`\^^M \catcode`\^^M=12 \xhtmlComment}
 
88
{\catcode`\^^M=12 \endlinechar=-1 %
 
89
 \gdef\xhtmlComment#1^^M{\def\test{#1}\edef\test{\meaning\test}
 
90
      \csarg\ifx{PlainEnd\CurrentComment Test}\test
 
91
          \let\html@next\endgroup
 
92
      \else \csarg\ifx{LaLaEnd\CurrentComment Test}\test
 
93
            \edef\html@next{\endgroup\noexpand\end{\CurrentComment}}
 
94
      \else \csarg\ifx{LaInnEnd\CurrentComment Test}\test
 
95
            \edef\html@next{\endgroup\noexpand\end{\CurrentComment}}
 
96
      \else \let\html@next\xhtmlComment
 
97
      \fi \fi \fi \html@next}
 
98
}
 
99
 
 
100
%%\def\includecomment   %%RRM
 
101
\def\htmlincludecomment
 
102
 #1{\expandafter\def\csname#1\endcsname{}%
 
103
    \expandafter\def\csname end#1\endcsname{}}
 
104
%%\def\excludecomment   %%RRM
 
105
\def\htmlexcludecomment
 
106
 #1{\expandafter\def\csname#1\endcsname{\ThrowAwayComment{#1}}%
 
107
    {\escapechar=-1\relax
 
108
     \edef\tmp{\string\\end#1}%
 
109
      \csarg\xdef{PlainEnd#1Test}{\meaning\tmp}%
 
110
     \edef\tmp{\string\\end\string\{#1\string\}}%
 
111
      \csarg\xdef{LaLaEnd#1Test}{\meaning\tmp}%
 
112
     \edef\tmp{\string\\end \string\{#1\string\}}%
 
113
      \csarg\xdef{LaInnEnd#1Test}{\meaning\tmp}%
 
114
    }}
 
115
 
 
116
%%\excludecomment{comment}      %%RRM
 
117
\htmlexcludecomment{comment}
 
118
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
119
% end Comment.sty
 
120
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
121
\let\includecomment=\htmlincludecomment
 
122
\let\excludecomment=\htmlexcludecomment
 
123
 
 
124
\newcommand{\latex}[1]{#1}
 
125
\newcommand{\html}[1]{}
 
126
\htmlexcludecomment{htmlonly}
 
127
\newenvironment{latexonly}{}{}