Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
When referring to programming packages/libraries (such as matplotlib for example) within a LaTeX document should one typeset it to denote it as a package/library name? Such as using \texttt{}?
What kind of document are you writing? In package documentation, package names are sometimes set in a fancy way, sometimes not (and what is even more important that the visual appearance in such a case is a reference/link to where one might find the package). In other documents, I suspect it is even less common to use odd colours and/or fonts, let alone even a need to mention it; and, again, if the package simply must be mentioned, wouldn't the most important bit be the reference/link? (Exceptions abound, of course.)
In every case you should not use \texttt directly but better define a command like \newcommand{\pkg}[1]{\texttt{#1}} or \newcommand{\lib}[1]{\texttt{#1}} in the preamble of your document. Then you only need to modify one line to affect the formatting for the whole document.
in tugboat, the names of packages are sometimes set in \textsf to distinguish them from actual code, which is generally \texttt or verbatim. (and do define an appropriate command as suggested by thorsten, so they will be treated the same, and if you change your mind, it will be easy to change the style.)
For some reason that I don't know, naming software packages and codes with \textsc{...} (small capitals) seems to be very elegant. I guess it is because it is like all caps (as many packages where traditionally named) and the same time it is not very disruptive of the text; yet is flexible enough to follow special small and capital conventions.
If you look at the books on computer stuff by O'Reilly, they all start with a short statement of the typographical conventions they use (for files, stuff that goes verbatim, values the user has to supply, ...). You could adapt their conventions, or filch one somewhere else...
\texttt
directly but better define a command like\newcommand{\pkg}[1]{\texttt{#1}}
or\newcommand{\lib}[1]{\texttt{#1}}
in the preamble of your document. Then you only need to modify one line to affect the formatting for the whole document.\textsf
to distinguish them from actual code, which is generally\texttt
orverbatim
. (and do define an appropriate command as suggested by thorsten, so they will be treated the same, and if you change your mind, it will be easy to change the style.)\textsc{...}
(small capitals) seems to be very elegant. I guess it is because it is like all caps (as many packages where traditionally named) and the same time it is not very disruptive of the text; yet is flexible enough to follow special small and capital conventions.