How to format the name of an R package in thesis?

2,987

You can do this by adding the following to your preamble. Something like this:

\newcommand{\pkg}[1]{{\normalfont\fontseries{b}\selectfont #1}} \let\proglang=\textsf \let\code=\texttt

\begin{document}

Then you can refer to R as \proglang{R}, to a package \pkg{packagename}, and to a function as \code{functionname}.

\end{document}

Share:
2,987

Related videos on Youtube

Patty
Author by

Patty

Updated on August 01, 2022

Comments

  • Patty
    Patty over 1 year

    In a thesis, when referring to an R package (a statistical software), how should I write it?

    Should it be italicized/treated like a title?

    Or just like any other word. The package name is not a "normal word" so it seems out of place to just write it like

    "...using the R package XYZ."

    • Massimo Ortolano
      Massimo Ortolano almost 6 years
      Why not using the convention employed in the R documentation (package names are typeset with a bold font)?
    • Bluebird
      Bluebird almost 6 years
      Also remember to include what version of R and package you used.
    • allo
      allo almost 6 years
      You may be overthinking this. I think the text version is okay. You may or may not emphasise the package name but the reader will get that it is a R package from the sentence, so the rest is a question how you like it better yourself.
  • ff524
    ff524 almost 6 years
    The question isn't about how to cite the package, it's about how to format the name of the package when referring to it in text. e.g.: "We use the foo package to parse the data and..."
  • Azor Ahai -him-
    Azor Ahai -him- almost 3 years
    The OP didn't mention they were working in LATEX.
  • Smith Pay
    Smith Pay almost 3 years
    @AzorAhai-him- That is correct! I just assumed OP is writing a thesis and using R; therefore, in the science field, where most of the thesis is written in Latex!
  • Admin
    Admin almost 3 years
    Biologists still write papers by emailing each other word documents. The really clever ones might be on Google docs now.
  • Azor Ahai -him-
    Azor Ahai -him- almost 3 years
    @AhmadTalafha I don't think you can say most of the sciences use LaTeX - most of math, maybe.
  • Smith Pay
    Smith Pay almost 3 years
    @AzorAhai-him- While it is true, check out this post tex.stackexchange.com/questions/940/…
  • Smith Pay
    Smith Pay almost 3 years
    @Libor Google Docs is great! For Latex, check out Overleaf, it is a collaborative cloud-based LaTeX editor used for writing, editing and publishing scientific documents.
  • Azor Ahai -him-
    Azor Ahai -him- almost 3 years
    @AhmadTalafha Sure, but there's a lot more to science than math, physics, and linguistics ;)