LaTeX forum ⇒ XeTeXpolyglossia | Section Numbering Style for Russian Topic is solved

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
dinya
Posts: 11
Joined: Sat Oct 24, 2009 6:24 pm

polyglossia | Section Numbering Style for Russian

Postby dinya » Thu Jul 05, 2012 12:49 pm

Hello all.

I use polyglossia
  1. \usepackage{polyglossia}
  2. \setdefaultlanguage[spelling=modern]{russian}

I have to remove dots after section number. The only way I found is to edit gloss-russian.ldf
from
  1. \def\postsection{.\@aftersepkern}%

to
  1. \def\postsection{\@aftersepkern}%


Direct redefinition in preheader doesn't work.

How to change view in proper way?

Thanks in advance,
Denis.

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Thu Jul 05, 2012 2:32 pm

For an adequate problem description and in order to avoid guesses and random shots please prepare a minimal example that contains all necessary but only relevant information in form of code.


Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

dinya
Posts: 11
Joined: Sat Oct 24, 2009 6:24 pm

Postby dinya » Thu Jul 05, 2012 3:40 pm

Document code:
  1. \documentclass[11pt]{article}
  2. \usepackage{polyglossia}
  3. \setmainfont{XITS}
  4. \setdefaultlanguage[spelling=modern]{russian}
  5.  
  6. \begin{document}
  7. \section{Unicode support}
  8.  
  9. \subsection{English}
  10. All human beings are born free and equal in dignity and rights.
  11.  
  12. \subsubsection{English 2}
  13. All human beings are born free and equal in dignity and rights.
  14.  
  15. \subsection{Íslenska}
  16. Hver maður er borinn frjáls og jafn öðrum að virðingu og réttindum.
  17.  
  18. \subsection{Русский}
  19. Все люди рождаются свободными и равными в своем достоинстве и
  20. правах.
  21.  
  22. \end{document}


First compilation (without changing gloss-russian.ldf from polyglossia package)
bad.png
bad.png (44.69 KiB) Viewed 4998 times

Then change gloss-russian.ldf: replace
  1. \def\postsection{.\@aftersepkern}%

with
  1. \def\postsection{\@aftersepkern}%


Result:
good.png
good.png (38.54 KiB) Viewed 4998 times

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Thu Jul 05, 2012 4:11 pm

Without any modification to »gloss-russian.ldf« you can let the periods in the heading numbers disappear. But the necessary redefinitions have to be delayed until the document begins. Add these lines to the document preamble.
  1. \AtBeginDocument{%
  2. \def\postsection{\@aftersepkern}%
  3. \def\postsubsection{\@aftersepkern}%
  4. \def\postsubsubsection{\@aftersepkern}%
  5. \def\postparagraph{\@aftersepkern}%
  6. \def\postsubparagraph{\@aftersepkern}%
  7. }

For classes with chapters you have to add the corresponding redefinition according to »gloss-russian.ldf«. Commands like \AtBeginDocument are introduced in »LaTeX2e for class and package writers.«.

The following way of redefinition does not work in the preamble!
  1. \makeatletter
  2. \def\postsection{\@aftersepkern}%
  3. \def\postsubsection{\@aftersepkern}%
  4. \def\postsubsubsection{\@aftersepkern}%
  5. \def\postparagraph{\@aftersepkern}%
  6. \def\postsubparagraph{\@aftersepkern}%
  7. \makeatother

But it works within the document.


And by the way, we appreciate it very much if you exclusively attach necessary stuff (files, pictures, …) by upload to the forum server.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

dinya
Posts: 11
Joined: Sat Oct 24, 2009 6:24 pm

Postby dinya » Fri Jul 06, 2012 4:21 am

Thanks a lot!


Return to “XeTeX”

Who is online

Users browsing this forum: No registered users and 5 guests