bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

@deffn in @smallbook into margin


From: Robert J. Chassell
Subject: @deffn in @smallbook into margin
Date: Mon, 1 Jul 2002 17:53:48 +0000 (UTC)

In the XDVI output, in @smallbook, the @deffn command creates a header
in which the name of the type of function is typeset into the margin.
The `defname' macro in texinfo.tex appears to specify this.

The name of the type of function can be typeset flush right by reducing
the offset to zero.  

Some note of this ought to be made in the texinfo.tex source.  Also
there should be a pointer from the @deffn command to the \defname
definition so someone looking up the @deffn command to deal with the
problem is told immediately where the solution is.  

I don't know whether the current behavor should be changed -- I don't
know why this value is set to what it is.  I was asked to deal with
the situation by someone who does not want the type name bleeding into
the margin and solved it by making a \global\def to put into the
Texinfo source file.

Here is a test file that illustrates the situation.

\input texinfo.tex   @c -*-texinfo-*-
@comment %**start of header
@setfilename deffn-test.info
@settitle Texinfo Test
@smallbook
@comment %**end of header

@iftex
@cropmarks
@end iftex

@c In the test section below, the indentation from the right margin
@c is set to zero in the following line
@c     \rlap{\rightline{{\rm #2}\hskip .0pc }}}%
@c If the indentation is set to a negative quantity, 
@c the type of definition goes into the margin area in smallbook.

@ignore
 ## Summary of shell commands to create various output formats:

    ## Info output
    makeinfo --force --fill-column=70 --no-split --paragraph-indent=0 \
    --verbose deffn-test.texi

    ## DVI output
    texi2dvi deffn-test.texi

    ## Plain text output
    makeinfo --fill-column=70 --no-split --paragraph-indent=0 \
    --verbose --no-headers --output=deffn-test.txt  \
    deffn-test.texi

    ## HTML output
    makeinfo --no-split --html deffn-test.texi

    ## DocBook output
    makeinfo --docbook --no-split --paragraph-indent=0 \
    --verbose deffn-test.texi

    ## XML output
    makeinfo --xml --no-split --paragraph-indent=0 \
    --verbose deffn-test.texi

@end ignore

@copying
Copyright @copyright{} 2002 Free Software Foundation, Inc.

This is a test file.

@quotation
Verbatim copying and distribution of this document are
permitted without royalty in any medium provided this
notice is preserved.

@c    The remainder of this paragraph applies to and
@c    should appear in the Texinfo source.
@c Permission is granted to process this file through
@c a converter, such as TeX, to create a different
@c output format and to publish the results, provided
@c the published document carries a copying permission
@c notice identical to this one except for the removal
@c of this paragraph (this paragraph not being
@c relevant to the published document).

Permission is granted to copy and distribute
translations of this document without royalty in any
medium in another language provided this notice is
preserved in its original language.
@end quotation
@end copying


@c For smallbook format, use smaller than normal amounts of
@c whitespace between chapters, sections, and paragraphs.
@tex
\global\chapheadingskip = 15pt plus 4pt minus 2pt
\global\secheadingskip = 12pt plus 3pt minus 2pt
\global\subsecheadingskip = 9pt plus 2pt minus 2pt \global\parskip 2pt plus 1pt
@end tex




@titlepage
@sp 6
@center @titlefont{Test document}
@sp 4
@center by Robert J. Chassell

@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage

@contents

@ifnottex
@node Top, Chapter One, (dir), (dir)
@top Test Top
@insertcopying
@end ifnottex


@menu
* Chapter One::
@end menu

@node Chapter One, , Top, Top
@comment node, next, prev, up
@chapter Chapter One

The lazy dog jumps over the quick brown fox.  The lazy dog jumps over
the quick brown fox.

This is a test of @code{@@deffn}

@deffn {Interactive Command} isearch-forward
@deffnx {Interactive Command} isearch-backward
These two search commands are similar except @dots{}
@end deffn

The lazy dog jumps over the quick brown fox.  The lazy dog jumps over
the quick brown fox.

@tex
% First, defname, which formats the header line itself.
% #1 should be the function name.
% #2 should be the type of definition, such as "Function".

\global\def\defname #1#2{%
% Get the values of \leftskip and \rightskip as they were
% outside the @def...
\dimen2=\leftskip
\advance\dimen2 by -\defbodyindent
\noindent
\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
\parshape 2 0in \dimen0 \defargsindent \dimen1
% Now output arg 2 ("Function" or some such)
% ending at \deftypemargin from the right margin,
% but stuck inside a box of width 0 so it does not interfere with linebreaking
{% Adjust \hsize to exclude the ambient margins,
% so that \rightline will obey them.
\advance \hsize by -\dimen2
%% for smallbook, change 
%%     \rlap{\rightline{{\rm #2}\hskip -1.25pc }}}%
%% to following
\rlap{\rightline{{\rm #2}\hskip .0pc }}}%
% Make all lines underfull and no complaints:
\tolerance=10000 \hbadness=10000
\advance\leftskip by -\defbodyindent
\exdentamount=\defbodyindent
{\df #1}\enskip        % Generate function name
}
@end tex

@deffn {Interactive Command} isearch-forward
@deffnx {Interactive Command} isearch-backward
These two search commands are similar except @dots{}
@end deffn

The lazy dog jumps over the quick brown fox.  The lazy dog jumps over
the quick brown fox.

@bye



reply via email to

[Prev in Thread] Current Thread [Next in Thread]