Discussion:
definition of \hss
(too old to reply)
Bob
2005-08-02 10:07:26 UTC
Permalink
Hello,

in the file ltplain.dtx, as compiled into latex.ltx, the
code makes a call to "\hss", but no such command is
defined. Where do I find the definition of "\hss"?

I need it to solve the following problem.

The latex environment "enumerate" defines the labels as follows:

\def\makelabel##1{\hss\llap{##1}}

The above code produces the default look of enumerations:

1. sdj fks jfksd f fff
sdjfk sjdfdfk lsdkf
2. s kdls kdfl;ds f; f
dfjks dfjksdf jkls.
...
100. df jskdf jks dlfl
jsdkf jskdfl jkfdf.

I want to change the above look into the following:

1. df jksd fkjsdl f
djf ksjdfk jsdkf jksd l
dklf dklf dk fld klfd l
2. sdfj ksdjf ksdjf
df jksdf jkls dfjksd fl
dk kld fkls;df kld fkld
...
100. s jkf jdff jkl
sdklf sk dlf ksld;f kl.

I tried the code below, but it fails.

\def\makelabel##1{\hspace*{\parindent}\hss\llap{##1}\hspace*{1em}}



Thank you.

Bob
Harry Schmidt
2005-08-02 10:15:20 UTC
Permalink
Post by Bob
in the file ltplain.dtx, as compiled into latex.ltx, the
code makes a call to "\hss", but no such command is
defined. Where do I find the definition of "\hss"?
\hss ("horizontal stretch or shrink", glue that is infinitely stretchable
and shrinkable) is a TeX-primitive. It is explained e.g. in the TeXbook or
in TeX by topic.

Harry
--
Although the moon is smaller than the earth, it is farther away.
Harry Schmidt
2005-08-02 13:23:28 UTC
Permalink
Post by Bob
1. df jksd fkjsdl f
djf ksjdfk jsdkf jksd l
dklf dklf dk fld klfd l
2. sdfj ksdjf ksdjf
df jksdf jkls dfjksd fl
dk kld fkls;df kld fkld
...
100. s jkf jdff jkl
sdklf sk dlf ksld;f kl.
Taking a second look at your posting I thought that it would probabely be
best to change \itemindent and the like in enumerate or create your own
list directly from the list-environment.

Harry
--
Although the moon is smaller than the earth, it is farther away.
Bob
2005-08-02 13:49:01 UTC
Permalink
Post by Harry Schmidt
Taking a second look at your posting I thought that it would probabely be
best to change \itemindent and the like in enumerate or create your own
list directly from the list-environment.
This is the code I am playing with. The left margins are not
working as I expect. The nasty bit is the nesting of
environments.

Bob


% For unknown reasons, \hspace*{\parindent} does not work.
% Still for unknown reasons, the problem is solved by
% assigning the value of \parindent to a new variable.
\newlength{\theindent}\setlength{\theindent}{\parindent}

\newcount\@enumdepth \@enumdepth = 0

\@definecounter{enumi}
\@definecounter{enumii}
\@definecounter{enumiii}

%\def\llap#1{\***@xt@\z@{\hss#1}}

\def\enumerate{%
\ifnum \@enumdepth > 3
\@toodeep
\else
\advance \@enumdepth 1
\edef\@enumctr{enum\romannumeral\the\@enumdepth}%
\expandafter
\list
\csname label\@enumctr\endcsname%
{% Label:
\usecounter\@enumctr%
% \def\makelabel##1{\hss\llap{##1}}% label
\def\makelabel##1{\hspace*{\theindent}{##1}\hspace*{1em}}%
label
% \setlength{\labelwidth}{0pt}% auto
% \setlength{\labelsep}{1ex}%
% Horizontal spacing:
\setlength{\leftmargin}{0pt}% default
\setlength{\rightmargin}{0pt}% default
\setlength{\itemindent}{0pt}% no extra indentation
\setlength{\listparindent}{0pt}%
% Vertical spacing:
\setlength{\topsep}{\topskip}% space from preceding paragraph
\setlength{\partopsep}{0pt}% no extra space at the top of the
list
\setlength{\parsep}{0pt}% no white line between paragraphs
within an item
\setlength{\itemsep}{0pt}% no white line between items
\setlength{\parskip}{\parsep}%
}%
\fi}
\let\endenumerate =\endlist
Robin Fairbairns
2005-08-02 14:27:14 UTC
Permalink
Post by Bob
This is the code I am playing with. The left margins are not
working as I expect. The nasty bit is the nesting of
environments.
of course. there are working examples of this sort of thing in the
companion.
Post by Bob
% For unknown reasons, \hspace*{\parindent} does not work.
the list environment sets \parindent to \listparindent.
Post by Bob
% Still for unknown reasons, the problem is solved by
% assigning the value of \parindent to a new variable.
don't understand why that's unknowable.
Post by Bob
\newlength{\theindent}\setlength{\theindent}{\parindent}
or change the value of \listparindent. may (of course) provoke
problems elsewhere.
these counters already exist. \newcount doesn't check name clashes
(because it's a plain command) and \@definecounter doesn't (because
it's an internal command, usually used after exercising
\@ifdefinable).

redefining counters causes extra registers to be allocated. this may
not be a problem ... today ...
--
Robin (http://www.tex.ac.uk/faq) Fairbairns, Cambridge
Bob
2005-08-02 14:41:25 UTC
Permalink
there are working examples of this sort of thing in the companion.
That's were I am coming from, moving towards an enumerated
environment whose items look like normal paragraphs [see above].

The task is not as straightforward as the trivial examples in the
Companion (I have the 1994 edition). The above code shows
the work I am doing. Feel free to join me.

Bob
Bob
2005-08-02 13:59:54 UTC
Permalink
To make the leftmargin problems stick out, try the followings:

\def\makelabel##1{.\hspace*{\theindent}.{##1}\hspace*{1ex}}%

and comment out the spec for the leftmargin.

Bob
Bob
2005-08-02 15:01:52 UTC
Permalink
This thread ends here. It follows in the new thread named
"new definition of the enumerate envionment".

Loading...