Giter Site home page Giter Site logo

Comments (18)

allenwoods avatar allenwoods commented on May 10, 2024 1

artratex.sty

\captionsetup[figure][bi-first]{format=hang,hangindent=-0.5em}%
\captionsetup[figure][bi-second]{format=hang,hangindent=-2em,name=Figure}%
\captionsetup[table][bi-first]{format=hang,hangindent=-0.5em}%
\captionsetup[table][bi-second]{format=hang,hangindent=-2em,name=Table}%

替换为

\captionsetup[bi-first]{bi-first}
\captionsetup[bi-second]{bi-second}

\DeclareCaptionOption{bi-first}[format=hang,hangindent=-0.5em]{
  \def\tablename{表}
  \def\figurename{图}}
\DeclareCaptionOption{bi-second}[format=hang,hangindent=-2em]{
  \def\tablename{Table}
  \def\figurename{Figure}}

可使longtable环境支持bicaption

from ucasthesis.

mohuangrui avatar mohuangrui commented on May 10, 2024 1

更新后的 longtable 使用可见 跨页长表

from ucasthesis.

mohuangrui avatar mohuangrui commented on May 10, 2024 1

@allenwoods 刚去修改 跨页长表 时才发现原来那些功能都已在那个样例里了,那些英文字头就是在制表时加进去的,是我没认真读下全部内容,弄了个大乌龙 :D。

你的 {\bfseries 表 \thetable\ 续表} 改为 {\bfseries\small \tablename\ \thetable\ {续表}} 会更理想。

对了,因为我当前只有一个操作系统可用来测试,所以无法复现那个 Tex capacity exceeded 的问题,但我推测了一下问题的可能所在并进行了更新,请你有时间时测试一下看是否解决了问题。

感谢~

from ucasthesis.

mohuangrui avatar mohuangrui commented on May 10, 2024

你好,若无具体的代码样本,很难明白问题出在那里。注释掉caption就没问题并不意味着是caption或模板设置的问题。问题很可能仍出在你的制表的命令上,特别是缺少必要的换行命令或是对齐命令等。制表是LaTeX中最容易出错了,就我个人经验,99%问题最终都是出在制表命令的细节里,所以,仔细检查语法更为关键。

from ucasthesis.

zssasa avatar zssasa commented on May 10, 2024

你好!
我试了一个简单的例子,在 artracom.sty 末尾加上

\RequirePackage{longtable}
\RequirePackage{multirow}

然后正文例子来自 longtable example

\begin{longtable}{|c|c|c|c|}
       \caption{A simple longtable example}\\
	\hline
	\textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} & \textbf{Fourth entry} \\
	\hline
	\endfirsthead
	\multicolumn{4}{c}%
	{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
	\hline
	\textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} & \textbf{Fourth entry} \\
	\hline
	\endhead
	\hline \multicolumn{4}{r}{\textit{Continued on next page}} \\
	\endfoot
	\hline
	\endlastfoot
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
\end{longtable}

编译会报错

Misplaced \noalign

如果注释掉artratex.sty 258-264行关于caption的内容则可通过。
我想知道注释掉后影响大么?
谢谢啦!!

from ucasthesis.

mohuangrui avatar mohuangrui commented on May 10, 2024

测试了一下,问题确实存在,而且是一个尴尬的问题,问题的核心出在longtable的自带的caption的设计上。冲突不在你注释掉的所有行,只有:

\captionsetup[table][bi-first]{format=hang,hangindent=-0.5em}%
\captionsetup[table][bi-second]{format=hang,hangindent=-2em,name=Table}%

只需注释掉这一行即可,但其导致的问题就是你的普通table的标题若用bicaption命令,则第二个标题无法是“Table”而是“表”,解决的办法是:

1) 不用longtable,只需用普通的table环境,请慎重考虑一个跨页的longtable的必要性,至少我是不愿去读这样一个表的。

2) 若坚持用longtable,只需注释掉如下行

%\captionsetup[table][bi-first]{format=hang,hangindent=-0.5em}%
%\captionsetup[table][bi-second]{format=hang,hangindent=-2em,name=Table}%

然后所有table(包括普通的和longtable)的双语标题的实现都如如下样例:

\begin{longtable}{|c|c|c|c|}
    \caption[这是一个样表]{这是一个样表\\Table~\ref{tab:longtab} A simple longtable example}\label{tab:longtab}\\
	\hline
	\textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} & \textbf{Fourth entry} \\
	\hline
	\endfirsthead
	\multicolumn{4}{c}%
	{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
	\hline
	\textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} & \textbf{Fourth entry} \\
	\hline
	\endhead
	\hline \multicolumn{4}{r}{\textit{Continued on next page}} \\
	\endfoot
	\hline
	\endlastfoot
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
	1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
\end{longtable}

其结果如图

image

最后,longtable跨页所产生的英文注释,我也不知如何解决

祝好

from ucasthesis.

byronwwang avatar byronwwang commented on May 10, 2024

没有longtable,会出警告。
image

from ucasthesis.

mohuangrui avatar mohuangrui commented on May 10, 2024

@allenwoods 但是悬挂缩进无效。。。

from ucasthesis.

mohuangrui avatar mohuangrui commented on May 10, 2024

@allenwoods 根据 tex.se 1 以为两种形式是等价的,没想到效果确实有不一样。

根据 tex.se 2 ,bicaption 作者说解决了此问题,但用替换前的形式确实与 longtable 不兼容,而用替换后的形式,虽然与 longtable 兼容, 则导致缩进选项无效。

再次读了下 caption 和 bicaption 宏包文档,可设定的参数实在是很多。试得昏天暗地的,但还好最终试出了一套方案,现已更新,请测试。

感谢提醒~

from ucasthesis.

allenwoods avatar allenwoods commented on May 10, 2024

感谢修复~已测试可用,悬挂缩进没有怎么注意,没看出前后差别😂

另外,跨页产生的英文注释是指这个吗?
image

在表格\endfirsthead后添加

\endfirsthead
  %
  \multicolumn{5}{c}%
  {{\bfseries\thetable\ 续表}} \\
  \endhead
  \bottomrule
  \multicolumn{5}{r}{\textit{续表见下页}} \\
  %
  \endfoot
  %
  \endlastfoot

可以换为中文,效果如下:

image

from ucasthesis.

allenwoods avatar allenwoods commented on May 10, 2024

另,更新模板后会出现

TeX capacity exceeded, sorry [input stack size=5000].
\reserved@a ->\def \reserved@a 

经查似乎是因为URL的问题,回退到之前的版本就没有问题。

from ucasthesis.

mohuangrui avatar mohuangrui commented on May 10, 2024

@allenwoods

  1. 悬挂缩进无效是指你最开始提供的替换方案会导致图标的长标题不再缩进。
  2. 好的,谢谢提供续表的修改方案~
  3. 请问
TeX capacity exceeded, sorry [input stack size=5000].
\reserved@a ->\def \reserved@a

是怎么出现的呢?我当前用 texlive + xelatex 无法复现这一问题,可以把你编译生成的 .log 文件发过来吗?

from ucasthesis.

allenwoods avatar allenwoods commented on May 10, 2024

测试了下,还是不成功,log如下:
Thesis.log

bat编译后仍然会正常弹出pdf,但是没有参考文献以后的内容。
另外我才发现,使用之前的版本也会有问题,参考文献没有数字。

会不会和我的内容有关?附上我的bib文件
citations.zip

from ucasthesis.

allenwoods avatar allenwoods commented on May 10, 2024

删除引用中的URL后原版本style可用,但新的还是无法编译参考文献以后内容。
我测试了注释掉附录的数据,以及\RequirePackage后仍然无法编译。

附件为我目前用的版本,供参考
0215ucasthesis.zip

我的编译环境是Win10+TexLive2018,添加了

% !TEX program = xelatex
% !BIB program = bibtex

另外我也在MacTex下进行了测试,pa xa出现和Win下一样的错误,la提示许多字体找不到。

from ucasthesis.

allenwoods avatar allenwoods commented on May 10, 2024

另外Win下和Mac下编译失败有些不同,Win下仍会生成目录,直到附录一节。Mac编译后的PDF没有目录。

from ucasthesis.

mohuangrui avatar mohuangrui commented on May 10, 2024

@allenwoods 你好,测试是一个比较复杂的过程,特别是信息掌握不全时,很难发现问题所在,从而需要尽量保证测试过程是有序受控的。

当发现问题并进行测试时,

  1. 请首先只测试下载的未经任何改动的ucasthesis,看是否问题存在。若存在,则可确认是模版的问题,若不存在,则进行第2步。

  2. 测试你自己的论文文档,若第1步没问题,而这一步出了问题,问题很可能则是在你的使用上。

根据你目前所提供的信息,不知道你直接测试下载的最新模版有没有问题,你当前的文档编译失败,可能是你的模版更新时出了问题,因为最近的几次更新对 几个超链接命令进行了修改,改动涉及到了 Thesis.tex, Frontpage.tex,Prematter.tex 等文件,从而移植文档时需比较细心才行。建议的更新移植方法请见: 更新指南

from ucasthesis.

allenwoods avatar allenwoods commented on May 10, 2024

OK,我还是先把毕业论文写完再改吧🤣

from ucasthesis.

mohuangrui avatar mohuangrui commented on May 10, 2024

是的,我再仔细看了下你的Thesis.log文件,应该是你在更新时沿用了你的旧的Thesis.tex。Thesis.tex 里有一个 intotoc 命令是用来添加参考文献的目录和书签的,而最新版里,对这个命令的功能进行了扩充和拓展,因而\intotoc命令的使用方式与以前是不一样的,若不修改,就会报错:D

你是对的,先把论文写完是最重要的,研究LaTeX最容易变成一种对写论文的逃避和拖延:D

from ucasthesis.

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.