我的部分文本消失了!

我的部分文本消失了!

我正在使用 WinEdt 10(64 位)。今天,我发现了一个我无法理解的奇怪行为。如果有人能解释为什么我的部分文本会由于文本中的语法错误而消失,我将不胜感激!

当我编译最后一句末尾有语法错误的文本时,部分文本会在输出 pdf 中消失(下图显示了我的 latex 文件的快照,其中末尾有一个重复的单词“to”,其 pdf 输出缺少第二行的部分内容): 在此处输入图片描述

在此处输入图片描述

当我通过删除重复的单词“to”来修复语法错误时,消失的部分又出现了!有人能理解为什么 winedt/latex 会这样吗?

在此处输入图片描述

在此处输入图片描述

需要澄清的是:pdf 快照中的行是页尾行和标题行,因此它们不是文本的一部分。

答案1

我的文档中也遇到了同样的问题(遗憾的是也无法上传 MWE),并按照以下建议“解决”了它沙利文一条评论

稍微改变一下间距

尽管这不是真正的解决方案,而只是针对症状,但这是我获得正确 PDF 的唯一方法。

就我的情况而言,只需在文档中将:(冒号,空格)替换为(冒号,反斜杠,空格)就足够了,这只会改变很小的间距。:\

细节

对于那些对这个问题感兴趣的人,我把我的序言放在这里。我删除了所有我 100% 确定与问题无关的行,例如\newcommand,,\tikzstyle...。由于问题会随着最轻微的变化而消失,因此序言仍然很长。

正如序言中所述,注释掉该行\newcounter{unusedCounter}可以“解决”该问题。代码中没有其他地方使用计数器。

错误案例中的编译日志文件显示 bibtex 部分的最后一个计数器: \c@cbx@tempcntd=\count512

也许有人知道这是否意味着什么。我的意思是,与问题同时出现的 2 的高次方很可能与该问题有关。尽管如此,我还是更改了其他几行,导致编译也出现\c@cbx@tempcntd=\count512,但 pdf 输出是正确的。

序言:

\documentclass[11pt, a4paper, twoside, cleardoublepage=plain, openright, hyphens]{scrbook}

\usepackage{etex}
\usepackage[utf8]{inputenc}
\usepackage[russian, ngerman, main=english, australian]{babel}
\usepackage[cmex10]{amsmath}
\usepackage{algcompatible}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\usepackage{subcaption}
\usepackage{amssymb}
\usepackage{blindtext}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{tikz}
\usepackage[normalem]{ulem}
\usetikzlibrary{shapes,arrows,fit,calc}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{backgrounds,calc,circuits.logic.US,positioning,intersections}
\usetikzlibrary{patterns, patterns.meta}
\usetikzlibrary{decorations.pathreplacing,angles,quotes}
\usetikzlibrary{shapes.geometric}
\usepackage{circuitikz}
\usepackage{graphicx}
\usepackage{makecell}
\usepackage{xspace}
\usepackage{arydshln}
\usepackage{mathtools}
\usepackage[usestackEOL]{stackengine}
\usepackage{scalerel}
\usepackage{titletoc}
\usepackage{enumerate}
\usepackage{lmodern}
\usepackage{bibentry}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage[official]{eurosym}
\usepackage{amsthm}
\usepackage{soul}
\usepackage[most]{tcolorbox}
\usepackage[T1]{fontenc}
\usepackage{pifont}
\usepackage{pdftexcmds}
\usepackage{catchfile}
\usepackage{ifluatex}
\usepackage{ifplatform}
\usepackage{ifthen}
\usepackage{cancel}
\usepackage{microtype}
\usepackage{mathtools}
\usepackage{pdflscape}
\usepackage{enumitem}
\usepackage{filecontents}
\usepackage{etoolbox}
\usepackage{framed}
\usepackage{fancyhdr}
\usepackage{xpatch}

