After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 766023 - C++ operator%() confuses pdflatex
C++ operator%() confuses pdflatex
Status: RESOLVED DUPLICATE of bug 762982
Product: doxygen
Classification: Other
Component: general
1.8.11
Other Linux
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2016-05-05 11:51 UTC by Paul Leopardi
Modified: 2016-05-05 13:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Doxygen configuration (105.46 KB, text/plain)
2016-05-05 11:51 UTC, Paul Leopardi
  Details
Toy C++ example (395 bytes, text/x-c++src)
2016-05-05 11:53 UTC, Paul Leopardi
  Details
Difference between actual and expected latex file (748 bytes, patch)
2016-05-05 12:02 UTC, Paul Leopardi
none Details | Review

Description Paul Leopardi 2016-05-05 11:51:52 UTC
Created attachment 327339 [details]
Doxygen configuration

Running doxygen on a toy C++ example produces both html and latex output. When you then run make in the latex directory, pdflatex hits an error condition at the point where the source code defines operator%(). 

Doxygen configuration is attached.

Relevant part of pdflatex output is:

Runaway argument?
{\texorpdfstring {operator\%(floating lhs, int rhs)}{operator\begin {\ETC.
! Paragraph ended before \@sect was complete.
<to be read again> 

Entire contents of toy.cc follows.

#include <iostream>

/**
 * A floating class
 */
class floating
{
public:
  float value;
  
  floating(float val)
  { value = val; };
};

/// A floating operator
int operator%(floating lhs, int rhs)
{
  return int(lhs.value) % rhs;
}

/**
 * A Toy example
 */
int main(int argc, char ** argv)
{ 
  int result = floating(3.5) % 2;
  std::cout << "result==" << result << std::endl;
  return 0; 
}
Comment 1 Paul Leopardi 2016-05-05 11:53:32 UTC
Created attachment 327340 [details]
Toy C++ example
Comment 2 Paul Leopardi 2016-05-05 12:02:11 UTC
Created attachment 327342 [details] [review]
Difference between actual and expected latex file

toy_8cc.tex.old is the file generated by Doxygen.
toy_8cc.tex is the file I edited.
With this one change (putting \ in front of %) pdflatex generates refan.pdf from refman.tex
Comment 3 albert 2016-05-05 13:12:55 UTC
See also pull request 454 on github

*** This bug has been marked as a duplicate of bug 762982 ***