zepinglee / gbt7714-bibtex-style

GB/T 7714-2015 BibTeX Style
LaTeX Project Public License v1.3c
1.15k stars 196 forks source link

一直报错是怎么回事呢?!Latex Error:Missing \begin{document} #139

Closed dadadaray closed 6 months ago

dadadaray commented 10 months ago

如果不用这个包,则没事。急。哪位大佬知道下~~

zepinglee commented 10 months ago

给出复现问题的代码。

dadadaray commented 10 months ago

需要安装这个包吗,是不是把这个文件解压到ctex 的宏包目录呀。我一会贴下错误代码。调了一天了呜呜呜。

dadadaray commented 10 months ago
\tools\ctex\MiKTeX\tex\latex\gbt7714\examples\gbt7714.sty

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.1 .
     ./gbt7714.sty
? 

上边是错误的代码。 我把包解压到latex安装宏包目录。 若用xelatex 运行,则出现下面问题:

(D:\tools\ctex\MiKTeX\tex\latex\graphics\mathcolor.ltx
! Undefined control sequence.
l.20 \seq_new:N
                \g_@@_seq
? 

下面是我的main函数:

% !Mode:: "TeX:UTF-8"
\documentclass[doctor,twoside]{bnuthesis}
\usepackage{gbt7714}
\bibliographystyle{gbt7714-numerical}
% \documentclass[%
%   bachelor|master|doctor, % 学士、硕士、博士 
%   xetex|pdftex|dvips|dvipdfm, % 可选编译方式
%   openany|operight,  % 连续页面,或者右侧打开
%   secret,  % 是否涉密
%   arialtoc,arialtitle]{bnuthesis}

% 所有其它可能用到的包都统一放在这里,可以根据实际需要添加或者删除。
\usepackage{bnutils}
\usepackage{amsmath,amsfonts}
\usepackage{array}

% 你可以在这里修改配置文件中的定义,导言区可以使用中文。
% \def\myname{薛瑞尼}

%ray
\usepackage{setspace}
\setlength{\parskip}{0pt}
\usepackage{rotating}
\usepackage{etoolbox}

%\raggedbottome{2023年8月}
%\setlength{\topmargin}{25mm}
\setlength{\oddsidemargin}{25mm}
\setlength{\evensidemargin}{20mm}
\setlength{\textwidth}{\paperwidth-45mm}
\setlength{\textheight}{\paperheight-73mm}
%\setlength{\footskip}{20mm}

%\usepackage[bottom=20mm]{geometry}

\begin{document}
% 定义所有的eps文件在figures子目录下
\graphicspath{{figures/}}

%%% 封面部分
\frontmatter

\input{data/cover}
\addtocontents{toc}{\protect\setcounter{tocdepth}{-2}}
\makecover

% 目录
\tableofcontents
\tableofengcontents % 英文目录

% 插图索引
\listoffigures
% 表格索引
\listoftables

% 符号对照表
\input{data/denotation}
\addtocontents{toc}{\protect\setcounter{tocdepth}{2}}

\newpage
\thispagestyle{bnu@plain}
\mbox{}
%%% 正文部分
\mainmatter
\include{data/chap01}
\include{data/chap02}
\include{data/chap03}
\include{data/chap04}
\include{data/chap05}
\include{data/chap06}
\include{data/chap07}

%%% 其它部分

\newpage
\thispagestyle{bnu@plain}
\mbox{}
\clearpage 

\echapternonumber{References}
% 调整参考文献页码

% 设置参考文献样式和文件
\bibliographystyle{bnubib}
\bibliography{ref/refs}
 % 参考文献

% 附录
%\begin{appendix}
%\input{data/appendix01}
%\end{appendix}
% 
% % 学术成果

\include{data/paper}
% 致谢

\include{data/ack}

\end{document}
zepinglee commented 10 months ago

需要安装这个包吗,是不是把这个文件解压到ctex 的宏包目录呀。

TeX Live 最新的发行版会自带。也可以将 .sty.bst 文件跟主文档放在同一目录下。但是我没有用 CTeX 套装编译测试过,可能有别的问题。

我一会贴下错误代码。调了一天了呜呜呜。

如果你提供更详细的编译环境、报错等信息,而不是这些无关信息,我们都能节省时间。

zepinglee commented 10 months ago
\tools\ctex\MiKTeX\tex\latex\gbt7714\examples\gbt7714.sty

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.1 .
     ./gbt7714.sty
? 

上边是错误的代码。

这是用 pdflatex 编译得到的报错吗?

我把包解压到latex安装宏包目录。 若用xelatex 运行,则出现下面问题:

(D:\tools\ctex\MiKTeX\tex\latex\graphics\mathcolor.ltx
! Undefined control sequence.
l.20 \seq_new:N
                \g_@@_seq
? 

建议你找模板的文档确认一下,一般不要用老旧的 CTeX 套装。

另外有没有模板的链接?