Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 157787 - "undefined reference" but the reference is defined
"undefined reference" but the reference is defined
 Keywords: ABIAssurance AcceptanceCriteriaApproved AcceptanceCriteriaNeeded AcceptanceCriteriaProvided AcceptanceCriteriaRejected Automation AutomationBackLog AutomationBlocker AutomationTriaged AutoVerified BetaBlocker Branch Bugfix BuildBlocker CodeChange CommonBugs DeliveryBlocker Desktop DevelBlocker Documentation EasyFix EC2 Embedded External Extras FastFix FeatureBackport Field FieldEngineering FutureFeature GraphicArt GSS-NFV-Escalation GSSTriaged HardwareEnablement HwCertBlocker i18n Improvement ImprovesTestability InstallerIntegration ManPageChange ManyUsersImpacted MoveUpstream NeedsTestCase OnlineDedicated OnlinePro OnlineStarter OpsBlocker OracleCert OtherQA Patch Performance PrioBumpField PrioBumpGSS PrioBumpPM PrioBumpQA PromotionBlocker QA-Closed Question Rebase Regression ReleaseNotes Reopened Reproducer RevisionTracker RFE RHELNAK screened ScreenshotChange Security SecurityTracking SELinux StringChange StudentProject SubBug SubFeature SubTask SupportQuestion Task TechPreview TestBlocker TestCaseApproved TestCaseNeeded TestCaseProvided TestCaseRejected TestOnly Tracking Translation Triaged Unconfirmed UpcomingRelease UpcomingSprint Upgrades Upstream UseCase UserExperience UserStory VerifiedOnDev VerifiedUpstream WorkAround WorkItem ZStream CLOSED UPSTREAM None Fedora Fedora tetex --- rawhide All Linux low low --- Jindrich Novy David Lawrence depends on / blocked

 Reported: 2005-05-15 15:55 UTC by John Smith 2013-07-02 23:07 UTC (History) 1 user (show) pknirsch Bug Fix 2005-05-19 16:06:39 UTC Red Hat Enterprise Virtualization Manager Red Hat OpenStack

 John Smith 2005-05-15 15:55:18 UTC Description of problem: When I compile the attached file, I get the following error: Reference FOOBAR' on page 7 undefined on input line 69. I have used the identifier foobar' to define a label and to refer to it, but I haven't used the identifier FOOBAR anywhere in the source file. Version-Release number of selected component (if applicable): tetex-3.0-4 How reproducible: Always, on my machine. Well, the phenomenom seems to be very dependent on the layout, and I do not know to what extent the layout is controlled by parameters in configuration files, outside of the source file (like papersize etc.). If it doesn't work for you, try adding a few lines of foo \bigskip foo ... Steps to Reproduce: 1. Replace put_your_language_here in the source file with your language. [That's something I haven't elucidated yet: if I don't put the \usepackage[...]{babel} line in the source file or if I specify another language than mine, latex refuses to compile the file.] 2. Type: latex foo.tex Actual results: LaTeX Warning: Reference `FOOBAR' on page 7 undefined on input line 69. Expected results: Compile cleanly. John Smith 2005-05-15 15:55:19 UTC Created foo.tex Jindrich Novy 2005-05-16 06:53:54 UTC The problem is that LaTeX actually doesn't know how to refer to the label I see from the source you attached. \label has to be used only within some block that have some reference number, \section, \chapter, \begin{table} etc. Note that you defined your \label at the top level that has no reference number so LaTeX has no clue how to name the reference. It behaves as it should that it refuses to create a reference. John Smith 2005-05-16 08:40:21 UTC Created source file with a chapter John Smith 2005-05-16 08:42:03 UTC I have just added the line \chapter{Here's a chapter} before the label definition. The bug still happens. Jindrich Novy 2005-05-16 09:07:04 UTC You need to pass the source through LaTeX twice in order to get correct references. It's also quite unusual that you refer to a chapter from a section header. Please refer to it from somewhere inside a section body, i.e. \section{And now for something completely different} This is a reference to chapter \ref{foobar}. and you'll see no warnings about invalid references. John Smith 2005-05-16 10:03:31 UTC I know latex has to be run twice. What I claim is that even if it is run twice, it finds an undefined reference, which is a bug. Indeed I could work around the bug by not referring to the label inside the section body. But I do want to do this and it *is* valid LaTeX. I have been doing it for years and I still want to do it now. If you remove all (or most of) the lines of foo \bigskip foo, then suddenly latex does not complain any more, which clearly is inconsistent. When I report a bug I'm not asking for advice as to how to work around it. Please have a serious look at this issue. Thanks in advance. Jindrich Novy 2005-05-16 10:53:33 UTC Ok, maybe some regression was introduced by LaTeX within teTeX-3.0. The warning message seems to be a minor inconsistency. Because pdfLaTeX doesn't refuse to generate a valid pdf, changing severity/priority to low. The best solution here is to report the problem upstream. I don't have a deep knowledge of LaTeX code and can't spend hours finding a fix for warning message, sorry. Could you please report this problem upstream? The upstream developers have a good insight into LaTeX code and respond quickly. Furthermore a fix for this issue will affect all the distributions, not only Fedora, when a it's applied upstream. Please read first: http://www.latex-project.org/bugs.html and then file the bug in: http://www.latex-project.org/bugs-upload.html Could you then add here a reference to the bug you reported so that I can track it to have a patch to fix this applied? John Smith 2005-05-19 15:59:31 UTC Done: babel/3786 It turns out to be a known bug in babel for which "a fix may be difficult if not impossible in the current implementation". Jindrich Novy 2005-05-19 16:06:39 UTC Thanks for filing the bug in upstream and posting here a reference to it. Did you have any other fruitful feedback from the upstream developers that the fix for this is hopeless for the current implementation? John Smith 2005-05-20 09:39:40 UTC I haven't had other feedback than what can be read in their bug database, i.e. what I mentioned already and the following workaround: \section{And now for something completely different: \MakeLowerCase{\ref{foobar}}} Of course it does not work anymore if the label contains an uppercase letter. I suggest another workaround: put two labels instead of just one, like this: \label{foobar} \label{FOOBAR}