LaTeX/C3/Indic-Language-Typesetting-in-LaTeX/English-timed
From Script | Spoken-Tutorial
Time | Narration |
00:01 | Hello and welcome to the spoken tutorial on “Indic language typesetting” |
00:07 | In this tutorial we will learn to,
1 Install a new font and 2 Typeset a document in indic language using XeLaTeX. |
00:19 | This tutorial is recorded using
Ubuntu Linux 18.04 OS and TeXworks editor v0.6. |
00:31 | The steps demonstrated will work in all operating systems. |
00:37 | To practise this tutorial, you should be familiar with LaTeX commands. |
00:43 | If not, then go through the prerequisite LaTeX spoken tutorials on this website. |
00:51 | The files used for the installation are available in the Code files link on this tutorial page. |
00:58 | Please download and use them while practising. Make sure that all the supporting files are kept in the same folder while practising |
01:09 | In this tutorial we will be installing Nirmala UI font. |
01:15 | This font supports 12 indic scripts as mentioned here. |
01:21 | First go to the folder where all the files are downloaded. |
01:27 | Now double-click on the file Nirmala.ttf It will open the Nirmala UI font in the Font Viewer window. |
01:38 | Click on the Install button located at the top right corner of the window. This will install the font in your system. |
01:48 | Once done, the Install option will be changed to Installed. |
01:54 | Let us cross verify this. |
01:57 | Click on the back button located to the left of the Font name. |
02:03 | This will display the list of fonts already installed in the system. |
02:09 | Scroll down to find the newly installed Nirmala UI font in the fonts folder. Here it is. |
02:18 | If Nirmala font file is present in that folder, then installation of the font is successful. |
02:26 | If not, repeat the above installation steps once again. |
02:31 | Now we will typeset a document in XeLaTeX. |
02:36 | I will be using the file multiLang.tex for this demonstration. |
02:42 | The same is available in the Code files link. You can download it from there and use it while practising. |
02:51 | I have already opened the file multiLang.tex in TeXworks editor. |
02:57 | Now let me give an overview of few commands. |
03:02 | Fontspec package allows us to use opentype fonts without installing them. |
03:09 | This is useful when you are not able to install fonts or require admin access. |
03:16 | It gives us the facility to switch or use different fonts in the same LaTeX document. |
03:25 | Polyglossia package allows us to typeset indic languages in a XeLaTeX document. |
03:32 | Without this package the sentences in other language will not be processed in the output. |
03:39 | I have set the default language as English using the command setdefaultlanguage. |
03:46 | If you wish to set any other language as a default one, then we have to specify it here. |
03:54 | setotherlanguages command helps us to mention the languages which we are going to use here. |
04:01 | In this example we are using Hindi, Tamil, Bengali, Telugu and Malayalam scripts. |
04:10 | Using the newfontfamily command I have declared the font for each language. |
04:17 | Here I have used Nirmala UI font for all the languages. |
04:23 | You can use any of the 12 scripts supported by Nirmala UI as per your choice. |
04:30 | Make sure you have installed this font before compiling. |
04:35 | Next to the begin document, I have written a few lines of code. |
04:40 | The first few lines are written in English. As I have set English as a default language, I don’t need to specify any language. |
04:51 | Before typing the text in a language other than the default one, we have to use the command select language. |
04:58 | And select the respective language name as a value. |
05:04 | Say, in this piece of code, I wish to display my text in Tamil. |
05:10 | So before writing the text in Tamil, I have used selectlanguage command, and set its value to Tamil. |
05:19 | Likewise, I have written the code for the rest of the languages. Now let us compile this. |
05:28 | Select XeLaTeX as the compiler from the dropdown on the top toolbar. |
05:35 | XeLaTeX provides user with extensive set of fonts. |
05:41 | Run the code by clicking on the green Typeset button at the top left corner. |
05:48 | Observe the output pdf. We can see the output of the sentence in various languages in Nirmala UI font. |
05:58 | In this example, I have used the font bundle Nirmala UI for all the languages. |
06:05 | Instead we can also use specific fonts for each language. |
06:11 | For this part of the demonstration, I will be using these fonts for the respective languages. |
06:18 | The same is available in the Code files link. |
06:22 | Download and install them as explained earlier in this tutorial, before proceeding further. |
06:30 | I have already installed these fonts on my machine. |
06:35 | In the multiLang.tex file, update the font declaration as shown here. |
06:43 | In this example, I am declaring different fonts for different languages. |
06:49 | Let us compile this file to see the output. Make sure the compiler is set to XeLaTeX at the top. |
07:02 | Observe that there is no change in the output, other than the font style. |
07:08 | So using any one of these methods, one can typeset indic languages in a LaTeX document. |
07:16 | Important note.
While typesetting an indic language in LaTeX, make sure you have declared the command selectlanguage. |
07:25 | Else, the particular language text will not be displayed in the output. Let us try this. |
07:34 | Copy the text written in any language and paste it next to the line, Knowledge is the supreme goal. |
07:43 | Let us compile this file to see the output. |
07:48 | In this code we have written a line of text in Telugu twice. |
07:53 | One is before the selectlanguage command for Telugu and one is after that. |
08:02 | But in the output pdf, we can only see the text which is written after the selectlanguage command. |
08:08 | So be careful while typesetting in indic language. |
08:14 | With this we have come to the end of this tutorial. Let us summarise. |
08:21 | In this tutorial we learnt
1. How to install Nirmala UI font 2. To typeset a document in multiple languages using Nirmala UI and other language specific fonts |
08:36 | As an assignment:
Identify and download other fonts which are compatible with the above languages. Or that supports some other languages. |
08:49 | Install and use them to typeset a document and
Compare the output. |
08:56 | The video at the following link summarises the Spoken Tutorial project. Please watch it. |
09:04 | The Spoken Tutorial Project Team conducts workshops and gives certificates. |
09:10 | For more details, please write to us. |
09:14 | Please post your timed queries in this forum |
09:18 | Spoken Tutorial Project is funded by MHRD, Government of India. More information on this Mission is available at this link. |
09:24 | The script was contributed by Meenal and Preeti, FOSSEE Summer Fellows 2019. |
09:32 | And this is Praveen from IIT Bombay signing off. Thanks for joining. |