diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /info/challenges/aro-bend/exercise.015 |
Initial commit
Diffstat (limited to 'info/challenges/aro-bend/exercise.015')
-rw-r--r-- | info/challenges/aro-bend/exercise.015 | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/info/challenges/aro-bend/exercise.015 b/info/challenges/aro-bend/exercise.015 new file mode 100644 index 0000000000..5f39444699 --- /dev/null +++ b/info/challenges/aro-bend/exercise.015 @@ -0,0 +1,36 @@ +Date: 05 Nov 1993 16:34:28 -0500 (EST) +From: Michael Downes <MJD@MATH.AMS.ORG> +Subject: Around the Bend #15 +To: info-tex@shsu.edu +X-ListName: TeX-Related Network Discussion List <INFO-TeX@SHSU.edu> + +======================================================================== +*** Exercise 15 +(a) Write a macro \trimspace that takes another macro as its argument and +removes a trailing space from the replacement text of the macro, if one +is present, and otherwise leaves it unchanged. + +(b) Write a macro \trimspaces that removes a leading space, if +present, and then calls \trimspace to remove a trailing space. + +======================================================================== + +Motivation: If a user inadvertently includes an extra space +in a text argument, such as a section heading: + + \section{Title of the section } + +then you must usually take care to remove the space when typesetting +the text. The simple way is to perform an \unskip at the end (if the +text is immediately followed by \par, the \unskip operation is +built-in) and an \ignorespaces at the beginning, but various +complications can arise, so it would be preferable to be able to apply +a \trimspaces function when an argument is first read, and then have +the information in proper form for all subsequent uses. + +Send answers to the address below. A summary will be posted +November 23, 1993 or thereabouts. + +Michael Downes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +mjd@math.ams.org (Internet) ASCII 32--54,55--126: !"#$%&'()*+,-./0123456 +789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |