Coder Social home page Coder Social logo

Comments (15)

LogCreative avatar LogCreative commented on May 20, 2024 2

当然最好的实践应该是每个图标题设定一个简短的标题放在插图索引中。

\caption[简短的标题]{这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题}

from sjtuthesis.

AlexaraWu avatar AlexaraWu commented on May 20, 2024 2

试了一下用 ctexbook 是正常的,还不清楚是哪里的问题,有空我排查一下。

from sjtuthesis.

AlexaraWu avatar AlexaraWu commented on May 20, 2024 2

fixed in v2.0.3

from sjtuthesis.

AlexaraWu avatar AlexaraWu commented on May 20, 2024 1

更正:此问题与页面纵向对齐方式有关,标准文档类中 oneside 默认开启 \raggedbottom,手动开启 \flushbottom 也可以复现此问题。

建议修改模板 onesidetwoside 均默认使用 \raggedbottom

\documentclass[oneside]{sjtuthesis}

\flushbottom

\begin{document}

\frontmatter

\listoffigures

\mainmatter

\chapter{测试}

\ExplSyntaxOn
\int_step_inline:nn { 10 }
  {
    \begin{figure}
      \caption{这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题}
    \end{figure}
  }
\ExplSyntaxOff

\end{document}

from sjtuthesis.

AlexaraWu avatar AlexaraWu commented on May 20, 2024 1

fixskip 应该还是有点关系的,实测 \parskip=0pt 取消段间距的弹性也可以解决这个问题。推测是 fixskip 在章标题中引入了弹性间距,在 \flushbottom 模式下产生了问题。

from sjtuthesis.

LogCreative avatar LogCreative commented on May 20, 2024

可能是没有清理临时文件所致?

from sjtuthesis.

Fang-Haoshu avatar Fang-Haoshu commented on May 20, 2024

应该不是,刚刚尝试了一下清理缓存文件重新编译,在开启twoside的时候还是会出现这个显示bug

from sjtuthesis.

LogCreative avatar LogCreative commented on May 20, 2024

从日志文件来看,仍然引入了 subfigure 宏包,有没有尝试过完全去除 \usepackage{subfigure},以及我本地引入 subfigure 时,实际上是编译不成功的:

Package subcaption Error: This package can't be used in cooperation
(subcaption)                with the subfigure package.

from sjtuthesis.

Fang-Haoshu avatar Fang-Haoshu commented on May 20, 2024

谢谢你对这个问题的关注!是的,后来也尝试了一下只使用subcaption,log如下,问题似乎还是存在,我附上了一个最小可复现环境,应该导入sjtu latex,用xelatex编译就能复现,不知道是不是我哪里搞bug了
output (2).log

MWE.zip

from sjtuthesis.

LogCreative avatar LogCreative commented on May 20, 2024

复现了这个 bug,触发条件:

  1. 第一个标题大于等于3行
  2. 使用双页模式
  3. 插图索引大于1页
\documentclass{sjtuthesis}
\begin{document}
    \frontmatter
    \listoffigures*

    \mainmatter
    \chapter{Test}
    
    \ExplSyntaxOn
    \int_step_inline:nn{10}{
    \begin{figure}
        % \caption{This~is~a~super~long~caption~that~needs~attention~in~the~list~of~figures~to~see~if~there~is~some~vertical~overflow.}
        \caption{这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题}
    \end{figure}
    }
    \ExplSyntaxOff
\end{document}

cc @AlexaraWu

from sjtuthesis.

Fang-Haoshu avatar Fang-Haoshu commented on May 20, 2024

当然最好的实践应该是每个图标题设定一个简短的标题放在插图索引中。

\caption[简短的标题]{这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题}

有道理

from sjtuthesis.

AlexaraWu avatar AlexaraWu commented on May 20, 2024

初步排查应该和 ctex\chapter\fixskip 选项相关,关闭此选项后没有问题。

from sjtuthesis.

LogCreative avatar LogCreative commented on May 20, 2024

试了一下普通的 itemize 是没问题的。最后发现是 \l@figure(被 tocloft 宏包重定义) 中关于 \interlinepenalty 的问题:

展开
\documentclass{sjtuthesis}

\makeatletter
\def\l@figure#1#2{
  \ifnum \c@lofdepth >\z@ 
  \vskip \cftbeforefigskip
  {
  \leftskip \cftfigindent \relax \rightskip \@tocrmarg \parfillskip -\rightskip
  \parindent \cftfigindent \relax \@afterindenttrue
  \interlinepenalty \@M      % <-- 注释这一行变为正常
  \leavevmode \@tempdima \cftfignumwidth \relax \let \@cftbsnum \cftfigpresnum
  \let \@cftasnum \cftfigaftersnum \let \@cftasnumb \cftfigaftersnumb \advance
  \leftskip \@tempdima \null \nobreak \hskip -\leftskip {\cftfigfont #1}\nobreak
  \cftfigfillnum {#2}
  }
  \fi
}

\begin{document}

\frontmatter

\listoffigures

\mainmatter

\makeatletter
\SJTU@head*{测试}
\makeatother

\begin{itemize}
\ExplSyntaxOn
\int_step_inline:nn { 10 }
  {
    \item[图1-1]
      这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题\par\vskip1ex plus 5pt minus 5pt
  }
\ExplSyntaxOff
\end{itemize}

\chapter{测试2}

\ExplSyntaxOn
\int_step_inline:nn{10}{
\begin{figure}
    % \caption{This~is~a~super~long~caption~that~needs~attention~in~the~list~of~figures~to~see~if~there~is~some~vertical~overflow.}
    \caption{这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题这是一个超级长的标题}
\end{figure}
}
\ExplSyntaxOff

\end{document}

from sjtuthesis.

LogCreative avatar LogCreative commented on May 20, 2024

\@M10000,如果把这行改为 \interlinepenalty 9849 就是正常, \interlinepenalty 9850 就是异常。

from sjtuthesis.

LogCreative avatar LogCreative commented on May 20, 2024

这是为了阻止每个项目内部的断页,应该跟这个问题没关

from sjtuthesis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.