Difference between revisions of "LaTeX/C3/Indic-Language-Typesetting-in-LaTeX/English"
Pravin1389 (Talk | contribs) (Created page with "'''Title of script''': Indic Language Typesetting '''Author: Meenal Gaba '''and''' Preeti Bamane''' '''Keywords: Video tutorial, XeLaTeX, TeXWorks, Ubuntu, Linux, Unicode, I...") |
Nancyvarkey (Talk | contribs) |
||
Line 16: | Line 16: | ||
|- | |- | ||
|| '''Slide 2: Learning Objectives''' | || '''Slide 2: Learning Objectives''' | ||
− | || In this tutorial we will learn to,# Install a new '''font''' and | + | || In this tutorial we will learn to, |
+ | # Install a new '''font''' and | ||
# '''Typeset''' a document in '''indic language''' using '''XeLaTeX'''. | # '''Typeset''' a document in '''indic language''' using '''XeLaTeX'''. | ||
− | |||
|- | |- | ||
Line 60: | Line 60: | ||
|- | |- | ||
|| Click on Install | || Click on Install | ||
− | || Click on '''Install''' button located at the top right corner of the window. | + | || Click on the '''Install''' button located at the top right corner of the window. |
Line 146: | Line 146: | ||
− | || Using the '''newfontfamily command''' I have declared the font for each language. | + | || Using the '''newfontfamily command''' I have declared the '''font''' for each language. |
|- | |- | ||
|| Highlight Nirmala UI font | || Highlight Nirmala UI font | ||
Line 171: | Line 171: | ||
\textbf{Tamil} | \textbf{Tamil} | ||
− | || Next to the begin document, I have written a few lines of code. | + | || Next to the '''begin document''', I have written a few lines of code. |
Line 177: | Line 177: | ||
− | As I have set English as a default language, I don’t need to specify any language. | + | As I have set English as a '''default''' language, I don’t need to specify any language. |
|- | |- | ||
|| Highlight \selectlanguage | || Highlight \selectlanguage | ||
Line 183: | Line 183: | ||
− | || Before typing the text in a language other than the default one, we have to use the '''command selectlanguage.''' | + | || Before typing the text in a language other than the '''default''' one, we have to use the '''command selectlanguage.''' |
− | And select the respective language name as a value | + | And select the respective language name as a value. |
|- | |- | ||
|| Highlight | || Highlight | ||
Line 198: | Line 198: | ||
\medskip | \medskip | ||
− | || Say in this piece of code, I wish to display my text in | + | || Say, in this piece of code, I wish to display my text in Tamil. |
− | So before writing the text in | + | So before writing the text in Tamil, I have used '''selectlanguage command''', and set its value to '''Tamil'''. |
|- | |- | ||
|| Highlight the complete code. | || Highlight the complete code. | ||
Line 209: | Line 209: | ||
Now let us '''compile''' this. | Now let us '''compile''' this. | ||
|- | |- | ||
− | || Point to the | + | || Point to the drop down in the top left corner. |
Line 216: | Line 216: | ||
− | '''XeLaTeX''' provides user with extensive set of fonts. | + | '''XeLaTeX''' provides user with extensive set of '''fonts'''. |
|- | |- | ||
|| Click on the green '''Typeset''' button | || Click on the green '''Typeset''' button | ||
Line 242: | Line 242: | ||
\newfontfamily\malayalamfont[Script=Malayalam]{Nirmala UI} | \newfontfamily\malayalamfont[Script=Malayalam]{Nirmala UI} | ||
− | || In this example, I have used the '''font bundle Nirmala UI''' for | + | || In this example, I have used the '''font bundle Nirmala UI''' for all the languages. |
Instead we can also use specific '''fonts''' for each language. | Instead we can also use specific '''fonts''' for each language. | ||
− | |||
− | |||
|- | |- | ||
Line 277: | Line 275: | ||
\newfontfamily\malayalamfont[Script=Malayalam]{Kartika} | \newfontfamily\malayalamfont[Script=Malayalam]{Kartika} | ||
− | || In the '''multiLang.tex''' file, update the font declaration as shown here. | + | || In the '''multiLang.tex''' file, update the '''font''' declaration as shown here. |
− | In this example, I am declaring different fonts for different languages | + | In this example, I am declaring different '''fonts''' for different languages. |
Line 289: | Line 287: | ||
− | Make sure the '''compiler''' is set to '''XeLaTeX '''at the top | + | Make sure the '''compiler''' is set to '''XeLaTeX '''at the top. |
|- | |- | ||
|| Point to the output | || Point to the output | ||
Line 295: | Line 293: | ||
|- | |- | ||
|| Only Narration | || Only Narration | ||
− | || So using any one of these methods, one can typeset | + | || So using any one of these methods, one can '''typeset indic''' languages in a '''LaTeX''' document. |
|- | |- | ||
|| [TeXworks] multiLang.tex | || [TeXworks] multiLang.tex | ||
Line 318: | Line 316: | ||
அறிவு மிகச் சிறந்த இலக்கு | அறிவு மிகச் சிறந்த இலக்கு | ||
− | || Copy the text written in any language and paste it next to the line, '''Knowledge is the supreme goal''' | + | || Copy the text written in any language and paste it next to the line, '''Knowledge is the supreme goal'''. |
Line 365: | Line 363: | ||
|- | |- | ||
|| '''Slide 10: Summary''' | || '''Slide 10: Summary''' | ||
− | || In this tutorial we learnt | + | || In this tutorial we learnt |
− | + | # How to install '''Nirmala UI font''' | |
− | + | # To '''typeset''' a document in multiple languages using '''Nirmala UI''' and other language specific '''fonts''' | |
|- | |- | ||
|| '''Slide 11: Assignment''' | || '''Slide 11: Assignment''' | ||
− | || As an assignment:* Identify and download other '''fonts''' which are compatible with the above languages | + | || As an assignment: |
+ | * Identify and download other '''fonts''' which are compatible with the above languages. | ||
* Or that supports some other languages. | * Or that supports some other languages. | ||
* Install and use them to '''typeset''' a document and | * Install and use them to '''typeset''' a document and | ||
* Compare the output. | * Compare the output. | ||
− | |||
|- | |- |
Latest revision as of 16:04, 17 December 2019
Title of script: Indic Language Typesetting
Author: Meenal Gaba and Preeti Bamane
Keywords: Video tutorial, XeLaTeX, TeXWorks, Ubuntu, Linux, Unicode, Indic languages, Hindi typesetting
Visual Cue | Narration |
Slide 1: Title | Hello and welcome to the spoken tutorial on “Indic language typesetting” |
Slide 2: Learning Objectives | In this tutorial we will learn to,
|
Slide 3: System Requirements | This tutorial is recorded using
The steps demonstrated will work in all operating systems. |
Slide 4: Prerequisites |
|
Slide 5: Code Files |
|
In the downloaded folder
Point to Nirmala.ttf |
In this tutorial we will be installing Nirmala UI font. |
Slide 6: Nirmala UI | This font supports 12 indic scripts as mentioned here. |
Go to Downloads folder >> Indic-Code-Files | First go to the folder where all the files are downloaded. |
Double-click on Nirmala.ttf | Now double-click on the file Nirmala.ttf
|
Click on Install | Click on the Install button located at the top right corner of the window.
|
Point to Installed | Once done, the Install option will be changed to Installed. |
Click on the back button on the left of the Font name.
|
Let us cross verify this.
|
Scroll down | Scroll down to find the newly installed Nirmala UI font in the fonts folder.
|
Slide 7: Font Installation | If Nirmala font file is present in that folder, then installation of the font is successful.
|
Slide 8: Demonstration | Now we will typeset a document in XeLaTeX.
|
[TeXworks] multiLang.tex | I have already opened the file multiLang.tex in TeXworks editor. |
Now let me give an overview of few commands. | |
Highlight fontspec package | Fontspec package allows us to use opentype fonts without installing them.
|
Highlight polyglossia package
|
Polyglossia package allows us to typeset indic languages in a XeLaTeX document.
|
Highlight \setdefaultlanguage{english} | I have set the default language as English using the command setdefaultlanguage.
|
Highlight
\setotherlanguages{hindi, tamil, bengali, telugu, malayalam} |
setotherlanguages command helps us to mention the languages which we are going to use here.
|
Highlight \newfontfamily
|
Using the newfontfamily command I have declared the font for each language. |
Highlight Nirmala UI font | Here I have used Nirmala UI font for all the languages.
|
Highlight
\bigskip \par \textbf{English} \par Knowledge is the supreme goal \medskip \textbf{Tamil} |
Next to the begin document, I have written a few lines of code.
|
Highlight \selectlanguage
|
Before typing the text in a language other than the default one, we have to use the command selectlanguage.
|
Highlight
\par \selectlanguage{tamil} அறிவு மிகச் சிறந்த இலக்கு \medskip |
Say, in this piece of code, I wish to display my text in Tamil.
|
Highlight the complete code. | Likewise, I have written the code for the rest of the languages.
|
Point to the drop down in the top left corner.
|
Select XeLaTeX as the compiler from the dropdown on the top toolbar.
|
Click on the green Typeset button
|
Run the code by clicking on the green Typeset button at the top left corner. |
Point to the output | Observe the output pdf.
|
[TeXworks] multiLang.tex
\newfontfamily\tamilfont[Script=Tamil]{Nirmala UI} \newfontfamily\bengalifont[Script=Bengali]{Nirmala UI} \newfontfamily\telugufont[Script=Telugu]{Nirmala UI} \newfontfamily\malayalamfont[Script=Malayalam]{Nirmala UI} |
In this example, I have used the font bundle Nirmala UI for all the languages.
|
Slide 9: Indic Fonts
|
For this part of the demonstration, I will be using these fonts for the respective languages.
|
[TeXworks] multiLang.tex
\newfontfamily\tamilfont[Script=Tamil]{Latha} \newfontfamily\bengalifont[Script=Bengali]{Shonar Bangla} \newfontfamily\telugufont[Script=Telugu]{Gautami} \newfontfamily\malayalamfont[Script=Malayalam]{Kartika} |
In the multiLang.tex file, update the font declaration as shown here.
|
Compile the file. | Let us compile this file to see the output.
|
Point to the output | Observe that there is no change in the output, other than the font style. |
Only Narration | So using any one of these methods, one can typeset indic languages in a LaTeX document. |
[TeXworks] multiLang.tex
|
Important note.
|
[TeXworks] multiLang.tex
அறிவு மிகச் சிறந்த இலக்கு |
Copy the text written in any language and paste it next to the line, Knowledge is the supreme goal.
|
Compile the file. | Let us compile this file to see the output. |
[TeXworks] multiLang.tex
\par Knowledge is the supreme goal அறிவு மிகச் சிறந்த இலக்கு \medskip
\par \selectlanguage{tamil} அறிவு மிகச் சிறந்த இலக்கு \medskip |
In this code we have written a line of text in Telugu twice.
|
Point to the output | But in the output pdf, we can only see the text which is written after the selectlanguage command.
|
With this we have come to the end of this tutorial.
Let us summarise. | |
Slide 10: Summary | In this tutorial we learnt
|
Slide 11: Assignment | As an assignment:
|
Slide 12: About Spoken Tutorial project | The video at the following link summarises the Spoken Tutorial project.
|
Slide 13: Spoken Tutorial workshops | The Spoken Tutorial Project Team conducts workshops and
gives certificates.
|
Slide 14: Forum for specific questions | Please post your timed queries in this forum |
Slide 15: Acknowledgement | Spoken Tutorial Project is funded by MHRD, Government of India.
More information on this Mission is available at this link. |
Slide 16: Thanks Slide | The script was contributed by Meenal and Preeti, FOSSEE Summer Fellows 2019.
Thanks for joining. |