1% LaTeX style file 2% Name: texhelp.sty 3% Author: Julian Smart 4% 5% Purpose 6% ------- 7% Style file to enable the simultaneous preparation of printed LaTeX and on-line 8% hypertext manuals. 9% Use in conjunction with Tex2RTF (see Tex2RTF documentation). 10% 11% Note that if a non-ASCII character starts a newline and there should be a space 12% between the last word on the previous line and the first word on this line, 13% you need to use \rtfsp to generate a space in Windows Help. \rtfsp is ignored 14% in all other formats. 15% 16% Julian Smart 17% Artificial Intelligence Applications Institute 18% 19% 20% ============== C++/CLIPS Documentation Facilities ============== 21% 22% Each class definition should be typeset with e.g. 23% 24% \section{\class{Name}: Parent} 25% 26% followed by a description of the class. 27% Each member should follow: 28% 29% \membersection{wxName::Member} 30% 31% with a description of what this member does. 32% Then, one (or more if overloaded) member (function) in detail: 33% 34% \func{return type}{name}{args} 35% or 36% \member{type}{name} 37% 38% where args is a list of \param{type}{name}, ... 39 40% Function, e.g. 41% e.g. to typeset 42% 43% void DoIt(char *string); 44% 45% write: 46% 47% \func{void}{DoIt}{\param{char *}{string}} 48% 49 50\newcommand{\func}[3]{\hangafter=1\noindent\hangindent=10mm 51{{\it #1} {\bf #2}\index{#2}}(#3)} 52 53% For function/type definition where the name is a pointer, 54% e.g. to typeset 55% 56% typedef void (*wxFunction)(wxObject&) 57% 58% write: 59% 60% \pfunc{typedef void}{wxFunction}{param{wxObject&}} 61 62\newcommand{\pfunc}[3]{\hangafter=1\noindent\hangindent=10mm 63{{\it #1} ({\bf *#2})\index{#2}}(#3)} 64 65% Use an ordinary \section command for class name definitions. 66 67% This is used for a member, such as wxBitmap: GetDepth 68\newcommand{\membersection}[1]{\subsection*{#1}\index{#1}} 69 70% CLIPS function 71\newcommand{\clipsfunc}[3]{\hangafter=1\noindent\hangindent=10mm 72{{\bf #1} ({\bf #2}\index{#2}}#3)} 73 74\newcommand{\clipssection}[1]{\chapter{#1}} 75 76% This is used for a CLIPS function name 77\newcommand{\functionsection}[1]{\subsection*{#1}} 78 79% Member: a type and a name 80\newcommand{\member}[2]{{\bf #1 \it #2}} 81 82% C++ Parameter: a type and a name (no intervening space) 83\newcommand{\param}[2]{{\it #1}{\bf #2}} 84 85% CLIPS Parameter: a type and a name (one intervening space) 86\newcommand{\cparam}[2]{{\bf #1} {\it #2}} 87 88% Class: puts in index 89\newcommand{\class}[1]{#1\index{#1}} 90 91% Void type 92\newcommand{\void}{{\it void}} 93 94% Typeset destructor 95\newcommand{\destruct}[1]{{$\sim$}#1} 96 97% Typeset insert/extract operators 98\newcommand{\cinsert}{$<<$} 99\newcommand{\cextract}{$>>$} 100 101 102% =================== Hypertext facilities =================== 103% 104% To insert hyperlinks (or references, in Latex), \label the sections 105% or membersections \label{ref-label} immediately after the section, on the same line, 106% and use \helpref{text-to-show}{ref-label} to make a reference. 107% 108 109% Type text with section reference 110\newcommand{\helpref}[2]{{\it #1} (section \ref{#2}) } 111 112% Type text with URL in verbatim mode 113\newcommand{\urlref}[2]{#1 (\verb$#2$)} 114 115% Don't typeset section number in LaTeX 116\newcommand{\helprefn}[2]{{\it #1}} 117 118% Like helpref, but popup text in WinHelp instead of hyperlinked 119\newcommand{\popref}[2]{{\it #1}} 120 121% Like footnote, but popup text. 122\newcommand{\footnotepopup}[2]{{\it #1}\footnote{#2}} 123 124% =================== On-line help specific macros =================== 125% 126 127% Global document font size/family, help only. 128\newcommand{\helpfontsize}[1]{} 129\newcommand{\helpfontfamily}[1]{} 130 131% Ignore in all on-line help 132\newcommand{\helpignore}[1]{#1} 133% Only print in all on-line help 134\newcommand{\helponly}[1]{} 135 136% Ignore in LaTeX 137\newcommand{\latexignore}[1]{} 138% Only print in LaTeX 139\newcommand{\latexonly}[1]{#1} 140 141% Ignore in linear RTF 142\newcommand{\rtfignore}[1]{#1} 143% Only print in linear RTF 144\newcommand{\rtfonly}[1]{} 145 146% Ignore in WinHelp RTF 147\newcommand{\winhelpignore}[1]{#1} 148% Only print in WinHelp RTF 149\newcommand{\winhelponly}[1]{} 150 151% Ignore in wxHelp 152\newcommand{\xlpignore}[1]{#1} 153% Only print in wxHelp 154\newcommand{\xlponly}[1]{} 155 156% Ignore in HTML 157\newcommand{\htmlignore}[1]{#1} 158% Only print in HTML 159\newcommand{\htmlonly}[1]{} 160 161% Input a file only for help system (binder thickness is not a limitation 162% in help systems!) 163\newcommand{\helpinput}[1]{} 164 165\newcommand{\rtfsp}{ } % Force a space in RTF, ignore in Latex 166 167% =================== Miscellaneous macros =================== 168% 169% Headings consistent with generated ones 170\newcommand{\myheading}[1]{\vspace*{25pt} 171\begin{flushleft} 172{\LARGE \bf #1} 173\end{flushleft} 174\vskip 20pt 175} 176 177% Heading with entry in contents page. 178\newcommand{\chapterheading}[1]{\myheading{#1} 179\addcontentsline{toc}{chapter}{#1}} 180 181\newcommand{\sectionheading}[1]{\myheading{#1} 182\addcontentsline{toc}{section}{#1}} 183 184% Glossary environment 185\newenvironment{helpglossary}{\newpage\chapterheading{Glossary}\begin{description}}{\end{description}} 186 187% Glossary entry 188\newcommand{\gloss}[1]{\item[#1]\index{#1}} 189 190% Image: EPS in Latex, BMP or MF (whatever's available) in RTF. Requires psbox. 191\newcommand{\image}[2]{\psboxto(#1){#2}} 192 193% Image, left aligned (HTML) 194\newcommand{\imager}[2]{\psboxto(#1){#2}} 195 196% Image, right aligned (HTML) 197\newcommand{\imagel}[2]{\psboxto(#1){#2}} 198 199% Imagemap: principally for HTML only. In Latex, 200% acts like \image. 201\newcommand{\imagemap}[3]{\psboxto(#1){#2}} 202 203% Headers and footers 204% \setheader{EvenPageLeft}{EvenPageCentre}{EvenPageRight} 205% {OddPageLeft}{OddPageCentre}{OddPageRight} 206\newcommand{\setheader}[6]{ 207\lhead[\fancyplain{}{#1}]{\fancyplain{}{#4}} 208\chead[\fancyplain{}{#2}]{\fancyplain{}{#5}} 209\rhead[\fancyplain{}{#3}]{\fancyplain{}{#6}} 210} 211 212% \setfooter{EvenPageLeft}{EvenPageCentre}{EvenPageRight} 213% {OddPageLeft}{OddPageCentre}{OddPageRight} 214\newcommand{\setfooter}[6]{ 215\lfoot[\fancyplain{#1}{#1}]{\fancyplain{#4}{#4}} 216\cfoot[\fancyplain{#2}{#2}]{\fancyplain{#5}{#5}} 217\rfoot[\fancyplain{#3}{#3}]{\fancyplain{#6}{#6}} 218} 219 220% Needed for telling RTF where margin paragraph should go 221% in mirrored margins mode. 222\newcommand{\marginpareven}[1]{\hspace*{0pt}\marginpar{#1}} 223\newcommand{\marginparodd}[1]{\hspace*{0pt}\marginpar{#1}} 224 225% Environment for two-column table popular in WinHelp and manuals. 226\newcommand{\twocolwidtha}[1]{\def\twocolwidthaval{#1}} 227\newcommand{\twocolwidthb}[1]{\def\twocolwidthbval{#1}} 228\newcommand{\twocolspacing}[1]{\def\twocolspacingval{#1}} 229 230\twocolwidtha{3cm} 231\twocolwidthb{8.5cm} 232\twocolspacing{2} 233 234\newcommand{\twocolitem}[2]{#1 & #2\\} 235\newcommand{\twocolitemruled}[2]{#1 & #2\\\hline} 236 237\newenvironment{twocollist}{\renewcommand{\arraystretch}{\twocolspacingval}\begin{tabular}{lp{\twocolwidthbval}}}% 238{\end{tabular}\renewcommand{\arraystretch}{1}} 239 240% Specifying table rows for RTF compatibility 241\newcommand{\row}[1]{#1\\} 242 243% Use for the last ruled row for correct RTF generation. 244\newcommand{\ruledrow}[1]{#1\\\hline} 245 246% Indentation environment. Arg1 is left margin size 247\newenvironment{indented}[1]{\begin{list}{}{\leftmargin=#1}\item[]}% 248{\end{list}} 249 250% Framed box of text, normal formatting. 251\newcommand{\normalbox}[1]{\fbox{\vbox{#1}}} 252% Double-framed box of text. 253\newcommand{\normalboxd}[1]{\fbox{\fbox{\vbox{#1}}}} 254 255% WITHDRAWN -- can't do in RTF, easily. 256% Framed box of text, horizontally centred. Ragged right within box. 257% \newcommand{\centeredbox}[2]{\begin{center}\fbox{\parbox{#1}{\raggedright#2}}\end{center}} 258% Double-framed box of text, horizontally centred. Ragged right within box. 259% \newcommand{\centeredboxd}[2]{\begin{center}\fbox{\fbox{\parbox{#1}{\raggedright#2}}}\end{center}} 260 261% toocomplex environment: simply prints the argument in LaTeX, 262% comes out verbatim in all generated formats. 263\newenvironment{toocomplex}{}{} 264 265% Colour: dummy commands since LaTeX doesn't support colour. 266% \definecolour{name}{red}{blue}{green} 267% \fcol{name}{text} ; Foreground 268% \bcol{name}{text} ; Background 269\newcommand{\definecolour}[4]{} 270\newcommand{\definecolor}[4]{} 271\newcommand{\fcol}[2]{#2} 272\newcommand{\bcol}[2]{#2} 273\newcommand{\sethotspotcolour}[1]{} 274\newcommand{\sethotspotunderline}[1]{} 275\newcommand{\settransparency}[1]{} 276\newcommand{\backslashraw}[0]{} 277\newcommand{\lbraceraw}[0]{} 278\newcommand{\rbraceraw}[0]{} 279\newcommand{\registered}[0]{(r)} 280\newcommand{\background}[1]{} 281\newcommand{\textcolour}[1]{} 282\newcommand{\overview}[2]{See \helpref{#1}{#2}.} 283