tgs77m m@iii@g oii y@hoo@com
2025-Nov-21 06:51 UTC
[R] Best practice for copying statistical output from RStudio to Word using Times New Roman
Colleagues I am writing an article using Microsoft Word for a journal that requires Times New Roman for all text (including tables and statistical outputs). However, copying console output from RStudio (e.g., summary(lm())) into Word retains the RStudio monospace font, and Word does not automatically convert it to Times New Roman. Manually restyling each pasted block is time-consuming and error-prone. s there a recommended workflow for preserving proper alignment while achieving Times New Roman text formatting when transferring statistical results from RStudio into Word? System: Windows 11 R 4.5.1 RStudio 2024.12.0+ Thanks for any guidance or best practices. Best regards, Thomas Subia
Viechtbauer, Wolfgang (NP)
2025-Nov-21 10:27 UTC
[R] Best practice for copying statistical output from RStudio to Word using Times New Roman
Dear Thomas, Just paste without formatting. Then the pasted text will be in the active font of the Word document. Best, Wolfgang> -----Original Message----- > From: R-help <r-help-bounces at r-project.org> On Behalf Of tgs77m--- via R-help > Sent: Friday, November 21, 2025 07:51 > To: r-help at r-project.org > Subject: [R] Best practice for copying statistical output from RStudio to Word > using Times New Roman > > Colleagues > > I am writing an article using Microsoft Word for a journal that requires > Times New Roman for all text (including tables and statistical outputs). > However, copying console output from RStudio (e.g., summary(lm())) into Word > retains the RStudio monospace font, and Word does not automatically convert > it to Times New Roman. Manually restyling each pasted block is > time-consuming and error-prone. > > s there a recommended workflow for preserving proper alignment while > achieving Times New Roman text formatting when transferring statistical > results from RStudio into Word? > > System: > Windows 11 > R 4.5.1 > RStudio 2024.12.0+ > > Thanks for any guidance or best practices. > > Best regards, > Thomas Subia
Andrew Hart
2025-Nov-21 14:43 UTC
[R] Best practice for copying statistical output from RStudio to Word using Times New Roman
This question has already been answered, but I thought I would share
something related to it that others may find useful. What if you want
the font used in figures and graphs to be Times New Roman? I don't know
if this is considered best ppractice, but I discovered you can get all
the text on figures and plots in R's standard graphics system to be
Times New Roman by doing the following. This only works on Windows.
Use WindowsFonts()
to get a list of the windows fonts available to R on the windows system.
The serif font is likely to be Times New Roman. Take a note of its name
in the output from windowsFonts().
For example, on my system it is "TT Times New Roman".
Then include the following code before performing any plotting.
windowsFonts(tnr=windowsFont("TT Times New Roman"))
This sets up tnr as a font family name that refers to Times New Roman.
You don't have to use tnr; that's just the name I chose.
Then, before plotting, set graphics parameter family="tnr". This can
either be done with par or in the function call that opens the graphics
device. For example,
png("figure.png", width=15.5, height=17.5, units="cm",
res=72)
par(family="tnr")
...
dev.off()
or
?png("figure.png", width=15.5, height=17.5, units="cm",
res=72,
family="tnr")
...
dev.off()
Hth,
Andrew.
On 21/11/2025 3:51, tgs77m--- via R-help wrote:> Colleagues
>
> I am writing an article using Microsoft Word for a journal that requires
> Times New Roman for all text (including tables and statistical outputs).
> However, copying console output from RStudio (e.g., summary(lm())) into
Word
> retains the RStudio monospace font, and Word does not automatically convert
> it to Times New Roman. Manually restyling each pasted block is
> time-consuming and error-prone.
>
> s there a recommended workflow for preserving proper alignment while
> achieving Times New Roman text formatting when transferring statistical
> results from RStudio into Word?
>
> System:
> Windows 11
> R 4.5.1
> RStudio 2024.12.0+
>
> Thanks for any guidance or best practices.
>
> Best regards,
> Thomas Subia
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
https://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
This email has been checked for viruses by Avast antivirus software.
www.avast.com