Camm Maguire <c...@maguirefamily.org> writes:

> On Tue, 2006-04-11 at 12:28 -0400, Adam C Powell IV wrote:
>> When a +latex+ line within a comment ends in \\ e.g. in an array or
>> eqnarray environment, cxref thinks it's a line continuation, includes
>> the next line, but then skips all of the remaining text in that section.
>> Here's an example function comment which triggers the problem:
>> 
>> /*++++++++++++++++++++++++++++++++++++++
>>   +latex+\begin{eqnarray}
>>   +latex+  \label{eq:kwc2eta_t}
>>   +latex+  \tau_\phi\phi_t = A &=& \frac{\delta\cal F}{\delta\phi} =
>>   +latex+  \nu^2\nabla^2\phi + f'(\phi) + s\mu'(\phi)|\nabla\theta|,\\\
>>   +latex+  \label{eq:kwc2theta_t}
>>   +latex+  \tau_\theta\mu(\phi)\theta_t = B\mu(\phi) &=&
>>   +latex+  \frac{\delta\cal F}{\delta\theta} =
>>   +latex+  s\nabla\cdot\left[\mu(\phi)\frac{\nabla\theta}{|\nabla\theta|} +
>>   +latex+    \right] + \epsilon^2\nabla^2\theta,
>>   +latex+\end{eqnarray}\par
>> 
>>   int vectorphase_interior_line_function Returns zero (or an error code).
>> 
>>   etc.
>>   ++++++++++++++++++++++++++++++++++++++*/
>> 
>> And the output:
>> 
>> \subsubsection{Global Function vectorphase\_interior\_line\_function()}
>> \label{func_vectorphase_interior_line_function_vectorphase.c}
>> 
>> \begin{eqnarray}
>>   \label{eq:kwc2eta_t}
>>   \tau_\phi\phi_t = A &=& \frac{\delta\cal F}{\delta\phi} =
>>   \nu^2\nabla^2\phi + f'(\phi) + s\mu'(\phi)|\nabla\theta|,\\  +latex+  
>> \label{eq:kwc2theta_t}
>> 
>> \smallskip
>> {\stt int vectorphase\_interior\_line\_function ( PetscScalar* x, 
>> PetscScalar* func, PetscScalar* temp, PetscTruth** mixed\_constraints, int 
>> points, int gxm, int gym, PetscScalar xmin, PetscScalar xmax, PetscScalar 
>> ycoord, PetscScalar zcoord, PetscScalar time, AppCtx* data )}
>> 
>> So you see, it turned the \\\ into \\ (it turns \\ into \), appended the
>> next line onto that one, and then skipped the remaining material in that
>> section.  And of course Latex throws an error.
>> 
>> I know that cxref did not behave this way in the past, for I have used
>> it before for the exact same source file.  (The September 2004 date of
>> the output file indicates I was probably using woody, so the woody
>> version probably worked, the new one doesn't.)  This is run using:
>> cpp -CPP 'gcc -E -C -dD -dI' -latex
>> Could the -CPP option used here be causing this problem?  (The internal
>> cxref pre-processor causes other problems...)
>
> Indeed, this pre-processor is the problem.  It not only concatenates the
> lines, it puts a lone } on the line after, compounding the breakage.
> The workaround is to make sure backslashes are not ending lines, e.g.
>
>   +latex+  s\mu'(\phi)|\nabla\theta|,\\ \label{eq:kwc2theta_t}
>
> Tried the cxref C pre-processor, it left me with an empty file, hence
> the bug re-title. :-(

The original bug reporter is correct about the reason for the lines
ending in '\' to be removed - it is a C pre-processor requirement.

When using cxref-cpp the same command line arguments should be used,
but as a minimum the '-C' option.  When I tried it the output was
present but not as I expected.  The line mangling by cpp was not
present and the output had all of the comment included in the same
format as the original.

If the original bug reporter can confirm how cxref-cpp was run we can
try to sort out the problem seen.

-- 
Andrew.
----------------------------------------------------------------------
Andrew M. Bishop                             a...@gedanken.demon.co.uk
                                      http://www.gedanken.demon.co.uk/

Cxref homepage:                 http://www.gedanken.demon.co.uk/cxref/



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to