ElegantLaTeX / ElegantBook

Elegant LaTeX Template for Books
LaTeX Project Public License v1.3c
2.02k stars 395 forks source link

页码显示问题 #226

Closed saYmd-moe closed 1 year ago

saYmd-moe commented 1 year ago

页码格式变成了Alpha样式,在导言区使用\pagenumbering{arbic}后页码格式仍为Alpha

syvshc commented 1 year ago

首先将模板更新到最新, 然后提供一下你对模板进行的改动

saYmd-moe commented 1 year ago

首先将模板更新到最新, 然后提供一下你对模板进行的改动

感谢回复! 已经确认更新到最新版,导言区设置如下 深度截图_选择区域_20221027233454 但是页码格式为Alpha 深度截图_选择区域_20221027233749

syvshc commented 1 year ago

是否方便复制出来呢……实在不好复现呢

saYmd-moe commented 1 year ago

是否方便复制出来呢……实在不好复现呢

抱歉,忘记复制了

\documentclass[lang=cn, titlestyle=display, scheme=chinese]{elegantbook}

\usepackage{amsmath, bbm, graphicx, enumerate}
\usepackage[math-style=ISO, bold-style=ISO]{unicode-math}
\setmathfont{Garamond-Math.otf}[StylisticSet={7,9}] %设置数学字体
\graphicspath{{assets/images}{assets/logos}} %设置图片路径
\pagenumbering{arbic} %设置页码为阿拉伯数字

%封面设置
\title{数学物理方法简明讲义}
\definecolor{customcolor}{RGB}{32,178,170}
\colorlet{coverlinecolor}{customcolor}
\author{saYmd}
\date{\today}
\version{a2.0}
\cover{cover.png}
\logo{logo.jpg}

\setcounter{tocdepth}{2} %设置目录深度
syvshc commented 1 year ago

我这里依然没有复现出来, 先说一下如果使用 unicode-math 的话, 不要再加载其他与字体相关的宏包. 建议提供更多的信息, 如发行版

saYmd-moe commented 1 year ago

我这里依然没有复现出来, 先说一下如果使用 unicode-math 的话, 不要再加载其他与字体相关的宏包. 建议提供更多的信息, 如发行版

已经排除unicode-math的影响

系统是 Manjaro-Linux, texlive版本如下

TeX 3.141592653 (TeX Live 2022)
kpathsea version 6.3.4
Copyright 2022 D.E. Knuth.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the TeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the TeX source.
Primary author of TeX: D.E. Knuth.

另外我尝试将导言区放置在另外一个文件上时页码是正常的,所以感觉有可能和document区域有关,但我并没有使用任何调整样式的命令

syvshc commented 1 year ago

我用的是 archlinux + texlive 2022, 或者你尝试着把整个文件打包传上来?

saYmd-moe commented 1 year ago

我用的是 archlinux + texlive 2022, 或者你尝试着把整个文件打包传上来?

我发现和设置目录深度的这句命令有关\setcounter{tocdepth}{2},将其去除后,\pagenumbering{arbic}会导致编译不通过,如果将这两条命令同时去除可以正常通过编译,并且页码显示也是阿拉伯数字。

但不清楚原因,好怪(

———————— 更正一下,我发现其实是当\maketitle存在时页码会变成Alpha,并且在我的电脑上可以稳定复现,只要有\maketitle,页码就会被锁定成Alpha格式

saYmd-moe commented 1 year ago

main.zip 打包文件

syvshc commented 1 year ago

原因在这里 https://github.com/ElegantLaTeX/ElegantBook/blob/99eb12f4c44e11261dc1b69e62f2c182ef0898c8/elegantbook.cls#L1274-L1276 为了避免页码重复添加的 \pagenumbering{Alph}, 可以通过在 正文部分使用 \frontmatter\mainmatter 来避免问题, 使用方法见示例文件

syvshc commented 1 year ago

这个Alph的问题见 #71

saYmd-moe commented 1 year ago

添加后问题已解决,十分感谢!