Humorous or famous dictum as motto for a scientific text - is it appropriate? Every once in a while I stumble upon a scientific book or article with a «motto», that is, a brief aphorism or short humorous stanza at the beginning, usually separated by its layout from the body of the text. In a book, this can also be in front of each chapter.

But is it generally considered appropriate for scientific texts or rather not advisable? In particular, does it come across as pretentious (aphorism) or frivolous (humor)? Clearly, I am unsure how to evaluate it.
In a thesis the appropriateness depends on the style guide of the university in question.  This should be posted somewhere (probably on the university library or graduate school website).  When I wrote my dissertation, such a thing was allowed.  I did not use one, but I knew people who did.

For an article published in a journal, it would depend on their style standards.  You should be able to ask an editor if it is allowed.