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 352420 - use of \doxyref is wrong
use of \doxyref is wrong
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.5.0
Other All
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
: 364381 365335 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-08-22 16:12 UTC by Harald Koenig
Modified: 2006-11-10 19:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
handle case of !ref.isEmpty ==> external references (1.48 KB, patch)
2006-09-26 19:20 UTC, Ben Voigt
none Details | Review
doxygen_external_href.patch in unified diff format (2.25 KB, patch)
2006-10-19 21:52 UTC, Ben Voigt
none Details | Review

Description Harald Koenig 2006-08-22 16:12:07 UTC
Please describe the problem:
doxygen 1.4.7 produces bad LaTeX code in some cases. 
the patch below fixes the LaTeX output for that special case.

for reference, here is the LaTeX output of doxygen 1.4.6 and 1.4.7 (it was produced from some customer source code and I'm not used to C++, so I can't provide a full example, sorry):

--------------------- 1.4.6 -------------------------
Erneute Implementation in {\bf CPlausi\-Kurve} {\rm (S.\,\pageref{dc/dd8/class_c_plausi_kurve_f0aae9a74656a669700fdbec06c8b47b})}.

Definiert in Zeile 610 der Datei plausi.cpp.\index{CPlausi@{CPlausi}!create@{create}}
--------------------- 1.4.7 -------------------------
Erneute Implementation in \bf{CPlausi\-Kurve} \doxyref{S.}{dd/d49/class_c_plausi_kurve_283d5859c846d7a61efec66e7ac942e8}.

Definiert in Zeile 610 der Datei plausi.cpp.
-----------------------------------------------------

note the missing 1st argument for \doxyref and the wrong usage of \bf .

with this patch I can generate a 250+ page LaTeX doc from said source code:


--- doxygen-1.4.7/src/latexgen.cpp~     2006-05-07 20:02:31.000000000 +0200
+++ doxygen-1.4.7/src/latexgen.cpp      2006-08-22 17:40:22.000000000 +0200
@@ -999,7 +999,7 @@
   }
   else
   {
-    t << "\\bf{";
+    t << "\\textbf{";  // or: "{\\bf " 
     docify(text);
     t << "}";
   } 
@@ -1007,7 +1007,7 @@
 
 void LatexGenerator::startPageRef()
 {
-  t << " \\doxyref{";
+  t << " \\doxyref{}{";
 }
 
 void LatexGenerator::endPageRef(const char *clname, const char *anchor)


