Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra space in table of contents with some tocloft package commands #23

Closed
3 of 5 tasks
bahman-mirzakhani opened this issue May 25, 2022 · 1 comment
Closed
3 of 5 tasks
Assignees
Labels
bug Something isn't working

Comments

@bahman-mirzakhani
Copy link

Brief outline of the issue

I had already made changes to the table of contents with a series of tocloft batch commands, and there was no problem with older versions of the xepersian package; But in version 24.1, extra white space is added.

Check/indicate

Minimal example showing the issue

% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode


\documentclass{report}            % or some other class

  % Any packages other than the xepersian package must be loaded here
\usepackage{tocloft}
\renewcommand{\cftchappresnum}{\chaptername~}
\renewcommand{\cftchapaftersnum}{:}
\newlength{\chaplen}
\settowidth{\chaplen}{\chaptername~\cftchapaftersnum}
\addtolength{\cftchapnumwidth}{\chaplen}
\usepackage{lipsum}
  % The xepersian package must be loaded as the last package
\usepackage[%
    % Any xepersian package option goes here
]{xepersian}
\settextfont{IRXLotus}

  % Any preamble code goes here
  
\begin{document}

	\tableofcontents
	\chapter{One}
	\lipsum[1]
	\chapter{Two}
	\lipsum[2]
  
\end{document}

Expected behavior

Log and PDF files

test.log
test.pdf

@bahman-mirzakhani bahman-mirzakhani added the bug Something isn't working label May 25, 2022
@bahman-mirzakhani
Copy link
Author

In the new version, due to compatibility with koma-script, the chapter renaming has been moved to after \begin{document}; So when the \chaptername command is used in the preamble to calculate the chapter word width, the English chapter word width is actually entered, which is greater than the Persian chapter word width. So the commands for calculating the width must either be moved to after \begin{document} or the command \renewcommand{\chaptername{{فصل}} write before the width calculations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants