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

Bug#63930: gets margins incorrect



From: Brian
Subject: Bug#63930:
Date: 15

>     Atsuhito> - changebar.sty depends dvi drivers and it seems you
>     Atsuhito> used \usepackage[dvips]{changebar} so xdvi can not
>     Atsuhito> handle dvi correctly.
> 
> I got rid of all instances of "dvips" (not sure what it does), but
> the triangle still appears.

Oh, sorry but changebar.sty does not support "xdvi" option yet
and no option will not help you as you want (I do not know the
default of changebar.sty).

>     Atsuhito> Does the same problems occur when you print dvi directly
>     Atsuhito> to printer with dvips?
> 
> You mean instead of using gs? I doubt it, but could try it if you
> think it really would help.

Yes I doubt it too ;) I think that there is no difference
between printing on paper with dvips and previewing PS file
generated by dvips with gs.  I said like above because it was
rather too cumbersome or too difficult for me to state the situation
in English precisely (really sorry).

But please remark that it is fundamentally different whether 
you preview DVI file with xdvi or preview PS file generated by 
dvips with gs.

> FYI: displaying the dvi file in xdvi is worse then displaying the
> ps file in gv.

> I don't understand why viewing the file under xdvi causes
> more problems then after dvips, perhaps xdvi parsing is less
> robust.

I try to explain this point first.  

In /usr/share/texmf/source/latex/changebar/changebar.dtx
it is written as (perhaps you read it alredy)

% \begin{abstract}
%    This package implements a way to indicate
%    modifications in a \LaTeX-document by putting bars in the
%    margin. It realizes this by making use of the |\special|
%    commands supported by `dvi drivers'.  Currently four different
%    drivers are supported. More can easily be added.
% \end{abstract}

and

% \subsection{The package options}
%
%    One set of package options\footnote{For older documents the
%    command \cs{driver} is available in the preamble of the document.
%    It takes the options as defined for \LaTeXe\ as argument.}
%    specify the driver that will be used to print the document can be
%    indicated. The driver may be one of: 
%    \begin{itemize}
%      \item DVItoLN03
%      \item DVItoPS
%      \item DVIps
%      \item em\TeX
%    \end{itemize}

summing up, you can not use xdvi to preview DVI files
which use changebar.sty now.

Do you know TeX's \special command?  I can not explain it well
in English but after \special, TeX or DVI let the whole work
to driver itself and do nothing so if a style file uses \special
it depends strongly on the driver if it works well or not.

In changebar.sty it does not work with xdvi because it
is a specification of the present changebar.sty.

> I am not sure this is going to be so easy. Some of the lines
> appear all over the place. I suspect page breaks might be significant
> though.

It is not easy and not real solution to insert \newpage,
I agree.  But I think that if there is some environment like
\cbstart ... \begin{foo} ... \cbend ... \end{foo} then it
might be also problematic.  These might be deficiencies or bugs 
(or specification?) but please see the following;

% \section{Deficiencies and bugs}
%
% \begin{itemize}
% \item The macros blindly use specials points |\cb@minpoint| through
%    |\cb@maxpoint|. If this conflicts with another set of macros, the
%    results will be unpredictable.  (What is really needed is a
%    |\newspecialpoint|, analogous to |\newcount| etc.~--- it's not
%    provided because the use of the points is rather rare.)
%
% \item There is a limit of 
%    $(\mbox{\texttt{\bslash cb@maxpoint}}-
%    \mbox{\texttt{\bslash cb@minpoint}}+1)/4$ bars per page
%    (four special points per bar).  Using more than this number yeilds
%    unpredictable results (but that could be called a feature for a
%    page with so many bars).  This limitation could be increased if
%    desired.
%
% \item Internal macro names are all of the form |\cb@xxxx|.  No
%    checking for conflicts with other macros is done.
%
% \item This implementation does not work with the
%    \texttt{multicolumn} package.
%
% \item The algorithms may fail if a floating insertion is split over
%    multiple pages.  In \LaTeX\ floats are not split but footnotes
%    may be.  The simplest fix to this is to prevent footnotes from
%    being split but this may make \TeX\ very unhappy.
%
% \item The |\cbend| normally gets ``attached'' to the token after it
%    rather than the one before it.  This may lead to a longer bar
%    than intended.  For example, consider the sequence `word1
%    |\cbend| word2'.  If there is a line break between `word1' and
%    `word2' the bar will incorrectly be extended an extra line.  This
%    particular case can be fixed with the incantation
%    `word1|\cbend{}| word2'.
%  \end{itemize}

> Some comments:
> 
> - I think the \chapter commands might be significant. The chapter
> command might be resetting things it shouldn't.

I do not understand the algorithm of changebar.sty but you
might be right.  But this seems to be the same kind of deficiencies
or bugs (or specification?) as above.

> - for viewing dvi file under dvi:
>     - margins are wrong (changebars too far to the left).
>     - page 2 and 3 are rather interesting...
>     - no gs errors.

This is natural as I explained above.

> - for viewing ps file under gv:
>     - margins are OK
>     - page 2 is broken in a similar manner to the dvi file
>     - page 3 generates gs errors

Sample TeX file contains \chapter and/or \footnote{hello} 
between \cbstart and \cbend.  I think these might be not allowed
yet.  Inserting \newpage appropriately seems to solve "gs errors" 
but generate ugly output.

Conclusion:
- If margins are OK with gv then there is no bug in changebar.sty
  about margins
- gs errors might be a bug of changebar.sty but, in some sense,
  it might be a specification.

Best Regards,			2000.5.15

--
 Debian JP Developer - much more I18N of Debian
 Atsuhito Kohda <kohda@pm.tokushima-u.ac.jp>
 Department of Math., Tokushima Univ.



Reply to: