XeTeXpolyglossia | Section Numbering Style for Russian

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

polyglossia | Section Numbering Style for Russian

Post by dinya »

Hello all.

I use polyglossia

Code: Select all

\usepackage{polyglossia}
\setdefaultlanguage[spelling=modern]{russian}
I have to remove dots after section number. The only way I found is to edit gloss-russian.ldf
from

Code: Select all

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

Code: Select all

\def\postsection{\@aftersepkern}%
Direct redefinition in preheader doesn't work.

How to change view in proper way?

Thanks in advance,
Denis.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

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

polyglossia | Section Numbering Style for Russian

Post by localghost »

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
dinya
Posts: 11
Joined: Sat Oct 24, 2009 6:24 pm

polyglossia | Section Numbering Style for Russian

Post by dinya »

Document code:

Code: Select all

\documentclass[11pt]{article}
\usepackage{polyglossia} 
\setmainfont{XITS}
\setdefaultlanguage[spelling=modern]{russian}

\begin{document}
\section{Unicode support}
 
\subsection{English}
All human beings are born free and equal in dignity and rights.

\subsubsection{English 2}
All human beings are born free and equal in dignity and rights.
 
\subsection{Íslenska}
Hver maður er borinn frjáls og jafn öðrum að virðingu og réttindum.
 
\subsection{Русский}  
Все люди рождаются свободными и равными в своем достоинстве и 
правах.
 
\end{document}
First compilation (without changing gloss-russian.ldf from polyglossia package)
bad.png
bad.png (44.69 KiB) Viewed 9373 times
Then change gloss-russian.ldf: replace

Code: Select all

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

Code: Select all

\def\postsection{\@aftersepkern}%
Result:
good.png
good.png (38.54 KiB) Viewed 9373 times
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

polyglossia | Section Numbering Style for Russian

Post by localghost »

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.

Code: Select all

\AtBeginDocument{%
  \def\postsection{\@aftersepkern}%
  \def\postsubsection{\@aftersepkern}%
  \def\postsubsubsection{\@aftersepkern}%
  \def\postparagraph{\@aftersepkern}%
  \def\postsubparagraph{\@aftersepkern}%
}
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!
[code]\makeatletter
\def\postsection{\@aftersepkern}%
\def\postsubsection{\@aftersepkern}%
\def\postsubsubsection{\@aftersepkern}%
\def\postparagraph{\@aftersepkern}%
\def\postsubparagraph{\@aftersepkern}%
\makeatother[/code]
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.
dinya
Posts: 11
Joined: Sat Oct 24, 2009 6:24 pm

Re: polyglossia | Section Numbering Style for Russian

Post by dinya »

Thanks a lot!
Post Reply