[texhax] Problem with fancyvrb.sty -- if firstline = lastline, all remaining lines are printed.
Niall Mansfield
texhax at uit.co.uk
Thu Feb 7 14:03:15 CET 2008
A colleague helped me work out a solution for this. The patch
is shown below.
This package isn't maintained any more, so I don't know how
to get it into the official distributions. Therefore I have made
the patch available online at:
http://www.uit.co.uk/latex/fancyvrb.sty.patch
and the modified version of the .sty file at:
http://www.uit.co.uk/latex/fancyvrb.sty
Niall
----------------------------------------------------------------
*** fancyvrb.sty 2008/02/07 12:41:29 1.1
--- fancyvrb.sty 2008/02/07 12:47:19
***************
*** 39,46 ****
%% This is a companion to the `fancybox' package.
%%
\NeedsTeXFormat{LaTeX2e}
! \def\fileversion{2.7, with DG/SPQR fixes}
! \def\filedate{2000/03/21}
\ProvidesPackage{fancyvrb}[\filedate]
\message{Style option: `fancyvrb' v\fileversion \space <\filedate> (tvz)}
\csname fancyvrb at loaded\endcsname
--- 39,46 ----
%% This is a companion to the `fancybox' package.
%%
\NeedsTeXFormat{LaTeX2e}
! \def\fileversion{2.7a, with DG/SPQR fixes, and firstline=lastline fix}
! \def\filedate{2008/02/07}
\ProvidesPackage{fancyvrb}[\filedate]
\message{Style option: `fancyvrb' v\fileversion \space <\filedate> (tvz)}
\csname fancyvrb at loaded\endcsname
***************
*** 252,264 ****
\let\FV at FindStartStop\FV at FindStopString
\fi}
\def\FV at FindStopNum{%
! \ifnum\FancyVerbStopNum=\FV at CodeLineNo
\let\FV at FindStartStop\relax
\ifeof\FV at InFile\else
\immediate\closein\FV at InFile
\fi
\fi
! \FV@@PreProcessLine}
%% SR modification begin - 1996
\def\FV at FindStopString{%
\expandafter\FV@@FindStopString
--- 252,268 ----
\let\FV at FindStartStop\FV at FindStopString
\fi}
\def\FV at FindStopNum{%
! \ifnum\FancyVerbStopNum>\FV at CodeLineNo
! \else
\let\FV at FindStartStop\relax
\ifeof\FV at InFile\else
\immediate\closein\FV at InFile
\fi
\fi
! \ifnum\FancyVerbStopNum<\FV at CodeLineNo
! \else
! \FV@@PreProcessLine
! \fi}
%% SR modification begin - 1996
\def\FV at FindStopString{%
\expandafter\FV@@FindStopString
On Feb 6, 5:26pm, Niall Mansfield wrote:
> Subject: Problem with fancyvrb.sty -- if firstline = lastline, all remaini
> I'm using the excellent fancyvrb.sty package, but
> have run into a problem:
>
> \VerbatimInput[firstline=5,lastline=6]{test.txt}
>
> works fine, and prints lines 5 to 6 inclusive, as expected.
> However:
>
> \VerbatimInput[firstline=5,lastline=5]{test.txt}
>
> starts printing at line 5, and continues to the end of
> the file.
>
> Is there a fix for this, does anyone know?
>
> Thanks,
> Niall
>-- End of excerpt from Niall Mansfield
More information about the texhax
mailing list