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

Hans Hagen j.hagen at xs4all.nl
Thu Feb 7 09:26:07 CET 2019


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
-----------------------------------------------------------------


More information about the ntg-context mailing list