Update: 8th May 2012, Se.
Assalamualaikum. By preparing a research proposal, my husband is learning how to use LaTeX in Kile. He is starting from scratch and wants to use the Arial font instead of the default font, Computer Modern.
i myself don't know how and never thought of such a thing. After a late evening of much ask and answer, try and error, tease and jabber, google and sigh, eat and idle, and much more... Here's how to implement the Arial font in a LaTeX output document (referring to the PDF file).
You'll notice the difference with the Panel in a few screenshots because i was working on my husband's laptop ;). The fine editing was done on my laptop later on.
Part A: Obtaining the Arial font
1. Run Ubuntu Software Center.
2. In the search field, type-in the search term "arial". The results will auto-filter. See Pic 1.
3. Select the result: Installer for Microsoft TrueType core fonts (ttf-mscorefonts-installer). See Pic 1.
If you want to install straightaway-no-delays, click the Install button.
* In Pic 1, seeing that i have already installed these fonts, the Install button has turned into the Remove button.
If you want to see the available Add-ons, click the More Info button. See the Add-ons, shown in Pic 2. When you are ready to install, click the Install button.
4. An Authenticate window will appear prompting for your password. Key-in your password in the Password: field, then click the Authenticate button. See Pic 3.
5. After downloading but before installing the fonts, a EULA(?) window will appear. To accept the terms and conditions, put a tick in the box. Then click the Forward(?)/Next(?)/OK(?)* button.
* Hoping to make a screenshot of the EULA(?) window, i removed the fonts (using the Remove button in Pic 2) then re-installed (using the Install button) but the EULA window did not appear on the second install :-\. Sorry.
6. Once the fonts are installed, the Install button will turn into the Remove button. See Pic 1 and Pic 2.
Part B: Installing the xltxtra package
Without the xltxtra package, you will get one of the errors mentioned in Step 16.
If you already have this package, then skip to Step 12.
If you do not have this package yet, then proceed to Step 7.
7. Run Ubuntu Software Center.
8. In the search field, type-in the search term "xltxtra". The results will auto-filter. See Pic 4.
9. Select the result: TeX Live: XeTeX packages (texlive-xetex). See Pic 4.
If you want to install straightaway-no-delays, click the Install button.
If you want to see the list of XeTeX packages and available Add-ons, click the More Info button. When you are ready to install, click the Install button.
10. An Authenticate window will appear prompting for your password. Key-in your password in the Password: field, then click the Authenticate button. See Pic 3.
11. Once this package is installed, the Install button will turn into the Remove button. See Pic 5.
Part C: Producing document with Arial font
12. Run Kile.
i'm not sure if it works the same in other editors, though giving it a try shouldn't hurt :).
13. Create a new document. Click File > New. See Pic 6.
14. A window* will appear. See Pic 7.
* The pop-up windows on my husband's laptop doesn't seem to have a title bar. Checking on my laptop, the window is New File -- Kile.
Under the Document Type section, select LaTeX Document.
Under the Template section, scroll to the end then select Xelatex.
Then click the OK button.
An Untitled document with contents is automatically created. See Pic 8.
15. Save your document. If you don't save now, you will still need to do so and will be prompted with:
[QuickBuild] Please save the untitled document first.when building/compiling later on. See Pic 9.
Click File > Save As... .
In the pop-up window*, see Pic 10:
* Again, no title bar. Checking elsewhere, it's the Save File -- Kile window.
Under the Places section, locate where on your hard-disk do you want to save this document.
In the Name: field, give it a name.
Then click the Save button.
i named mine xeletex test (i know, i misspelled it out of excitement :P) and placed it on the Desktop.
16. If you were to click Build > QuickBuild now, among the many possible errors you might encounter are:
./test:5:File `xltxtra.sty' not found. ^^MSee Pic 11. This error is because the package is not installed in the system.
[PDFLaTeX] 1 error, 0 warnings, 0 badboxes
In order to eliminate this error, proceed to Part B. After Part B is completed, proceed to Step 17.
*** this package currently works only with XeTeX ***See Pic 12. i'm guessing you will get this error because of the QuickBuild. In order to eliminate this error, proceed to the next step.
17. In the document, change the font from Linux Libertine O to Arial.
Then click Build > Compile > XeLaTeX, see Pic 13. Alternatively, the XeLaTeX shortcut button is shown in Pic 14.
This time there supposedly should be no more errors, see Pic 15:
[XeLaTeX] 0 errors, 0 warnings, 0 badboxes
[XeLaTeX] Done!
18. To see the output:
Either view the PDF file straightaway. Locate the file at the same place where you saved the XeLaTeX document when in Step 15.
Or
Click Build > View > ViewPDF, see Pic 16. Alternatively, the ViewPDF shortcut button is shown in Pic 17.
Part D: It's Arial, alright!
Some might argue that the font in use is not Arial but a clone or a close mimic of it. This article shows the differences between the Helvetica, Arial, and Grotesque fonts: How to Spot Arial.
Now that you know how the "a" of the Arial font is supposed to look like, Pic 18 is my proof that the font used in Part C is really Arial.
Here's the content of the file seen in Pic 15:
\documentclass[a4paper,10pt]{article}
%\documentclass[a4paper,10pt]{scrartcl}
\usepackage{xltxtra}
\setromanfont[Mapping=tex-text]{Arial}
% \setsansfont[Mapping=tex-text]{DejaVu Sans}
% \setmonofont[Mapping=tex-text]{DejaVu Sans Mono}
\title{Arial font}
\author{}
\date{}
\begin{document}
\maketitle
\Huge{Aa Bb Cc Dd Ee Ff \\
Gg Hh Ii Jj Kk Ll \\
Mm Nn Oo Pp Qq Rr \\
Ss Tt Uu Vv Ww Xx \\
Yy Zz 0 1 2 3 \\
4 5 6 7 8 9}
\end{document}
Still not convinced?
Open the generated PDF file.
Click File > Properties, see Pic 19.
In the Properties pop-up window, under the Fonts tab is the list of embedded fonts, see Pic 20. The Arial font is embedded under its "postscript name" as ArialMT. Read here about Arial and Arial MT: Arial being changed to ArialMT in PDF.
Convinced? :)
Here, i would like to thank the person who taught me the basics of LaTeX, Dr. Bakri Adam from Faculty of Science, Universiti Putra Malaysia (UPM).
Thank you very much for this guide. Helped me to install an arial font in Kile under Ubuntu 11.10 no problem at all :-) Thanks again. Ben
ReplyDeleteGood day, Ben.
ReplyDeleteThank you for your feedback.
Alhamdulillah. Glad this humble post has been of some help to you =)
Congratulations for this great tutorial. I was almost giving up to search for a solution when I saw your page.
ReplyDeleteThank you!
Fernanda