[NTG-context] Making ConTeXt stop on all or some errors

Jan U. Hasecke juh+ntg-context at mailbox.org
Tue Feb 5 08:07:17 CET 2019


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


More information about the ntg-context mailing list