[ pdftex-Bugs-359 ] pdftex generates errors when it does not have to - eg \pdfinfo
Bugs item #359, was opened at 2005-05-30 19:51 You can respond by visiting: http://sarovar.org/tracker/?func=detail&atid=493&aid=359&group_id=106 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Taco Hoekwater (taco) Assigned to: Nobody (None) Summary: pdftex generates errors when it does not have to - eg \pdfinfo Initial Comment: The following submitted on behalf of Jonathan Fine: pdftex generates errors when it does not have to. This fault prevents the build of Python docs on some platforms. The fix may be to remove the error-generating code· For more details, see my posting to comp.text.tex. Google link: http://groups-beta.google.com/group/comp.text.tex/msg/4b4842202ce88cda?hl=en Copy and paste ============== There is, in my opinion, a problem with pdftex. (This is not to say that the macros used could not be improved.) pdftex exits on \pdfinfo error. TeX does not exit on error. == $ pdftex This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) **\pdfoutput 0 {/usr/share/texmf/pdftex/config/pdftex.cfg} *\pdfinfo pdfTeX error (ext1): \pdfinfo used while \pdfoutput is not set. <*> \pdfinfo No pages of output. Transcript written on texput.log. == The present semantics of \pdfinfo are confused. For example, I _can_ use \pdfinfo and generate dvi! I just have to be a bit sneaky. == $ pdftex This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5) **\pdfoutput 1 {/usr/share/texmf/pdftex/config/pdftex.cfg} *\pdfinfo {} *\pdfoutput 0 *\shipout\hbox{} [1] *\end Output written on texput.dvi (1 page, 128 bytes). == Here, if pdf is not being generated, pdfinfo is ignored. Suppose the semantics of \pdfinfo were something like: \pdfinfo{ ... } Stores information that is written to the PDF file, if pdftex generates a PDF file. Otherwise ignored. Then the error that prompted this thread would not have occurred. -- ----------------------------------------------------------------------
Comment By: Taco Hoekwater (taco) Date: 2005-05-30 20:05
Message: Logged In: YES user_id=1608 Relevant bit of code: procedure check_pdfoutput(s: str_number); begin if pdf_output <= 0 then begin print_nl("pdfTeX error (ext1): "); print(s); print(" used while \pdfoutput is not set"); succumb; end; end The fastest resolution, of course, is to change the test to "pdf_output < 0" so that the error is also generated in dvi processing mode. But Jonathan's proposal is also valid, at least for mode-independant commands like \pdfinfo. Or maybe generate a normal TeX error message? ---------------------------------------------------------------------- You can respond by visiting: http://sarovar.org/tracker/?func=detail&atid=493&aid=359&group_id=106
noreply@sarovar.org wrote:
The fastest resolution, of course, is to change the test to "pdf_output < 0" so that the error is also generated in dvi processing mode.
Sorry, I was being silly again. This remark is plain nonsense. I promise I will take a holiday soon. No, really. :-/ Taco
On Mon, May 30, 2005 at 11:35:54PM +0530, noreply@sarovar.org wrote:
Suppose the semantics of \pdfinfo were something like: \pdfinfo{ ... } Stores information that is written to the PDF file, if pdftex generates a PDF file. Otherwise ignored.
Then the error that prompted this thread would not have occurred.
sounds like a good solution. It will fixed in next release. Thanh
On 2005-05-31 15:43:00 +0700, The Thanh Han wrote:
On Mon, May 30, 2005 at 11:35:54PM +0530, noreply@sarovar.org wrote:
Suppose the semantics of \pdfinfo were something like: \pdfinfo{ ... } Stores information that is written to the PDF file, if pdftex generates a PDF file. Otherwise ignored.
Then the error that prompted this thread would not have occurred.
sounds like a good solution. It will fixed in next release.
It isn't now. Can all \pdf primitives be ignored in dvi-mode? Currently we have check_pdfoutput("\pdfannot"); check_pdfoutput("\pdfcatalog"); check_pdfoutput("\pdfdest"); check_pdfoutput("\pdfendlink"); check_pdfoutput("\pdfendthread"); check_pdfoutput("\pdffontattr"); check_pdfoutput("\pdfincludechars"); check_pdfoutput("\pdfliteral"); check_pdfoutput("\pdfmapfile"); check_pdfoutput("\pdfmapline"); check_pdfoutput("\pdfnames"); check_pdfoutput("\pdfobj"); check_pdfoutput("\pdfoutline"); check_pdfoutput("\pdfrefobj"); check_pdfoutput("\pdfrefxform"); check_pdfoutput("\pdfrefximage"); check_pdfoutput("\pdfsavepos"); check_pdfoutput("\pdfstartlink"); check_pdfoutput("\pdfstartthread"); check_pdfoutput("\pdfthread"); check_pdfoutput("\pdftrailer"); check_pdfoutput("\pdfxform"); check_pdfoutput("\pdfximage"); \pdfinfo and \pdfcatalog are the simple cases. :-) Best Martin -- http://www.tm.oneiros.de
On 2005-06-16 15:04:39 +0200, Martin Schröder wrote:
It isn't now. Can all \pdf primitives be ignored in dvi-mode?
I have changed check_pdfoutput to ---------------------- procedure check_pdfoutput(s: str_number; is_error : boolean); begin if pdf_output <= 0 then if is_error then pdf_error(s, "used while \pdfoutput is not set") else pdf_warning(s, "used while \pdfoutput is not set", true); end; ---------------------- And changed the calls for \pdfinfo, \pdfcatalog and \pdftrailer to is_error=false. This gives ! pdfTeX warning (\pdfinfo): used while \pdfoutput is not set and ! pdfTeX error (\pdfincludechars): used while \pdfoutput is not set. l.120 \pdfincludechars \font{ABCDEF} Of course this can lead to confusing situations: ---------------------- \pdfoutput=0 \pdfinfo{/Foo (Bar) \pdfoutput=1 foo \bye ---------------------- will have /Foo (Bar) in the info dict. But we don't say that we are _ignoring_ the data; and doing so would be more difficult. Comments? Best Martin -- http://www.tm.oneiros.de
On 2005-07-15 19:39:54 +0200, Martin Schröder wrote:
will have /Foo (Bar) in the info dict. But we don't say that we are _ignoring_ the data; and doing so would be more difficult.
Turns out it isn't so difficult. ---------------- \pdfoutput=0 \pdfinfo{/Test (Foo)} \pdfoutput=1 \pdfinfo{/Test1 (Bar)} Test \bye ---------------- Now gives ----------------
etex 359.tex This is pdfeTeX, Version 3.141592-1.30.0-rc4-2.2 (Web2C 7.5.5) entering extended mode (./359.tex ! pdfTeX warning (\pdfinfo): used while \pdfoutput is not set; ignoring it [1{/home/ms/.texmf-var/fonts/map/pdftex/updmap/pdftex.map}] ) Output written on 359.pdf (1 page, 4829 bytes). Transcript written on 359.log.
359.pdf has /Test1 (Bar) in the info dict. I've done the same for \pdfcatalog and \pdftrailer. Best Martin -- http://www.tm.oneiros.de
participants (4)
-
Martin Schröder
-
noreply@sarovar.org
-
Taco Hoekwater
-
The Thanh Han