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

Problem in footnote #17

Open
3 of 5 tasks
bahman-mirzakhani opened this issue Jan 20, 2023 · 12 comments
Open
3 of 5 tasks

Problem in footnote #17

bahman-mirzakhani opened this issue Jan 20, 2023 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@bahman-mirzakhani
Copy link

bahman-mirzakhani commented Jan 20, 2023

Brief outline of the issue

When some footnotes place at last/first line of page, the footers goes next/previous page.

Check/indicate

Minimal example showing the issue

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


\documentclass[12pt]{article}            % or some other class

\newcount\footCounter
\newcommand{\mfootnote}[1]{%
	\loop
	\ifnum\footCounter<#1
		\footnote{تست}%
		\advance\footCounter by 1
	\repeat\footCounter0%
}
\usepackage{ptext}
\usepackage[%
	extrafootnotefeatures,%
	perpagefootnote%
]{xepersian}
\settextfont{IRXLotus}
\ParagraphFootnotes
\begin{document}

	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]

\end{document}

Expected behavior

See the pages: 2--6

Log and PDF files

test.pdf
test.log

@bahman-mirzakhani bahman-mirzakhani added the bug Something isn't working label Jan 20, 2023
@kvafa
Copy link
Owner

kvafa commented Aug 1, 2023

My investigation so far shows that the issue also happens without using xepersian/bidi packages. Look particularly at pages 4, 6, 8, and 10.

\documentclass[12pt]{article}            % or some other class
\usepackage{zref-perpage} 
\zmakeperpage{footnote}
\newcount\footCounter
\newcommand{\mfootnote}[1]{%
	\loop
	\ifnum\footCounter<#1
		\footnote{Test}%
		\advance\footCounter by 1
	\repeat\footCounter0%
}
\usepackage{fontspec}
\setmainfont{IRXLotus}
\usepackage{ptext}
\begin{document}

	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]\mfootnote{5}
	\ptext[1-2]

\end{document}

@kvafa
Copy link
Owner

kvafa commented Aug 1, 2023

Could you please also post Vahid Damanafshan's example from Telegram? I do not have access to Telegram as I left my phone in home back in Australia.

@bahman-mirzakhani
Copy link
Author

When I asked Mr. DamanAfshan, he said that I had the same problem.

@kvafa
Copy link
Owner

kvafa commented Aug 2, 2023

I think the two issues are slightly different although somehow related; from memory, I think his example had the old footnote cs \paragraphfootnotes or something similar while your example uses the new footnote cs \ParagraphFootnotes.

Anyway, it helps me a lot if I also can have access to Vahid's specific example.

@bahman-mirzakhani
Copy link
Author

I asked this question about different methods of resetting footnote numbers for more details. Only one of the methods worked correctly (with footmisc package). Comment: The ones I mark not ok can not work as the footnotes have been allocated numbers before page breaking. That is why footmisc offers code to implement this.

@kvafa
Copy link
Owner

kvafa commented Aug 5, 2023

I asked this question about different methods of resetting footnote numbers for more details. Only one of the methods worked correctly (with footmisc package). Comment: The ones I mark not ok can not work as the footnotes have been allocated numbers before page breaking. That is why footmisc offers code to implement this.

I do not think that it is footmisc that implements it as it loads perpage package. That is, if you load perpage directly instead footmisc, you should also get the correct output.

@bahman-mirzakhani
Copy link
Author

You are right. Is it possible the bidi package to use some codes like perpage package for solving this issue?

@bahman-mirzakhani
Copy link
Author

bahman-mirzakhani commented Aug 5, 2023

You are right. Is it possible the bidi package to use some codes like perpage package for solving this issue?

Note: unfortunately the perpage package also transfers the last line of the previous page to the next page and its place remains empty. Even the \flushbottom command doesn't fill it.

@kvafa
Copy link
Owner

kvafa commented Aug 6, 2023

You are right. Is it possible the bidi package to use some codes like perpage package for solving this issue?

I have not investigated the issue thoroughly; I just made some observation without actually looking at what is going on exactly.

One way to go forward is to see what perpage does that 'bidi-perpagedoes not and extendbidi-perpage' to get the correct behavior.

Another possible solution is to avoid resetting footnotes by using a different algorithm.

I just need to find some free time to investigate this and fix it.

@saeidm23
Copy link

Is there any solution for the bug?

@bahman-mirzakhani
Copy link
Author

Is there any solution for the bug?

According to comments, you can use perpage package as follows:

\usepackage{perpage} 
\MakePerPage{footnote}

@saeidm23
Copy link

Many thanks. But that does not resolve the issue.

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

3 participants