Times New Roman for a portion of a ##\rm{\LaTeX}## document

  • LaTeX
  • Thread starter brotherbobby
  • Start date
  • Tags
    Font Latex
In summary, using Times New Roman in a portion of a LaTeX document can be achieved by employing the `fontspec` package with XeLaTeX or LuaLaTeX, which allows for easy font customization. By specifying Times New Roman in the preamble or within a specific environment, you can format text accordingly. Additionally, the `\setmainfont` command can be used for the overall document, while `\fontspec` can apply the font to specific sections or text. This flexibility enables clearer and more aesthetically pleasing document presentation.
  • #1
brotherbobby
702
163
TL;DR Summary
Can a portion of a document in ##\rm{\LaTeX}## be converted into the well known ##\verb|Times New Roman|## font?
I am writing a document (article) in ##\rm{\LaTeX}##. Due to easier reading and differentianting a portion of the text from the rest, it is necessary for me to use some other font and I have chosen the ##\verb|Times New Roman|##. However, I don't know how to go about it.
Are there any packages? Is there a font code for the Times New Roman font that I'd need to specify for the portion in question?
Many thanks.
 
Physics news on Phys.org
  • #3
If you are ok with Times, you can simply use
Code:
{\fontfamily{ptm}\selectfont
This text is typeset in Times.
}
 
  • #4
Thank you at @DrClaude.

So the ##\rm{LaTeX}## font code for the ##\verb|Times|## font is {ptm}. One simply has to know it.

Do you know where can I find a list of fonts I can use in ##\rm{LaTeX}## with the font code?
 
  • #6
Thank you @DrClaude. Actually, upon a bit of search, I found an even better catalogue of ##\rm{LaTeX}## fonts online : LaTeX Fonts .
I suppose a huge difference with ##\text{MSWord}^{\circledR}## is that over there I can install fonts on my computer (as .ttf or .otf) and just select them from the drop down menu when I type. In ##\rm{\LaTeX}## however, there's no such thing. If a font you want doesn't exist, you have to do without it.
 
  • Like
Likes DrClaude

FAQ: Times New Roman for a portion of a ##\rm{\LaTeX}## document

How can I change the font to Times New Roman for a portion of my \(\rm{\LaTeX}\) document?

You can use the \texttt{fontspec} package along with \texttt{\textbackslash textsf} command to change the font. For example, \texttt{\textbackslash textsf\{Times New Roman\}} will change the font to Times New Roman for the enclosed text.

Do I need to install any specific package to use Times New Roman in \(\rm{\LaTeX}\)?

Yes, you need to install the \texttt{fontspec} package, which allows you to use system fonts like Times New Roman in \(\rm{\LaTeX}\). Make sure you are using XeLaTeX or LuaLaTeX as your compiler.

Can I use Times New Roman for both text and math in my \(\rm{\LaTeX}\) document?

Yes, you can use the \texttt{mathspec} package along with \texttt{fontspec} to set Times New Roman for both text and math. Use the \texttt{\textbackslash setmathfont} command to specify the math font.

How do I ensure that only a specific section of my document uses Times New Roman?

You can use the \texttt{\textbackslash begin\{fontfamily\}\{Times New Roman\}\textbackslash selectfont} and \texttt{\textbackslash end\{fontfamily\}} commands to limit the scope of the font change to a specific section.

Is it possible to revert back to the default font after using Times New Roman for a portion of the document?

Yes, you can revert to the default font by using \texttt{\textbackslash end\{fontfamily\}} or by specifying the original font family using the \texttt{\textbackslash textsf} or \texttt{\textbackslash texttt} command with the appropriate font name.

Similar threads

Replies
1
Views
6K
Replies
3
Views
2K
Replies
5
Views
2K
Replies
6
Views
9K
Replies
4
Views
2K
Replies
6
Views
41K
Replies
3
Views
935
Back
Top