From: Renton I. <IR...@qi...> - 2008-06-04 08:27:24
|
Hi again, another question I'm afraid - After successfully implementing the linebreaks in my text output, I now get a warning produced for most if not all of the multi-line text fields, like this: C:\python25\lib\site-packages\pyx\text.py:372: UserWarning: ignoring overfull/un derfull box warning: Underfull \hbox (badness 10000) detected at line 0 []\OT1/cmss/m/n/5 U74 warnings.warn("%s:\n%s" % (self.warning, m.string[m.start(): m.end()].rstrip() )) Am I doing something actually wrong, or can I safely ignore these? If the latter, is there any way of suppressing these warnings? I've tried a try/except block around my code that just catches a UserWarning and does nothing, but that doesn't stop the messages being displayed, so I assume this happens within text.py or within LaTeX. Thanks, Ian -- The information contained in this E-Mail and any subsequent correspondence is private and is intended solely for the intended recipient(s). The information in this communication may be confidential and/or legally privileged. Nothing in this e-mail is intended to conclude a contract on behalf of QinetiQ or make QinetiQ subject to any other legally binding commitments, unless the e-mail contains an express statement to the contrary or incorporates a formal Purchase Order. For those other than the recipient any disclosure, copying, distribution, or any action taken or omitted to be taken in reliance on such information is prohibited and may be unlawful. Emails and other electronic communication with QinetiQ may be monitored and recorded for business purposes including security, audit and archival purposes. Any response to this email indicates consent to this. Telephone calls to QinetiQ may be monitored or recorded for quality control, security and other business purposes. QinetiQ Limited Registered in England & Wales: Company Number:3796233 Registered office: 85 Buckingham Gate, London SW1E 6PD, United Kingdom Trading address: Cody Technology Park, Cody Building, Ively Road, Farnborough, Hampshire, GU14 0LX, United Kingdom http://www.QinetiQ.com/home/legal.html |
From: Gert I. <ger...@ph...> - 2008-06-04 08:46:26
|
Hi Ian, > C:\python25\lib\site-packages\pyx\text.py:372: UserWarning: ignoring > overfull/un > derfull box warning: > Underfull \hbox (badness 10000) detected at line 0 > []\OT1/cmss/m/n/5 U74 > warnings.warn("%s:\n%s" % (self.warning, m.string[m.start(): > m.end()].rstrip() > )) LaTeX is unhappy because you gave it a width (presumably a minipage or parbox) and it has difficulties to produce a line which is sufficiently filled with text. If the produced output is ok, you can just ignore the warning. If the text is spaced too much, you could use raggedright (see section 3.3 of the PyX docs) or something of that kind. LaTeX offers various possibilities here. It really depends on your requirements for the output. Best regards, Gert -- Gert-Ludwig Ingold email: Gert.Ingold@Physik.Uni-Augsburg.DE Institut für Physik Phone: +49-821-598-3234 Universität Augsburg Fax : +49-821-598-3222 D-86135 Augsburg WWW : www.physik.uni-augsburg.de/theo1/ingold Germany PGP : 86FF5A93, key available from homepage |
From: Renton I. <IR...@qi...> - 2008-06-04 10:33:12
|
> If the produced output is ok, > you can just ignore the warning. Unfortunately not - while I don't mind seeing the warnings myself, the app is going to be built using py2exe, which seems to produce an "Error has occurred" dialog box after termination if there are warnings as well as if there are errors. I'd prefer not to change py2exe's behaviour (if that's possible) as I don't mind being warned about other things - it's just this one that I know about and so don't want to be reminded of! Thanks, Ian The information contained in this E-Mail and any subsequent correspondence is private and is intended solely for the intended recipient(s). The information in this communication may be confidential and/or legally privileged. Nothing in this e-mail is intended to conclude a contract on behalf of QinetiQ or make QinetiQ subject to any other legally binding commitments, unless the e-mail contains an express statement to the contrary or incorporates a formal Purchase Order. For those other than the recipient any disclosure, copying, distribution, or any action taken or omitted to be taken in reliance on such information is prohibited and may be unlawful. Emails and other electronic communication with QinetiQ may be monitored and recorded for business purposes including security, audit and archival purposes. Any response to this email indicates consent to this. Telephone calls to QinetiQ may be monitored or recorded for quality control, security and other business purposes. QinetiQ Limited Registered in England & Wales: Company Number:3796233 Registered office: 85 Buckingham Gate, London SW1E 6PD, United Kingdom Trading address: Cody Technology Park, Cody Building, Ively Road, Farnborough, Hampshire, GU14 0LX, United Kingdom http://www.QinetiQ.com/home/legal.html |
From: Gert I. <ger...@ph...> - 2008-06-04 10:46:42
|
Hi Ian, On Wed, Jun 04, 2008 at 11:33:13AM +0100, Renton Ian wrote: > > If the produced output is ok, > > you can just ignore the warning. > > Unfortunately not - while I don't mind seeing the warnings myself, the if you are really happy with the way the text is typeset, you can switch off the warnings by convincing TeX that you are happy (TeX gives you warnings because it does not believe that you will be satisfied). Just include \hbadness=10000 into your TeX code. This instructs TeX to also accept really bad lines. But, as I said before, playing around with raggedright and alike probably is a better way to get what you really want. Best regards, Gert -- Gert-Ludwig Ingold email: Gert.Ingold@Physik.Uni-Augsburg.DE Institut für Physik Phone: +49-821-598-3234 Universität Augsburg Fax : +49-821-598-3222 D-86135 Augsburg WWW : www.physik.uni-augsburg.de/theo1/ingold Germany PGP : 86FF5A93, key available from homepage |
From: Axel F. <fre...@us...> - 2008-06-04 10:49:50
|
Hi Ian, On Wed, Jun 4, 2008 at 12:33 PM, Renton Ian <IR...@qi...> wrote: > > If the produced output is ok, > > you can just ignore the warning. > > Unfortunately not - while I don't mind seeing the warnings myself, the > app is going to be built using py2exe, which seems to produce an "Error > has occurred" dialog box after termination if there are warnings as well > as if there are errors. I'd prefer not to change py2exe's behaviour (if > that's possible) as I don't mind being warned about other things - it's > just this one that I know about and so don't want to be reminded of! > It is possible to remove the warning. In PyX, this is done by the use of message parser (see chap. 3.5 in the manual). For your case, a parser like underfull_parser= text.texmessagepattern(re.compile(r"^ignoring overfull/underfull box warning:\nUnderfull \hbox (badness 10000) detected at line .*$",.re.MULTILINE)) should work (I didn't test it, may be / probably you have to correct the regular expression) To activate the parser, you have to add it to the texrunner you are using. For the default texrunner, text.set(texmessagesend=[underfull_parser]) should do it. HTH, Axel |
From: André W. <wo...@us...> - 2008-06-04 11:15:53
|
Hi Ian, I already have seen the answers from Gert and Axel regarding your problem. They are both pointing towards a reasonable solution to either remove the warning from the TeX output (Gerts solution using \hbadness) within TeX itself or using PyX message parsers (Axels suggestion). However I would really like to understand why this warning message occurs at all in the very beginning -- and address this problem. I guess you are using code like posted by Stefan earlier in this thread using \linebreak. This works in terms of telling TeX to *favor* line breaks at certain possitions, but it will not create line breaks directly (so the name of the command is a bit misleading): \linebreak \linebreak[number] The \linebreak command tells LaTeX to break the current line at the point of the command. With the optional argument, number, you can convert the \linebreak command from a demand to a request. The number must be a number from 0 to 4. The higher the number, the more insistent the request is. The \linebreak command causes LaTeX to stretch the line so it extends to the right margin. I strongly suggest to use \par to create separate paragraphs in TeX instead of twiddling arount with linebreaks, \\ and other in-paragraph- line-breaking solutions. This will remove the underful hbox messages along the way ... HTH, André Am 04.06.2008 um 12:33 schrieb Renton Ian: >> If the produced output is ok, >> you can just ignore the warning. > > Unfortunately not - while I don't mind seeing the warnings myself, the > app is going to be built using py2exe, which seems to produce an > "Error > has occurred" dialog box after termination if there are warnings as > well > as if there are errors. I'd prefer not to change py2exe's behaviour > (if > that's possible) as I don't mind being warned about other things - > it's > just this one that I know about and so don't want to be reminded of! > > Thanks, > > Ian > The information contained in this E-Mail and any subsequent > correspondence is private and is intended solely for the intended > recipient(s). The information in this communication may be > confidential and/or legally privileged. Nothing in this e-mail is > intended to conclude a contract on behalf of QinetiQ or make QinetiQ > subject to any other legally binding commitments, unless the e-mail > contains an express statement to the contrary or incorporates a > formal Purchase Order. > > For those other than the recipient any disclosure, copying, > distribution, or any action taken or omitted to be taken in reliance > on such information is prohibited and may be unlawful. > > Emails and other electronic communication with QinetiQ may be > monitored and recorded for business purposes including security, audit > and archival purposes. Any response to this email indicates consent > to this. > > Telephone calls to QinetiQ may be monitored or recorded for quality > control, security and other business purposes. > > QinetiQ Limited > Registered in England & Wales: Company Number:3796233 > Registered office: 85 Buckingham Gate, London SW1E 6PD, United Kingdom > Trading address: Cody Technology Park, Cody Building, Ively Road, > Farnborough, Hampshire, GU14 0LX, United Kingdom > http://www.QinetiQ.com/home/legal.html > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > PyX-user mailing list > PyX...@li... > https://lists.sourceforge.net/lists/listinfo/pyx-user > -- by _ _ _ Dr. André Wobst, Amselweg 22, 85716 Unterschleißheim / \ \ / ) wo...@us..., http://www.wobsta.de/ / _ \ \/\/ / PyX - High quality PostScript and PDF figures (_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/ |