🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text
Article #4404

Need help with hanging title macros

#4404
From: Art Werschulz
Date: Thu, 11 Feb 1988 19:27
126 lines
5078 bytes
-> I recently posted this request to TeXhax, but didn't get a
-> satisfactory solution.  I thought I might have better luck with
-> comp.text.  
->
-> If this is the second time this has appeared in comp.text, pardon
-> me ... it's not clear whether my original positing went through or
-> not.   Thanks.

Hi.

The file "hang.tex" (appended to this article) is supposed to
implement a "hanging title" style.  Basically, the input

   \input hang

   \beginhangtitling

   \sectionbeg

   \sectionbeg{I.}{First \par section}
   Twas brillig and the slithy toves, beware the Jabberwock my son.
   And the mome raths uffishly outgrabe.
   Twas brillig and the slithy toves, beware the Jabberwock my son.
   And the mome raths uffishly outgrabe.
   Twas brillig and the slithy toves, beware the Jabberwock my son.
   And the mome raths uffishly outgrabe.

   Twas brillig and the slithy toves, beware the Jabberwock my son.
   And the mome raths uffishly outgrabe.
   Twas brillig and the slithy toves, beware the Jabberwock my son.
   And the mome raths uffishly outgrabe.
   Twas brillig and the slithy toves, beware the Jabberwock my son.
   And the mome raths uffishly outgrabe.

should produce something like

I.  First     Twas brillig and the slithy toves, beware the Jabberwock
    section   my son.  And the mome raths uffishly outgrabe.  Twas brillig
              and the slithy toves, beware the Jabberwock my son.  And the
	      mome raths uffishly outgrabe.  Twas brillig and the slithy 
	      toves, beware the Jabberwock my son.  And the mome raths
	      uffishly outgrabe.

              Twas brillig and the slithy toves, beware the Jabberwock
              my son.  And the mome raths uffishly outgrabe.  Twas brillig
              and the slithy toves, beware the Jabberwock my son.  And the
	      mome raths uffishly outgrabe.  Twas brillig and the slithy 
	      toves, beware the Jabberwock my son.  And the mome raths
	      uffishly outgrabe.

Well, this works *fairly* well.  The problem is that the first few
letters of the first sentence in the section are outdented:

I.  First   Twas brillig and the slithy toves, beware the Jabberwock my
    section   son.  And the mome raths uffishly outgrabe.  Twas brillig
              and the slithy toves, beware the Jabberwock my son.  And the
	      mome raths uffishly outgrabe.  Twas brillig and the slithy 
	      toves, beware the Jabberwock my son.  And the mome raths
	      uffishly outgrabe.

              Twas brillig and the slithy toves, beware the Jabberwock
              my son.  And the mome raths uffishly outgrabe.  Twas brillig
              and the slithy toves, beware the Jabberwock my son.  And the
	      mome raths uffishly outgrabe.  Twas brillig and the slithy 
	      toves, beware the Jabberwock my son.  And the mome raths
	      uffishly outgrabe.

Any thoughts on this one?  More specifically:

	(*) why doesn't my solution work?

	(*) how to fix (or, what's an alternative solution)?

The file hang.tex is as follows:

------%<--%<--%<---cut here---%<--%<--%<---------------------------------------

%hang.tex

\def\beginhangtitling{
 \begingroup\hsize=5.0truein
 \output={\hangoutput}
 \def\currentsection{}
 \long\def\sectionbeg##1##2{
   \mark{\currentsection \noexpand\else ##1\enskip ##2}
   \bigskip\goodbreak\leavevmode\hskip -2.0truein
   \vtop to 0pt{\leftskip=0pt\hsize=1.50truein 
   \noindent \item{\bf ##1\enskip}{\bf ##2}
   \par} \noindent % \hskip 0.25truein\noindent\hskip-4truept
   \mark{##1\enskip ##2\noexpand\else ##1\enskip ##2}
   \def\currentsection{##1\enskip ##2}}
   \def\strutdepth{\dp\strutbox}
   \def\margin##1{\strut\vadjust{\kern-\strutdepth\specialtext{##1}}}
   \def\specialtext##1{\vtop to \strutdepth{
        \baselineskip\strutdepth
        \vss \llap{\hbox to 1.5truein{\it ##1\hfil}}\null}}
}


\def\endhangtitling{\vfill\eject\endgroup}

\def\hangoutput{
 \shipout\hbox to 6.5truein{
   \hfil
   \vbox{\makeheadline\pagebody\makefootline}}
   \advancepageno
   \gdef\secname{\newsecname}
   \ifnum\outputpenalty>-20000 \else\do\supereject\fi}

%%%%%%%%%%%%%%%%%%%%% end of hang.tex

------%<--%<--%<---cut here---%<--%<--%<---------------------------------------

Thanks.




	Art Werschulz

 	ARPAnet:  agw@columbia.edu
	USEnet:   ... seismo!columbia!agw
	BITnet:   agw@columbia.edu
	CCNET:    agw@garfield
	ATTnet:   Columbia University (212) 280-3610 280-2736
		  Fordham University  (212) 841-5323 841-5396
Technical Details
Message-ID: <5306@columbia.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!mcdchg!chinet!ihnp4!ptsfa!ames!nrl-cmf!cmcl2!rutgers!columbia!convent!agw

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!mcdchg!chinet!ihnp4!ptsfa!ames!nrl-cmf!cmcl2!rutgers!columbia!convent!agw
From: agw@convent.columbia.edu (Art Werschulz)
Newsgroups: comp.text
Subject: Need help with hanging title macros
Summary: My solution *almost* works
Keywords: \vtop
Message-ID: <5306@columbia.edu>
Date: 11 Feb 88 19:27:01 GMT
Sender: nobody@columbia.edu
Reply-To: agw@columbia.edu (Art Werschulz)
Organization: Columbia University Computer Science Dept.
Lines: 126