使用Microtype错误后Tex容量错误

使用Microtype错误后Tex容量错误

当我尝试使用 Microtype 包时,尝试使用 pdflatex 编译我的文件时出现错误。错误信息为:TeX 容量超出,抱歉 [输入堆栈大小=5000]。\end{titlepage}。

当我从序言中排除 Microtype 包时,一切都很好。有人知道这里的问题是什么吗?我在 MikeTex 和 TeXstudio 上都试过了。

我的序言:

    \documentclass[11pt]{article}
 \linespread{1}
\usepackage[textwidth=155mm,top=23.5mm,bottom=23.5mm,footskip=40pt]   {geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{xparse}
\usepackage{tabularx}
\usepackage{numprint}
\usepackage{rotating}
 \usepackage{rotfloat}
\usepackage{rccol}
\usepackage[authoryear,round]{natbib}
\usepackage{apalike}
\usepackage{amsmath}
\usepackage{siunitx}
\usepackage{dcolumn}
\newcolumntype{d}{D{.}{.}{3}}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage[table,xcdraw]{xcolor}
\usepackage{amssymb}
\usepackage{booktabs}
\usepackage{float}
\usepackage{bigfoot}
\usepackage{mathtools}
\usepackage[table,xcdraw]{xcolor}
\usepackage{longtable}
\usepackage{grffile}
\usepackage{array}
\usepackage{pdflscape}
\usepackage{array}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\usepackage{geometry}
\usepackage{epstopdf}
\usepackage{caption}
\usepackage{lscape}
\usepackage{xcolor,colortbl}
\newcommand{\done}{\cellcolor{teal}done}  %{0.9}
\newcommand{\hcyan}[1]{{\color{teal} #1}}
 \def\Item$#1${\item $\displaystyle#1$
\hfill\refstepcounter{equation}(\theequation)}
 \usepackage{natbib}
 \setlength{\bibsep}{5ex}
 \usepackage{url}
 \setlength{\parskip}{0.1 em}
 \usepackage{setspace}
 \setstretch{1.1}
 \usepackage{microtype}
 \NewDocumentCommand{\sym}{m}{#1}
    \usepackage[english]{babel} 

感谢您的帮助。

雅尼克

答案1

帮自己一个忙:尝试以更合理的方式组织你的序言。我注释掉了几个包,因为它们的工作已经以siunitx更好的方式完成了。

我还删除了重复的内容并更改了一些定义。

\documentclass[11pt]{article}

% page setup
\usepackage[
  textwidth=155mm,
  top=23.5mm,
  bottom=23.5mm,
  footskip=40pt,
  heightrounded, % <--- recommended
]{geometry}

% input and output
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

% fonts
\usepackage{microtype}
%\usepackage{lmodern} % or other font package

% math
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amssymb}

% general packages
\usepackage{xparse}
\usepackage[table,xcdraw]{xcolor}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{rotating}
\usepackage{float}
\usepackage{rotfloat}
\usepackage{pdflscape}
\usepackage{caption}
\usepackage{url}
\usepackage{setspace}

% tables and numbers
\usepackage{array}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{longtable}
%\usepackage{numprint} % siunitx does better
%\usepackage{rccol} % siunitx does better
%\usepackage{dcolumn} % siunitx does better

% bibliography
\usepackage[authoryear,round]{natbib}
\usepackage{apalike}

% footnotes
\usepackage{bigfoot}

% for filler text
\usepackage{blindtext}

% personal commands
\newcolumntype{d}{D{.}{.}{3}}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}

\NewDocumentCommand{\sym}{m}{#1}
\newcommand{\done}{\cellcolor{teal}done}%{0.9}
\newcommand{\hcyan}[1]{\textcolor{teal}{#1}} % better \textcolor
\def\Item$#1${%
  \item $\displaystyle#1$\hfill\refstepcounter{equation}(\theequation)%
}

% final settings
\setlength{\bibsep}{5ex}
%\setlength{\parskip}{0.1 em}% not if you have \setstretch
\setstretch{1.1}

\begin{document}

\section{Test}

A footnote\footnote{Abc}

\blinddocument

\end{document}

本文档已使用 TeX Live 从 2012 年到 2016 年进行测试,没有出现任何错误。

答案2

发布的序言会出现错误

! No room for a new \count .

在 2015 年及以后的乳胶版本中,直到bigfoot更新为止,您可以将其移至序言的末尾,之后它会与etex包中的警告一起使用,您可以在此上下文中忽略该警告。

以下完整文档运行无错误

\documentclass[11pt]{article}
 \linespread{1}
\usepackage[textwidth=155mm,top=23.5mm,bottom=23.5mm,footskip=40pt]   {geometry}
% \usepackage{geometry} already loaded

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{xparse}

\usepackage{numprint}
\usepackage{rotating}
 \usepackage{rotfloat}
\usepackage{rccol}
\usepackage[authoryear,round]{natbib}
% \usepackage{natbib} already loaded

\usepackage{apalike}
\usepackage{mathtools}
%\usepackage{amsmath} loaded by mathtools

\usepackage{siunitx}

\usepackage{dcolumn}
\usepackage{tabularx}
% \usepackage{array} loaded by dcolumn and tabularx
% \usepackage{array} loaded by array

\newcolumntype{d}{D{.}{.}{3}}
\usepackage{booktabs}
% \usepackage{booktabs} already loaded


\usepackage[table,xcdraw]{xcolor}
%\usepackage[table,xcdraw]{xcolor} already loaded
%\usepackage{xcolor,colortbl} xcolor already loaded
\usepackage{colortbl}

\usepackage{amssymb}
\usepackage{float}


\usepackage{longtable}
\usepackage{grffile}
% \usepackage{graphicx} loaded by grffile

\usepackage{pdflscape}
% \usepackage{lscape} loaded by pdflscape

\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}

% \usepackage{epstopdf} probably not needed (done automatically)

\usepackage{caption}

\newcommand{\done}{\cellcolor{teal}done}  %{0.9}
\newcommand{\hcyan}[1]{{\color{teal} #1}}
 \def\Item$#1${\item $\displaystyle#1$
\hfill\refstepcounter{equation}(\theequation)}

 \setlength{\bibsep}{5ex}
 \usepackage{url}
 \setlength{\parskip}{0.1 em}
 \usepackage{setspace}
 \setstretch{1.1}
 \usepackage{microtype}% doesn't cause any error in this example
 \NewDocumentCommand{\sym}{m}{#1}
\usepackage[english]{babel} 


\usepackage{bigfoot}%needs to be late to avoid the no room for a new count error

\begin{document}

\begin{titlepage}
hello
\end{titlepage}
\end{document}

相关内容