پرسش مطرح شده:
Using \twocolumnstableofcontents for making two columns' table of contents raises an error while using it's definition has no probelm!
please try below code:
\documentclass{book}
\usepackage{multicol}
\usepackage{ptext}
\usepackage{xepersian}
\settextfont{Yas}
\begin{document}
%\makeatletter
%\begin{multicols}{2}[\section*{\contentsname}]
% \small
% \@starttoc{toc}%
%\end{multicols}
%\makeatother
\twocolumnstableofcontents
\chapter{1}
\section{1}\ptext
\end{document}
the error will be like following:
! LaTeX Error: Can be used only in preamble.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.15 \twocolumnstableofcontents
?
و پاسخ جناب دکتر وفا --خالق زیپرشین--:
Thanks for your bug report. The error is because of the update in LaTeX kernel. The \twocolumnstableofcontents
checks using \@ifpackageloaded
if the package multicol is loaded or not but with the new LaTeX update \@ifpackageloaded
can only be used in the preamble not in the body of the document where \twocolumnstableofcontents
is used. A better test is indeed needed. I will fix it when time permits.