<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% \iffalse
%%
%% File: nccstretch.dtx Copyright (C) 2004 by Alexander I. Rozhenko
%%
%&lt;package&gt;\NeedsTeXFormat{LaTeX2e}
%&lt;package&gt;\ProvidesPackage{nccstretch}
%&lt;package&gt;         [2004/11/30 v1.0 Text Stretch Package (NCC)]
%
% \changes{v1.0}{2004/11/30}{This version was uploaded to CTAN}
%
%&lt;*driver&gt;
\let\makeindex\relax
\documentclass{ltxdoc}
\usepackage{nccstretch}
\GetFileInfo{nccstretch.sty}
\begin{document}
\title{The \textsf{nccstretch} package\thanks{This file
        has version number \fileversion, last
        revised \filedate.}}
\author{Alexander I. Rozhenko\\rozhenko@oapmg.sscc.ru}
\date{\filedate}
\maketitle
\DocInput{nccstretch.dtx}
\end{document}
%&lt;/driver&gt;
% \fi
% \section{User Interface}
%
% \DescribeMacro{\stretchwith}
% The package implements the command
% \begin{quote}
% |\stretchwith|\marg{foo}\marg{text}
% \end{quote}
% that stretches the \meta{text} parameter inserting the
% \meta{foo} sequence between every pair of neighbour tokens of
% the \meta{text}. Spaces in the text are ignored. So, to save
% a space, you need to insert a backslash before it or enclose
% a space in braces. If you do not want to insert \meta{foo}
% between some tokens, enclose them in braces. While stretching,
% all first-level braces are removed. The examples below
% show some use cases (we delimit the results with rules to show
% exactly how the command works):
% \begin{center}\small%
% \newcommand*\ruled[1]{\rule{.4pt}{2ex}#1\rule{.4pt}{2ex}}%
% \begin{tabular}{@{}l@{\qquad}l@{}}
% \textbf{Command} &amp; \textbf{Result}\\
% |\stretchwith{\,}{Proof\ of\ Theorem\ 1}| &amp;
% \ruled{\stretchwith{\,}{Proof\ of\ Theorem\ 1}}\\
% |\stretchwith{.}{\ test{ }test{}\ \ {test}{\"e}}| &amp;
% \ruled{\stretchwith{.}{\ test{ }test{}\ \ {test}{\"e}}}\\
% |\makebox[1.5\width]{\stretchwith{\hfill}{test\ test}}| &amp;
% \ruled{\makebox[1.5\width]{\stretchwith{\hfill}{test\ test}}}
% \end{tabular}
% \end{center}
% \StopEventually{}
%
% \section{The Implementation}
% \begin{macro}{\stretchwith}
% The command is implemented using |\@tfor| cycle.
% The |\@tempa| command contains a sequence to be inserted
% before the next token. It is set to |\relax| before the
% cycle and is set to \meta{foo} after every inserted token.
% This trick allows insert \meta{foo} \textbf{between}
% neighbour tokens only.
%    \begin{macrocode}
%&lt;*package&gt;
\newcommand*\stretchwith[2]{%
  \let\@tempa\relax
  \def\@tempb{#1}%
  \@tfor\@tempc:=#2\do {\@tempa \@tempc \let\@tempa\@tempb}%
}
%&lt;/package&gt;
%    \end{macrocode}
% \end{macro}
\endinput
</pre></body></html>