I want to have my page numbers in LibreOffice Impress to be in Persian. Which means ۰۱۲۳۴۵۶۷۸۹ instead of 0123456789.
5 Answers
These settings work across all LibreOffice applications and documents, so you can make changes from any of the set of applications.
Changing the locale
You can set Persian as the default for all of your documents or for the current document only.
From the menu bar, Tools >> Options, then expand the Language Settings and click Languages
Change Locale to Farsi. (Note that this is independent of the setting for the user interface above.)
Change CTL to Default - Farsi. This will also automatically check Enabled for complex text layout (CTL) below. CTL handles right-to-left languages.
Check For the current document only according to your prefrence.
Changing the global numeral style
Click on Complex Text Layout on the left side of the dialog and change numerals to Hindi. (not shown in this screenshot)
Use Insert >> Page Number to show the Header/Footer dialog in order to add page numbers to your slides.
Setting numerals to Hindi in the Language Settings lets you use "Arabic" numbers without using an input method editor such as Ibus. In this context, of course, Arabic numerals are 1,2,3...
Is it possible to use Hindi numbers in the slide footer page number function without changing every number to Hindi?
Short answer: not through the GUI settings. Apart from the global number style setting, there does not appear to be any way to modify the function that inserts page numbers.
Interestingly enough, the footer lets you easily change the date to Persian. I believe the page numbers cannot be changed in a similar way because the page numbers appears to be drawn from functions to work with the printer.
The solution is to not use the built-in footer page numbering at all and instead insert your own text shape in the same area with the text set the way you want. For a small number of slides, this would not be too bad; but would not be feasible with more than a handful.
The solution to this problem is to use a LibreOffice Basic macro to insert the page numbers for you. For a short overview of LibreOffice macros and how to use them in your document, please see this answer.
Here is the macro code:
Sub AddPersianPageNumbers
Dim Doc as Object
Set Doc = ThisComponent
'Get the collection of DrawingPages
Dim DrwPages as Object
Set DrwPages = Doc.getDrawPages()
Dim DrwPg as Object
Dim TxtShp as Object
Dim TxtPoint as New com.sun.star.awt.Point
Dim i as Long
Dim k as Long
Dim strNum as string
Dim strI as string
Dim idx as long
Dim uni as string
'Each slide has it's own Drawpage, so go through the collection
For i = 0 to DrwPages.getCount() - 1
'Get the Drawing Page and create a TextShape
Set DrwPg = DrwPages.getByIndex(i)
Set TxtShp = Doc.createInstance("com.sun.star.drawing.TextShape")
'Add it to the Drawing Page (must do first)
DrwPg.Add(TxtShp)
TxtPoint.X = DrwPg.Width * 0.9
TxtPoint.Y = DrwPg.Height * 0.9
TxtShp.Position = TxtPoint
TxtShp.TextAutoGrowWidth = true
TxtShp.TextAutoGrowHeight = true
'Just changing the font is not enough since it will still show as Arabic
'You can change the locale and ComplexText props for just this para
'but I couldn't find a way to set the para to be seen as ComplexText
'That would have been elegant, but instead just convert
'the page number to a string converted from the Unicode code points
strI = Cstr(i + 1)
for k = 1 to Len(strI)
uni = "&H66" & mid(strI, k, 1) 'Hindi numeral code points are ascii+660
strNum = strNum & Chr(uni)
next k
TxtShp.SetString(strNum)
strNum = ""
TxtShp.CharFontName = "Lohit Hindi"
Next i
End Sub
tools-> options -> languages settings -> complex text layout
general options set it to hindi
and here's a screen shot of it
This can be easily done in two steps.
STEP 1: Change the Locale
Got to the menu and click: Tools > Options, then select Languages under Language Settings.
Here change the following:
- Locale Setting - change this to Arabic (or whatever language you want).
- CTL - set this to Arabic as well (only if you are using a language that uses Complex Text Layout)
- Tick the 'For the current document only' check-box if you want this change just for this document that's being edited
- Click 'OK' and save the setting. At this point make sure that the font used in the page number field support the language. In my case Time New Roman font has Arabic number Characters (۰۱۲۳)
STEP 2: Select the Field Type
Now select the text in the page number field (ensure the font is right) and then from the menu select: Edit > Fields
In the 'Edit Fields' window that opens up, change the Format to Native Numbering (as shown above). Click 'OK' to save and close.
You're done!
You can do it just in simple steps. in the menu bar find Tools, at the end of Tools pane we can find options . In the options page we have two side, at the left side we see Language Settings, by pressing its triangle we have three options and we choose fist one, Languages . Now at the right side of the page we have three different part, in second one (Default Languages for Document) we have to choose Complex text layout in its options we pick our desired language (Persian).
-
1Didn't @AbdallaMohamedAlyIbrahim already give this advice? Am I missing something? Feb 6, 2022 at 12:10
-
Yes he did this is just a repeat of what someone else said. This is not an answer. The old adage applies you have nothing new to say so say nothing.– DavidFeb 6, 2022 at 16:36
I found the solution in this Super User post, in one of the answers which start with
In libreOffice, there are a number of page number format style to choose from, like Roman, Arabic etc., which can be accessed from Insert>Fields>Other in the Document tab of the Fields dialogue. There is a page in the list and there is Format section from where you can choose the required ....
See the attached screenshot