7

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{}?

  • 1
    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.) – jon Jan 28 '14 at 18:38
  • 9
    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. – Thorsten Donig Jan 28 '14 at 18:55
  • 1
    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.) – barbara beeton Jan 28 '14 at 19:47
  • @jon I'm writing a report for my undergrad degree, bioinformatics to be precise. – Ben Jan 28 '14 at 20:36
  • 1
    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... – vonbrand Feb 1 '14 at 0:34

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.