1

Consider the following MWE:

\documentclass{article}

\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
   \coordinate (A) at (0,0);
   \coordinate (B) at (1,0);
   \coordinate (C) at ($(A)!.5!(B)$);
\end{tikzpicture}
\end{document}

This will, obviously, lead to

./tikz.tex:11: Package tikz Error: You need to say \usetikzlibrary{calc} for
                                   coordinate calculation.

As TikZ already knows that I am missing that one library, what is the advantage of giving this error rather than doing an implicit \usetikzlibrary{calc} and saying

Package tikz Warning: Automatically imported calc library as you are using
                      coordinate calculation. Please consider putting 
                      \usetikzlibrary{calc} in your preamble.

This is just one example, I have seen other similar error messages, also with other packages. (Just to make it clear: The aim of the question is not to criticise Till Tantau who did a tremendous job in writing TikZ. It is about understanding the reasons for a common practice among programmers and package authors.)

I can imagine one reason: If you only give a warning, some (most?) people might miss it or just don't care, as they actually get what they wanted even without correcting their input.

  • 1
    Sometimes, the problem comes not from a missing package and need a human intervention. – Jérôme Dequeker Oct 12 '16 at 12:19
  • 5
    I haven't looked in detail at the sources here but it would be very surprising if what you ask for were possible. Tex is a macro expansion language, by the time that you discover that something is wrong the possibilities for correcting anything are very limited. Certainly if you discover mid way through an arithmetic calculation that some package should have been loaded in the preamble of the document, there is not much you can do except stop. – David Carlisle Oct 12 '16 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.