Menu

#3 Bug in LaTeX output with {\em ...}

open
nobody
None
5
2001-04-04
2001-04-04
Anonymous
No

For a boolean return I use the following:

/**
* blah blah
*
* @return
* {\em true} if ok, else {\em false}
*/
bool foo (void);

As a result I get the following LaTeX code:

\index{foo}
\index{{\bf Functions/Methods}!!foo}
\begin{cxxfunction}
{bool}
{foo}
{(void)}
{ blah blah}
{1}
\cxxReturn{
\begin{tabular}[t]{lp{0.5\textwidth}}
{\tt\strut \{{$\backslash$\relax}em} & true} if ok, else {\em false}
\end{tabular}}

Note that there is an extra `}' in the last line
that will cause `latex' to abort with an error message.

I use doc++ 3.4.7

Discussion

  • Steven Gould

    Steven Gould - 2002-08-25

    Logged In: YES
    user_id=58273

    The problem appears to be more than just an extra '}'.
    Notice too that the {\em true} has been mangled to produce
    '\{{$\backslash$\relax}em} & true'. Still, the result is an
    invalid TeX/LaTeX file.

     
  • Steven Gould

    Steven Gould - 2002-08-25

    Logged In: YES
    user_id=58273

    Having looked into the doc2tex.ll code for this, and the
    function dumpTeXlist (around line 1255 onwards), it looks
    like the last '}' actually is intended to match up with the
    '\cxxReturn{' line. So, the curly brackets are off between
    the begin and end tabular.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.