NRC 模板问题:段落在 \NRC@stripdef@ 完成之前结束

NRC 模板问题:段落在 \NRC@stripdef@ 完成之前结束

我想向 NRC 期刊投稿,按照指南,我想建立一个简单的示例,但是遇到了很多问题,需要帮助!

错误信息:

Command Line:   latex.exe --src --interaction=errorstopmode --synctex=-1 "test.tex"
Startup Folder: D:\TEST

我的.log

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9 64-bit)
entering extended mode
(D:\TEST\test.tex
LaTeX2e <2014/05/01>
Babel <3.9l> and hyphenation patterns for 68 languages loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\nrc\nrc2.cls"
Document Class: nrc2 2013/02/02 v2.01a NRC 2-column journal class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\fleqn.clo")
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))

Class nrc2 Warning: GUTenberg Babel french style detected -- 
(nrc2)              some corruption of NRC-defined format may occur.

("C:\Program Files\MiKTeX 2.9\tex\latex\tools\multicol.sty"))
("C:\Program Files\MiKTeX 2.9\tex\latex\babel\babel.sty"
*************************************
* Local config file bblopts.cfg used
*
("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\bblopts.cfg")
("C:\Program Files\MiKTeX 2.9\tex\latex\babel-french\frenchb.ldf"
("C:\Program Files\MiKTeX 2.9\tex\latex\babel\babel.def"))
("C:\Program Files\MiKTeX 2.9\tex\latex\babel-english\english.ldf"))
("C:\Program Files\MiKTeX 2.9\tex\latex\carlisle\scalefnt.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty") (D:\TEST\test.aux
) ("C:\Program Files\MiKTeX 2.9\tex\latex\psnfss\ot1ptm.fd")
Runaway argument?
\bbl@scset \refname \frenchrefname \bbl@scset \abstractname \frenchabstractname
 \ETC.
! Paragraph ended before \NRC@stripdef@ was complete.
<to be read again> 
                   \par 
l.162 

? 

文件.tex

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Typeset by                  , Research Press, NRC
%% Date:
%% NRC, <name of journal>
%%
%%%%%%%%%%%%%%
%%
%% 1. See original preamble material (at bottom of file) for
%%    details on source of current .tex file: conversion
%%    from word-processing program or author-generated TeX
%%    code.
%%
%% 2. This template includes most options and packages used by
%%    all the NRC journals. UNcomment those packages and options
%%    which are REQUIRED.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%% 1. Class file (nrc1 or nrc2) + options (see userguide, pp.1-2; p.9):
\documentclass[%%french,        %% use with \usepackage[french]{babel}
               %% leqno,         %% only for nrc1 (default is right eqno)
               reqno,         %% only for nrc2 (default is left eqno)
               nonumbib,      %% biblio entries without nos.
%
               %% breakaddress,  %% linebreak btwn author(s) + address(es)
               %% twocolid,      %% IDbox spans 2 cols
               %% twocolid*,     %% 2-col IDbox
               %% preprint,      %% removes identifying nos. from headers/footers
               %% proof,         %% `Proof/Epreuve' in footer
               %% pagnf,         %% `Pagination not final/Pagination non finale'
               %% trimmarks,     %% add trimmarks
               %% finalverso,    %% final blank verso NOT included in pagerange
]{nrc2}                          %% choose one: nrc1 or nrc2

%% NOTE: authors may use the following options, which should be
%%       DELETED once the file comes in-house:
%%
%%          usecmfonts    type1rest     genTeX


%% 2. Frequently used packages -- see pp.2-3 of userguide:
%%    a. graphics-related:
%%    \usepackage{graphicx}       %% color not usually needed
%%    \usepackage[figuresright]{rotating} %% for landscape tables

