rtems-docs/common/latex/trimspaces.sty
Chris Johns 8330198edc waf: Add support to handle missing Latex packages on hosts they are not available on.
It appears the support for texlive packages on some hosts is variable. This patch
lets us add missing packages to our source tree so a PDF can be built on
those hosts. The quality of the PDFs created may vary as some short cuts may
have been take. For example lato is a font and only the sty file as been added
and not the actual font which means it's use will default to another font.
2016-11-06 12:02:47 +11:00

59 lines
1.3 KiB
TeX

%% LaTeX2e file `trimspaces.sty'
%% generated by the `filecontents' environment
%% from source `trimspaces' on 2016/11/06.
%%
\ProvidesPackage{trimspaces}[2009/09/17 v1.1
Trim spaces around a token list]
% Trimming surrounding spaces:
\catcode`\Q=3
\newcommand\trim@spaces[1]{%
\romannumeral-`\q\trim@trim@\noexpand#1Q Q%
}
\long\def\trim@trim@#1 Q{\trim@trim@@#1Q}
\long\def\trim@trim@@#1Q#2{#1}
\catcode`\Q=11
\newcommand\trim@spaces@noexp[1]{%
\unexpanded\expandafter\expandafter\expandafter
{\trim@spaces{#1}}%
}
\newcommand\trim@spaces@in[1]{%
\edef#1{\expandafter\trim@spaces@noexp\expandafter{#1}}%
}
% Trimming preceding spaces:
\newcommand\trim@pre@space[1]{%
\romannumeral-`\.\expandafter\noexpand#1%
}
\newcommand\trim@pre@space@noexp[1]{%
\unexpanded\expandafter{%
\romannumeral-`\.\expandafter\noexpand#1%
}%
}
\newcommand\trim@pre@space@in[1]{%
\expandafter\def\expandafter#1\expandafter{%
\romannumeral-`\.\expandafter\noexpand#1%
}%
}
% Trimming trailing space:
\catcode`\Q=3
\newcommand\trim@post@space[1]{\trim@trim@#1Q Q}
\catcode`\Q=11
\newcommand\trim@post@space@noexp[1]{%
\unexpanded\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter\expandafter
{\trim@post@space{#1}}%
}
\newcommand\trim@post@space@in[1]{%
\edef#1{\expandafter\trim@post@space@noexp\expandafter{#1}}%
}
% That's it.