\newcommand{\pageeq}[2]{\ifthenelse{\pageref{#1}=\pageref{#2}}{p.~\pageref{#1}}{pp.~\pageref{#1}-\pageref{#2}}}
\newcommand{\Pageeq}[2]{\ifthenelse{\pageref{#1}=\pageref{#2}}{Page~\pageref{#1}}{Pages~\pageref{#1}-\pageref{#2}}}

\let\newclassictheorem\newtheorem 
\let\classicproof\proof

\tcbset{
    thmbox/.style={
        enhanced,
        breakable,
        sharp corners=all,
        fonttitle=\bfseries\normalsize,
        fontupper=\normalsize\itshape,
        top=0mm,
        bottom=0mm,
        right=0mm,
        colback=white,
        colframe=white,
        colbacktitle=white,
        coltitle=black,
        attach boxed title to top left,
        boxed title style={empty, size=minimal, bottom=1.5mm},
        overlay unbroken ={
            \draw (title.south west)--(title.south east);
            \draw ([xshift=3.5mm]frame.north west)|-%
            (frame.south east)--(frame.north east);},
        overlay first={
            \draw (title.south west)--(title.south east); 
            \draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);
            \draw (frame.north east)--(frame.south east);},
        overlay middle={
            \draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);
            \draw (frame.north east)--(frame.south east);},
        overlay last={
            \draw ([xshift=3.5mm]frame.north west)|-%
            (frame.south east)--(frame.north east);},
    },
    L/.style={thmbox, 
        overlay unbroken ={
            \draw (title.south west)--(title.south east);
            \draw ([xshift=3.5mm]frame.north west)|-([xshift=15mm]frame.south west);},
        overlay first={
            \draw (title.south west)--(title.south east); 
            \draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);},
        overlay middle={
            \draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);},
        overlay last={
            \draw ([xshift=3.5mm]frame.north west)|-([xshift=15mm]frame.south west);},
    },
    LQ/.style={thmbox, 
        overlay unbroken ={
            \draw (title.south west)--(title.south east);
            \draw ([xshift=3.5mm]frame.north west)|-([xshift=15mm]frame.south west);
            \node[anchor=east] at (frame.south east) {$\square$};},
        overlay first={
            \draw (title.south west)--(title.south east); 
            \draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);},
        overlay middle={
            \draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);},
        overlay last={
            \draw ([xshift=3.5mm]frame.north west)|-([xshift=15mm]frame.south west);
            \node[anchor=east] at (frame.south east) {$\square$};},
    },
}


\newcommand*\quotefont{\fontfamily{LinuxLibertineT-LF}}

\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}} 
\fancyhead{}
\fancyhead[RO]{\slshape\nouppercase{\rightmark}}
\fancyhead[LE]{\slshape\nouppercase{\leftmark}}
\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}

\newclassictheorem{hypothesis}[]{Hypothesis}

\newtcbtheorem[number within = section]{theobox}{Theorem}{thmbox,L, 
    before skip=1em plus 0.5em,
    after skip=1em plus 0.5em}{thm}
\newtcbtheorem[use counter from=theobox]{defbox}{Definition}{thmbox,L, description delimiters parenthesis, separator sign none, 
    before skip=1em plus 0.5em,
    after skip=1em plus 0.5em,
fontupper=\normalfont}{def}
%% Many more \newtcbtheorem[use counter from=theobox] 
\newtcbtheorem[]{proofbox}{Proof}{thmbox,LQ,
    before skip=1em plus 0.5em,
    after skip=1em plus 0.5em}{proof}

\newcommand{\thmCounter}{tcb@cnt@theobox}

\newclassictheorem{algo}[\thmCounter]{Algorithm}
\newclassictheorem{algo-sketch}[\thmCounter]{Algorithm Sketch}

\makeatletter
\renewcommand\thealgorithm{\thesection.\arabic{\thmCounter}} 
\@addtoreset{algorithm}{\thmCounter} 
\makeatother


%%%%%%%%%%%%%%%%% % Comment the following line out to dissolve problem
\newcounter{unusedCounter}
%%%%%%%%%%%%%%%%%


\usepackage[
backend=biber,
style=ieee,
sorting=nyt,
bibencoding=utf8,
defernumbers=true,
maxnames=10,
citestyle=numeric-comp
]{biblatex}

\assignrefcontextkeyws[labelprefix=J]{J}
\assignrefcontextkeyws[labelprefix=C]{C}
\assignrefcontextkeyws[labelprefix=B]{B}
\assignrefcontextkeyws[labelprefix=W]{W}

% Pseudo-Code
\makeatletter
\def\BState{\State\hskip-\ALG@thistlm}
\makeatother

% \hyphenation, \newcommand, \tikzstyle, ...
\usepackage[bookmarks=false]{hyperref} 

相关内容