diff options
Diffstat (limited to 'Master/texmf-doc/doc/english/FAQ-en/faq.sty')
-rw-r--r-- | Master/texmf-doc/doc/english/FAQ-en/faq.sty | 94 |
1 files changed, 50 insertions, 44 deletions
diff --git a/Master/texmf-doc/doc/english/FAQ-en/faq.sty b/Master/texmf-doc/doc/english/FAQ-en/faq.sty index 45ab038250d..f46ecaf735f 100644 --- a/Master/texmf-doc/doc/english/FAQ-en/faq.sty +++ b/Master/texmf-doc/doc/english/FAQ-en/faq.sty @@ -3,6 +3,7 @@ % uses production LaTeX 2e commands \NeedsTeXFormat{LaTeX2e}[1994/06/01]% at least! \ProvidesPackage{faq}[2002/10/01 v2.3 English TeX FAQ macros] + % % something affecting fonts: do we use only freely available fonts % (i.e., are we going to make the postscript of this publicly @@ -34,35 +35,23 @@ \DeclareRobustCommand\acro[1]{##1\@{}} } +% debugging (requires etex, like much of this package) +%\tracingifs=1 + % suppress bold maths if they're not available \ifboldmathavail\else\let\boldmath\@empty\fi % -% switches (potentially) to be set according to status -\newif\ifpdf +% true for pdf output \newif\ifsinglecolumn -% -% Status values -\providecommand{\Status}{0} -\ifcase\Status\relax - % 0: default case is do nothing -% \typeout{faq.sty: default output using \ifprivate private\else -% public\fi\space fonts} - \singlecolumnfalse - \pdffalse -\or - % 1: pdf output using public fonts - \typeout{faq.sty: 1-col pdf output using public fonts} - \singlecolumntrue - \pdftrue - \let\multicols\@gobble - \let\endmulticols\relax -\or - % 2: pdf output using public fonts, two columns - \typeout{faq.sty: 2-col pdf output using public fonts} - \singlecolumnfalse - \pdftrue +\RequirePackage{ifpdf} +\ifpdf + \PackageInfo{faq}{1-column PDF output\@gobble} + \expandafter\singlecolumntrue +\else + \PackageInfo{faq}{2-column DVI output\@gobble} + \expandafter\singlecolumnfalse \fi % @@ -167,7 +156,7 @@ % tables are all long'uns \RequirePackage{booktabs} % -% we define html only stuff using Eijkhout's package +% we define conditional stuff using Eijkhout's package \RequirePackage{comment} \excludecomment{htmlversion} \ifpdf @@ -182,8 +171,16 @@ \excludecomment{wideversion} \fi % -% but we also want a `short' version, like LaTeX2HTML's +% but we also want short versions, like LaTeX2HTML's \let\htmlonly\@gobble +\let\nothtml\@firstofone +\let\latexhtml\@firstoftwo +% +% the little bit(s) of code that's(re) going to be ignored when the +% html is generated are enclosed by the following two commands +\let\htmlignore\relax +\let\endhtmlignore\relax + % % the Baskerville and other logos and abbreviations \providecommand\BV{\emph{Baskerville}} @@ -439,9 +436,7 @@ % deleted from comments 2000/03/24) \newcommand\Email{\begingroup \urlstyle{tt}\Url} % email address \ifpdf -\def\mailto{\@ifnextchar|\@mailto@vert\@mailto@brace} % url to mail somewhere -\def\@mailto@vert|#1|{\href{mailto:#1}{\Email{#1}}} -\def\@mailto@brace#1{\href{mailto:#1}{\Email{#1}}} +\def\mailto#1{\href{mailto:#1}{\Email{#1}}} \else \newcommand\mailto{\begingroup \urlstyle{tt}\Url} % mailable address \fi @@ -564,15 +559,15 @@ \newcommand{\@CTANdirectory}[2]{\@ifundefined{ctan-#1}{% \expandafter\gdef\csname ctan-#1\endcsname{\@CTAN\LocalCTAN{#2}\CTANDirFmt}% }{% - \PackageWarningNoLine{faq}{Repeated definition of label: #1}% - \stepcounter{CTAN@replabs}% + \PackageWarningNoLine{faq}{Repeated definition of label: #1}% + \stepcounter{CTAN@replabs}% }} \ifpdf \newcommand{\@sCTANdirectory}[2]{\@ifundefined{ctan-#1}{% \expandafter\gdef\csname ctan-#1\endcsname{\@CTAN\LocalCTAN{#2}/}% }{% - \PackageWarningNoLine{faq}{Repeated definition of label: #1}% - \stepcounter{CTAN@replabs}% + \PackageWarningNoLine{faq}{Repeated definition of label: #1}% + \stepcounter{CTAN@replabs}% }} \fi % @@ -600,10 +595,32 @@ \PackageWarning{CTAN}{Undefined reference: #1}% \stepcounter{CTAN@unrefs}% }{% -% \edef\@tempa{\noexpand\CTAN{\csname ctan-#1\endcsname}}\@tempa \csname ctan-#1\endcsname }} % +% href to a ctan package +\ifpdf + \DeclareRobustCommand{\CTANhref}[2]{\@ifundefined{ctan-#1}{% + \PackageWarning{CTAN}{Undefined reference: #1}% + \stepcounter{CTAN@unrefs}% + }{{% + \def\@CTAN##1##2##3{http://www.tex.ac.uk/tex-archive/##2}% + \href{\csname ctan-#1\endcsname}{#2}% + }}} +\else % DVI version + \DeclareRobustCommand{\CTANhref}[2]{\@ifundefined{ctan-#1}{% + \PackageWarning{CTAN}{Undefined reference: #1}% + \stepcounter{CTAN@unrefs}% + }{{% + \def\@ctan@path##1{\expandafter\httpify\LocalCTAN!##1} + \edef\@tempa{\csname ctan-#1\endcsname}% + \expandafter\href\expandafter{\@tempa}{#2}% + }}} +\fi +% +% this is surely temporary +\def\httpify ftp://ftp#1!{http://www#1} +% % hook for diagnosing undefined references at the end \AtEndDocument{\ifthenelse{\theCTAN@unrefs > 0}{% \PackageWarningNoLine{ctan}{There were \arabic{CTAN@unrefs} undefined @@ -702,17 +719,6 @@ \xspaceskip=.5em\relax \hangindent=1pc\relax} % -% the little bit(s) of code that's(re) going to be ignored when the -% html is generated are enclosed by the following two commands -\let\htmlignore\relax -\let\endhtmlignore\relax -% -% or it's the argument to \nothtml -\newcommand\nothtml[1]{#1} -% -% a trivium that appears differently in the two modes -\newcommand\latexhtml[2]{#1} -% % things needed for the benefit of texfaq2html's `sanitise_line' \let\textpercent\% \let\faq@@textbar\textbar |