Making ConTeXt stop on all or some errors
Hi all, yesterday I asked about where to put color profiles. My problem was that ConTeXt for some unknown reason didn't find the color profiles I downloaded. But most annoying was the fact that I didn't saw the error in the log because ConTeXt only complains about not finding the profile. Is there a way to make ConTeXt stop if it does not find the profile like it stops if I use a unknown command? I want to avoid that we send a pdf without a profile to the print shop, because we overlook a message in the logs. juh
On 2/4/19 7:30 AM, Jan U. Hasecke wrote:
Hi all,
yesterday I asked about where to put color profiles.
My problem was that ConTeXt for some unknown reason didn't find the color profiles I downloaded. But most annoying was the fact that I didn't saw the error in the log because ConTeXt only complains about not finding the profile.
Is there a way to make ConTeXt stop if it does not find the profile like it stops if I use a unknown command?
I want to avoid that we send a pdf without a profile to the print shop, because we overlook a message in the logs.
Hi Jan Ulrich, maybe testing if the file is there may work for you. Here is a sample: \starttext \doiffileelse{srgb.icc}{fine now}{\red\ss\bfd HUGE MISTAKE} \doiffileelse{srgb.icca}{fine now}{\red\ss\bfd HUGE MISTAKE} \stoptext The first profile is provided within the ConTeXt Suite, the second one is a wrong file name. Just in case it might help, Pablo -- http://www.ousia.tk
Hola Pablo, Am 04.02.19 um 18:42 schrieb Pablo Rodriguez:
On 2/4/19 7:30 AM, Jan U. Hasecke wrote:
Hi all,
yesterday I asked about where to put color profiles.
My problem was that ConTeXt for some unknown reason didn't find the color profiles I downloaded. But most annoying was the fact that I didn't saw the error in the log because ConTeXt only complains about not finding the profile.
Is there a way to make ConTeXt stop if it does not find the profile like it stops if I use a unknown command?
I want to avoid that we send a pdf without a profile to the print shop, because we overlook a message in the logs.
Hi Jan Ulrich,
maybe testing if the file is there may work for you.
Here is a sample:
\starttext \doiffileelse{srgb.icc}{fine now}{\red\ss\bfd HUGE MISTAKE}
\doiffileelse{srgb.icca}{fine now}{\red\ss\bfd HUGE MISTAKE} \stoptext
The first profile is provided within the ConTeXt Suite, the second one is a wrong file name.
Just in case it might help,
I inserted this in the setupbackend command so that ConTeXt stops with the unknown command \colorprofilenotfound I inserted in the else clause. But more and more I think that ConTeXt should fail if it does not find the color profile, because if you forget to study the log file before sending the pdf to the print shop you can loose a lot of money. And as we use ConTeXt in a group where people have different ConTeXt knowledge the generation should be bullet proofed. The behaviour of ConTeXt is AFAICS the following. If you install icc-profiles in texmf-context they get lost during the next update of ConTeXt. But ConTeXt will not stop the complilation only warning that there is no profile file. ConTeXt only stops to compile if you delete a profile which was present during installation/update or which was present during a "mtxrun --generate" (Thanks to Mojca for this hint). Then the file is registered and ConTeXt wants to access it, failing if it is not there. If you install profiles in texmf-local and then do a "mtxrun --generate" you are quite safe as long as you do not install ConTeXt from scratch. If you want to compile a ConTeXt project on an other computer you have to study the log file to see that it does not find a color profile. And this is dangerous, because noone expects this to be a problem. I think ConTeXt should fail and stop if the profile is not there. There is the switch --errors=list which might be of some use here, but I could not find documentation, so I don't know how to call ConTeXt and make it fail if the error occurs. Thanks for the hint, which I use as a workaround. juh
On 2/5/19 8:07 AM, Jan U. Hasecke wrote:
Hola Pablo,
Hallo Jan-Ulrich,
I inserted this in the setupbackend command so that ConTeXt stops with the unknown command \colorprofilenotfound I inserted in the else clause.
But more and more I think that ConTeXt should fail if it does not find the color profile, because if you forget to study the log file before sending the pdf to the print shop you can loose a lot of money.
But the scenarios in which you could loose a lot of money are many more than you might think. Imagine the following: \startbuffer A Greek sentence: χαλεπὰ τὰ καλά \stopbuffer \definefallbackfamily[mainface][rm][GFS Didoto] [preset=range:greek] \definefontfamily[mainface][rm][Latin Modern Roman] \definefallbackfamily[amainface][rm][GFS Didot] [preset=range:greek] \definefontfamily[amainface][rm][TeX Gyre Pagella] \definefallbackfamily[smainface][rm][GFS Didot] [preset=range:greek, force=yes] \definefontfamily[smainface][rm][TeX Gyre Pagella] \setupbodyfont[mainface] \starttext \startTEXpage[offset=2em] \getbuffer\\ \amainface\getbuffer\\ \smainface\getbuffer \stopTEXpage \stoptext Not embedding all glyphs for the fallback font (failing to type "force=yes") could lead to weird results. Not to mention when a font isn’t embedded at all.
And as we use ConTeXt in a group where people have different ConTeXt knowledge the generation should be bullet proofed.
I totally agree with that. But it mainly relies on how source documents are written. ConTeXt cannot type the source for us.
The behaviour of ConTeXt is AFAICS the following. If you install icc-profiles in texmf-context they get lost during the next update of ConTeXt. But ConTeXt will not stop the complilation only warning that there is no profile file.
ConTeXt only stops to compile if you delete a profile which was present during installation/update or which was present during a "mtxrun --generate" (Thanks to Mojca for this hint). Then the file is registered and ConTeXt wants to access it, failing if it is not there.
If you install profiles in texmf-local and then do a "mtxrun --generate" you are quite safe as long as you do not install ConTeXt from scratch.
No computer can read your mind. Or a brand-new installation cannot guess whether you are up to some auxiliary files (name them color profiles, fonts, or whatever you want).
If you want to compile a ConTeXt project on an other computer you have to study the log file to see that it does not find a color profile. And this is dangerous, because none expects this to be a problem. I think ConTeXt should fail and stop if the profile is not there.
But checking if the file exists is a safe way to know whehter it can be embedded in the output PDF document. Another scenario would be attaching files to a PDF document using the \attachment command. I have done it myself. With some of my documents, I had to attach a variable number of extra documents to the final PDF. The only way to secure the attachment was \doiffileelse{file.pdf}{\attach[file.pdf]}{\ssbf\color[red]{missing attachment}}. Just in case it helps, Pablo -- http://www.ousia.tk
Am 06.02.19 um 19:31 schrieb Pablo Rodriguez:
On 2/5/19 8:07 AM, Jan U. Hasecke wrote:
Hola Pablo,
Hallo Jan-Ulrich,
I inserted this in the setupbackend command so that ConTeXt stops with the unknown command \colorprofilenotfound I inserted in the else clause.
But more and more I think that ConTeXt should fail if it does not find the color profile, because if you forget to study the log file before sending the pdf to the print shop you can loose a lot of money.
But the scenarios in which you could loose a lot of money are many more than you might think.
Imagine the following:
\startbuffer A Greek sentence: χαλεπὰ τὰ καλά \stopbuffer \definefallbackfamily[mainface][rm][GFS Didoto] [preset=range:greek] \definefontfamily[mainface][rm][Latin Modern Roman] \definefallbackfamily[amainface][rm][GFS Didot] [preset=range:greek] \definefontfamily[amainface][rm][TeX Gyre Pagella] \definefallbackfamily[smainface][rm][GFS Didot] [preset=range:greek, force=yes] \definefontfamily[smainface][rm][TeX Gyre Pagella] \setupbodyfont[mainface] \starttext \startTEXpage[offset=2em] \getbuffer\\ \amainface\getbuffer\\ \smainface\getbuffer \stopTEXpage \stoptext
Not embedding all glyphs for the fallback font (failing to type "force=yes") could lead to weird results. Not to mention when a font isn’t embedded at all.
And as we use ConTeXt in a group where people have different ConTeXt knowledge the generation should be bullet proofed.
I totally agree with that. But it mainly relies on how source documents are written. ConTeXt cannot type the source for us.
The behaviour of ConTeXt is AFAICS the following. If you install icc-profiles in texmf-context they get lost during the next update of ConTeXt. But ConTeXt will not stop the complilation only warning that there is no profile file.
ConTeXt only stops to compile if you delete a profile which was present during installation/update or which was present during a "mtxrun --generate" (Thanks to Mojca for this hint). Then the file is registered and ConTeXt wants to access it, failing if it is not there.
If you install profiles in texmf-local and then do a "mtxrun --generate" you are quite safe as long as you do not install ConTeXt from scratch.
No computer can read your mind. Or a brand-new installation cannot guess whether you are up to some auxiliary files (name them color profiles, fonts, or whatever you want).
If you want to compile a ConTeXt project on an other computer you have to study the log file to see that it does not find a color profile. And this is dangerous, because none expects this to be a problem. I think ConTeXt should fail and stop if the profile is not there.
But checking if the file exists is a safe way to know whehter it can be embedded in the output PDF document.
Another scenario would be attaching files to a PDF document using the \attachment command. I have done it myself.
With some of my documents, I had to attach a variable number of extra documents to the final PDF. The only way to secure the attachment was \doiffileelse{file.pdf}{\attach[file.pdf]}{\ssbf\color[red]{missing attachment}}.
Just in case it helps,
Yes, your solution helps and I use it for now. But I am still looking for a switch to have a nitpickier runlevel of ConTeXt. From the documentation suite Sphinx I know such a switch which turns warnings into errors (causing Sphinx to stop) and vice versa. At least a missing file should make ConTeXt stop immediately. juh
On Thu, 7 Feb 2019 07:27:57 +0100 (UTC)
"Jan U. Hasecke"
At least a missing file should make ConTeXt stop immediately.
Why? (I often process with missing figures, etc. Of course, not for a final run, but adding showstoppers leads to overhead and longer processing times. People first coming to ConTeXt look for such bells and whistles as many other programs hold your hand in this way. This also explains why these programs often lack in performance as well.) Alan
Am 07.02.19 um 17:46 schrieb Alan Braslau:
On Thu, 7 Feb 2019 07:27:57 +0100 (UTC) "Jan U. Hasecke"
wrote: At least a missing file should make ConTeXt stop immediately.
Why?
(I often process with missing figures, etc. Of course, not for a final run, but adding showstoppers leads to overhead and longer processing times. People first coming to ConTeXt look for such bells and whistles as many other programs hold your hand in this way. This also explains why these programs often lack in performance as well.)
Alan
You see placeholders in the pdf, if a figure is missing. The only info that the color profile is missing is in the log file. You don't see it. juh
On Thu, 7 Feb 2019 19:03:35 +0100
"Jan U. Hasecke"
Am 07.02.19 um 17:46 schrieb Alan Braslau:
On Thu, 7 Feb 2019 07:27:57 +0100 (UTC) "Jan U. Hasecke"
wrote: At least a missing file should make ConTeXt stop immediately.
Why?
(I often process with missing figures, etc. Of course, not for a final run, but adding showstoppers leads to overhead and longer processing times. People first coming to ConTeXt look for such bells and whistles as many other programs hold your hand in this way. This also explains why these programs often lack in performance as well.)
Alan
You see placeholders in the pdf, if a figure is missing. The only info that the color profile is missing is in the log file. You don't see it.
juh
That was just an example. You are free to write a macro to include color profile files that tests and puts a placeholder or stops processing. The point is that ConTeXt, by design, does not come with bells and whistles, and most mistakes are either silently ignored or flagged in the log file. Anyone making production products to be sent to the printer ought to look at the log files before sending. Alan
On 2/7/2019 7:03 PM, Jan U. Hasecke wrote:
Am 07.02.19 um 17:46 schrieb Alan Braslau:
On Thu, 7 Feb 2019 07:27:57 +0100 (UTC) "Jan U. Hasecke"
wrote: At least a missing file should make ConTeXt stop immediately.
Why?
(I often process with missing figures, etc. Of course, not for a final run, but adding showstoppers leads to overhead and longer processing times. People first coming to ConTeXt look for such bells and whistles as many other programs hold your hand in this way. This also explains why these programs often lack in performance as well.)
Alan
You see placeholders in the pdf, if a figure is missing. The only info that the color profile is missing is in the log file. You don't see it. i assume that you choose some specific pdf reerence format
anyway, \enabletrackers[backend.format] can spit out some details ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 2/6/2019 7:31 PM, Pablo Rodriguez wrote:
On 2/5/19 8:07 AM, Jan U. Hasecke wrote:
Hola Pablo,
Hallo Jan-Ulrich,
I inserted this in the setupbackend command so that ConTeXt stops with the unknown command \colorprofilenotfound I inserted in the else clause.
But more and more I think that ConTeXt should fail if it does not find the color profile, because if you forget to study the log file before sending the pdf to the print shop you can loose a lot of money.
But the scenarios in which you could loose a lot of money are many more than you might think.
Imagine the following:
\startbuffer A Greek sentence: χαλεπὰ τὰ καλά \stopbuffer \definefallbackfamily[mainface][rm][GFS Didoto] [preset=range:greek] \definefontfamily[mainface][rm][Latin Modern Roman] \definefallbackfamily[amainface][rm][GFS Didot] [preset=range:greek] \definefontfamily[amainface][rm][TeX Gyre Pagella] \definefallbackfamily[smainface][rm][GFS Didot] [preset=range:greek, force=yes] \definefontfamily[smainface][rm][TeX Gyre Pagella] \setupbodyfont[mainface] \starttext \startTEXpage[offset=2em] \getbuffer\\ \amainface\getbuffer\\ \smainface\getbuffer \stopTEXpage \stoptext
Not embedding all glyphs for the fallback font (failing to type "force=yes") could lead to weird results. Not to mention when a font isn’t embedded at all.
there are severwl trackers for missing characters, including highlighting them .. anyway, there's also \enabledirectives[logs.errors] \starttext test \char 999 \stoptext that gives a summary. But turning on every possible checking option by default is not going to happen because it adds overhead to (in our cases) normal runs.
And as we use ConTeXt in a group where people have different ConTeXt knowledge the generation should be bullet proofed.
I totally agree with that. But it mainly relies on how source documents are written. ConTeXt cannot type the source for us.
Indeed, and if something is critital proofreading should happen. (Hyohenations can be wrong, there can be overflows, figures could to places one does not want, fonts can have bugges features and of course there can be typos)
The behaviour of ConTeXt is AFAICS the following. If you install icc-profiles in texmf-context they get lost during the next update of ConTeXt. But ConTeXt will not stop the complilation only warning that there is no profile file.
ConTeXt only stops to compile if you delete a profile which was present during installation/update or which was present during a "mtxrun --generate" (Thanks to Mojca for this hint). Then the file is registered and ConTeXt wants to access it, failing if it is not there.
If you install profiles in texmf-local and then do a "mtxrun --generate" you are quite safe as long as you do not install ConTeXt from scratch.
No computer can read your mind. Or a brand-new installation cannot guess whether you are up to some auxiliary files (name them color profiles, fonts, or whatever you want).
I can add an optional log section for the backend but not now, maybe later this year.
If you want to compile a ConTeXt project on an other computer you have to study the log file to see that it does not find a color profile. And this is dangerous, because none expects this to be a problem. I think ConTeXt should fail and stop if the profile is not there.
But checking if the file exists is a safe way to know whehter it can be embedded in the output PDF document.
Not all missing files are problems, at least not here.
Another scenario would be attaching files to a PDF document using the \attachment command. I have done it myself.
With some of my documents, I had to attach a variable number of extra documents to the final PDF. The only way to secure the attachment was \doiffileelse{file.pdf}{\attach[file.pdf]}{\ssbf\color[red]{missing attachment}}. in practice profiles are a mess anyway .. i might cook up a solution more tightly bound to specific images some day (but i don't need that myself right now)
Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (4)
-
Alan Braslau
-
Hans Hagen
-
Jan U. Hasecke
-
Pablo Rodriguez