%%    b. math-related:
%%    \usepackage{amsmath}        %% math macros in wide use
%%    \usepackage{amssymb}        %% additional math symbols
%%    \usepackage{dcolumn}        %% decimal alignment for tables
%%    \usepackage{bm}             %% `bold math' via \bm command

%%    c. for website addresses:
%%    \usepackage{url}            %% inserts linebreaks automatically
%%    \NRCurl{url}

%%    d. biblio-related:
%%    \usepackage{cite}           %% enhances options for \cite commands

%%    e. for English-language papers:
    \usepackage[french,english]{babel}

%%    f. for French-language papers:
%%    \usepackage[english,french]{babel}  %% remember to add french as a
                                          %% CLASS option, above
%%    g. for ragged-right tables:
%%    \usepackage{array}
%%    \newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
%%    \let\PBS=\PreserveBackslash

%%    h. for left curly brace to span several lines of equations:
%%    \usepackage{cases}
%%    \expandafter\let\csname numc@left\expandafter\endcsname\csname
%%                 z@\endcsname


%% 3. Resetting float parameters:
%%    a. in nrc1:
%%    \renewcommand{\topfraction}{.95}
%%    \renewcommand{\textfraction}{.05}
%%    \renewcommand{\floatpagefraction}{.95}

%%    b. in nrc2:
%%    \renewcommand{\topfraction}{.95}
%%    \renewcommand{\floatpagefraction}{.95}
%%    \renewcommand{\dbltopfraction}{.95}
%%    \renewcommand{\textfraction}{.05}
%%    \renewcommand{\dblfloatpagefraction}{.95}


%% 4. Resetting journal-specific parameters:
%%    a. eqn nos. with section nos.:
%%    \numberby {equation}{section}
%%    \setcounter{equation}{0}

%%    b. in-line citations to use ( ) instead of default [ ]:
%%   \renewcommand{\citeleft}{(}
%%   \renewcommand{\citeright}{)}

%%    c. for JEES (to expand inter-line spacing; see p.12 of guide):
%%    \easebaselines


%% 5. Miscellaneous macros to always have available:
%%    a. shorthands:
\let\p=\phantom
\let\mc=\multicolumn

%%    b. struts for vertical spacing above/below rules in tables:
%%%%%%%%%%%%%%%%%%  beginning of Claudio Beccari's code:
%% Spacing commands for {tabular} (from TTN 2,3:10 -- Claudio
%%                                                    Beccari):
%% Usage: a. use \T to put space below a line
%%           (e.g., at top of a `cell' of text)
%%        b. use \B to put space above a line
%%           (e.g., at bottom of a `cell' of text)
\newcommand\T{\rule{0pt}{2.6ex}}            % = `top' strut
\newcommand\B{\rule[-1.2ex]{0pt}{0pt}}      % = `bottom' strut
%%%%%%%%%%%%%%%%%%  end of Claudio's code

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   end of class and package
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   options, additional macros


%% Journal-specific information for opening page -- pp.9-11 of guide:
%% a. numbers:
\setcounter{page}{1}             %% replace 1 with starting page no.
\volyear{XX}{2001}               %% volume, year of journal
\journal{Can. Geotech. J.}            %% jrnl. abbrev. (see App.A of guide)
\journalcode{cgj}                   %% jrnl. acro    (see App.A of guide)
\filenumber{}                    %% NRC file number
%% \filenumber*{}                %% prefixes \filenumber to all page nos.
                                 %% NOTE: COMMENT OUT class options
                                 %%             pagnf
                                 %%             proof
                                 %%       once no longer needed


%% b. dates:
\received{2014}                      %% insert date, no period
\revreceived{}                   %% <same>
\accepted{}                      %% <same>
\revaccepted{}                   %% <same>
%% \IDdates{}                       %% <same>. Use for `Revised ...' etc.
%% \webpub{}                        %% insert date
%% \commdate{}                      %% <same>


%% c. miscellaneous:
%%   \assoced{}                  %% insert name of Associate ed.
%%   \corred{}                   %% insert name of Corresponding ed.
%%   \dedication{}               %% insert text as neede
%%   \abbreviations{}            %% insert as needed

\begin{document}
%% Reversed titlebar -- see p.11 of userguide:
%% \specialtitle{}      %% for black stripe + text + regular title
%% \specialtitle*{}     %% black stripe + text only




%% Title, Author(s), Address(es) -- see p.4 of userguide for
%%    various options to save time and keyboarding, esp. where
%%    authors share same address(s).

\title{A Digital Image Processing Based Numerical Method for the Analysis on Permeability of Heterogeneous Geomaterials}

%% Author 1:
\author[J.L. Humar]{John Larry Humar} %% opt. arg. ONLY if IDbox
                                      %% name is diff. from
                                      %% titleblock name
\address{University of Waterloo}                            %% address of 1st author


%% Author 2:
\author{M.A. Rahgozar}
\address{}

%% Author 3:
\author{Fred Murray}
\address{}


\shortauthor{Humar, Rahgozar, and Murray} %% for headers

%%%%%%%%
%% This line goes here in nrc1.
%\maketitle 
%%%%%%%%


%% Abstract/Resume area -- see pp.5,12 of userguide:
\begin{abstract}
   Abstract text
%\keywords{Hello}
%\translation
\end{abstract}

%
\begin{resume}
   Texte du resume
%% \motscles{}
%% \Traduit %% or \traduit
\end{resume}
\maketitle
%%%%%%%%

%% This line goes here in nrc2.
%\maketitle         
%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%   END OF TEMPLATE   %%%%%%%%%%%%%%%%%%%%%%
%% Ch. -- 11 NOV 02
This is a template.
\end{document} 

答案1

这个问题似乎可以通过最新的 TeX 系统得到“解决”。但实际上并没有,因为这个问题只是因为内部变化而被绕过了,babel现在返回的是语言名称frenchb,而不是french语言名称。

该问题仍然存在于nrc2.cls类文件中;使用更新的(2015 年 11 月)TeX Live 2015 编译示例文件不会引发错误,就像使用 TeX Live 2014 一样。但是在语言调用中更改frenchfrenchb会再次出现错误。

从下面的代码可以清楚的看到问题所在:

161 \ifx\NRC@french@lang\@empty
162 \else
163   \AtBeginDocument{%
164     \expandafter\NRC@stripdef{\NRC@french@lang}\figurename
165     \expandafter\NRC@stripdef{\NRC@french@lang}\tablename
166     \expandafter\NRC@stripdef{\NRC@french@lang}\abstractname
167     \expandafter\NRC@stripdef{\NRC@french@lang}\refname
168     \@ifpackageloaded{babel}{%
169       \expandafter\addto\csname extras\NRC@french@lang\endcsname
170         {\bbl@nonfrenchitemize}%
171     }{}%
172   }
173 \fi

其中 TeX 被指示尝试扩展{,但这当然是无效的。

第 164–167 行应为

164     \expandafter\NRC@stripdef\expandafter{\NRC@french@lang}\figurename
165     \expandafter\NRC@stripdef\expandafter{\NRC@french@lang}\tablename
166     \expandafter\NRC@stripdef\expandafter{\NRC@french@lang}\abstractname
167     \expandafter\NRC@stripdef\expandafter{\NRC@french@lang}\refname

没有办法在文档级别解决该问题,因为代码是由类注入到“开始文档钩子”中的。在 NRC 修复代码之前,制作包含更改行的本地副本是唯一有效的措施。

答案2

关于这个问题似乎没有太多有效的建议。我更新了我的 TeX Live 编译器,突然间我所有的文章都出现了这个错误,无法编译。我不太擅长 LaTeX,但命令中似乎存在冲突:

\usepackage[french,english]{babel}

删除后,french我的 TeX 文件可以正确编译。法语部分的重音总是写得很慢(例如{\'e}),所以它仍然能够显示法语部分。我意识到我不是专家,但至少有了这个快速修复,我能够再次编译。

相关内容