Steps to reproduce:
1. 
2. 
3. 


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Dimitri van Heesch 2006-08-22 16:52:14 UTC
Thanks. I'll include the patch in the next CVS update.
Comment 2 Ben Voigt 2006-09-26 19:20:23 UTC
Created attachment 73451 [details] [review]
handle case of !ref.isEmpty ==> external references
Comment 3 Ben Voigt 2006-09-26 19:21:01 UTC
Missed the space after {\bf, and also external links were broken.

This is my first try hacking the doxygen code, so I'm not sure if this handles every case, but most of this is taken from the HTML generator.

Comment 4 Dimitri van Heesch 2006-10-19 19:21:26 UTC
This bug was marked "assigned" by me some time ago, which means it should be fixed in version 1.5.0 and is hereby marked as such. I would kindly request you to check if this version indeed fixes the problem and reopen the bug report should you still see the same problem.
Comment 5 Ben Voigt 2006-10-19 21:50:23 UTC
I had pulled the sources from CVS, and it looked like the patch was already applied when I pulled them almost one month after your first comment.

So my patch would be needed in addition.  I'm sorry about it not being in unified diff format -- I almost exclusively use subversion and it does unified diff by default.

I can confirm that the things I patched are still a problem in CVS.  I will repost my patch in unified diff format.
Comment 6 Ben Voigt 2006-10-19 21:52:06 UTC
Created attachment 75040 [details] [review]
doxygen_external_href.patch in unified diff format

can't reopen the bug since I'm not the original reporter
Comment 7 Harald Koenig 2006-10-20 13:00:39 UTC
(In reply to comment #6)
> Created an attachment (id=75040) [edit]
> doxygen_external_href.patch in unified diff format
> 
> can't reopen the bug since I'm not the original reporter

but I can, so I've tested doxygen-1.5.0 (release tarball) and here we go with the bug open again... ;-)

my test code only shows the problem of the missing space after {\bf in latexgen.cpp (see Ben's patch of latexgen.cpp).  with that single fix, the 244 pages output seem to be ok.

Ben, your first patch hunk for latexdocvisitor.cpp ("\bf{" vs. "{\bf ") seems to  be included in 1.5.0 already, but your change to LatexDocVisitor::startLink is not included in 1.5.0.  I can't comment on that last change, it looks like my test case doesn't depend on that one.

Comment 8 Dimitri van Heesch 2006-10-20 17:37:29 UTC
Harald: I've missed a space indeed. I'll add it.

Ben: I don't understand the changes you made to LatexDocVisitor::startLink,
in particular this part:

+    else
+    {
+      QCString *dest;
+      m_t << "\\href{";
+      if ((dest=Doxygen::tagDestinationDict[ref])) m_t << *dest << "/";
+      if (!file.isEmpty()) m_t << file << Doxygen::htmlFileExtension;
+      if (!anchor.isEmpty()) m_t << "#" << anchor;
+      m_t << "}{";
+    }

I don't think this will work, as it will link to a HTML file!
Comment 9 Ben Voigt 2006-10-20 18:04:34 UTC
It does generate links to external HTML files.  My understanding is that ref.isEmpty() for all internal links, so this should only happen for
TAGFILES = library.doxytag=http://host/subdir

I also believe that the previous implementation had no support for TAGFILES in the pdf output so I'm not breaking anything, am I?

I'm using it to sprinkle links to external websites through my documentation, where the URL of the external site is not known in advance, but specified using a doxytag file, but I think it works equally well for referencing library documentation hosted externally on the web, or on a Windows or NFS share.

I guess since the hyperlink latex package supports pdf->pdf links, the behavior should be different when TAGFILES specifies a PDF file.  This then should affect generated HTML pages as well.  It could be useful to link into CHM documentation as well, but I can't see any point in trying to link to generated manpages, xml, or perldoc.

I guess that would ultimately require adding a destination doc type member to the Doxygen::tagDestinationDict dictionary.  I'm willing to settle for all external links going to HTML, as my patch currently assumes.
Comment 10 Dimitri van Heesch 2006-10-21 13:06:32 UTC
Ah I see. I completely overlooked the option to link from PDF to HTML files. It all makes sense now, and I'll add your patch.
Comment 11 Dimitri van Heesch 2006-10-23 19:26:17 UTC
*** Bug 364381 has been marked as a duplicate of this bug. ***
Comment 12 Dimitri van Heesch 2006-10-26 18:22:17 UTC
*** Bug 365335 has been marked as a duplicate of this bug. ***
Comment 13 Harald Koenig 2006-11-09 16:41:11 UTC
quick update:  doxygen 1.5.1 works.

please add this small patch, just in case someone might uncomment that code (or remove it -- at your choice;-)

-------------------------------------------------------------------------------
diff -ur orig.016524/doxygen-1.5.1/src/latexgen.cpp doxygen-1.5.1/src/latexgen.cpp
--- orig.016524/doxygen-1.5.1/src/latexgen.cpp  2006-10-20 19:23:08.000000000 +0200
+++ doxygen-1.5.1/src/latexgen.cpp      2006-11-09 11:18:57.000000000 +0100
@@ -962,7 +962,7 @@
 //void LatexGenerator::writeClassLink(const char *,const char *,
 //                                    const char *,const char *name)
 //{
-//  t << "{\\bf";
+//  t << "{\\bf ";
 //  docify(name);
 //  t << "}";
 //}
-------------------------------------------------------------------------------


thanks!
Comment 14 Dimitri van Heesch 2006-11-10 19:38:40 UTC
I'll add the patch, but since it has no impact I'm closing this bug report.