为什么 bioinfo.cls 和 \usepackage{multicols} 之间存在冲突?

为什么 bioinfo.cls 和 \usepackage{multicols} 之间存在冲突?

为什么列出的行为这里发生?

回顾一下,生物信息学模板(可用这里和其他地方)与 一起使用时会导致标题被覆盖\usepackage{multicols}。为什么会发生这种情况?

我所指的一个例子如下:

在此处输入图片描述

请注意,此示例确实不是包含 multicol 包的任何使用;它的存在本身就导致了冲突。

需要说明的是,我试图从 LaTeX 用户的角度来理解这一点;这对于目前的任何特定作业或论文来说都不是必需的。我想知道答案,以便更好地掌握 TeX 和 LaTeX。

编辑:

以下是上面示例的代码:

\RequirePackage[demo]{graphicx}  % omit 'demo' option from real document
\documentclass{bioinfo}
%\documentclass{article}
\copyrightyear{2014}
\pubyear{2014}
\usepackage{multicol}

\begin{document}
\firstpage{1}

\title[QTL Analysis]{Evaluation of a QTL Dataset}
\author[Robert R. Gotwals]{Robert R. Gotwals\,\footnote{to whom correspondence should be addressed}}
\address{$^{1}$Department of XXXXXXX, Address XXXX etc.}

\history{Received on XXXXX; revised on XXXXX; accepted on XXXXX}
\editor{Gotwals}
\maketitle

\begin{abstract}

Here's the abstract. 

\section{Keywords:} first, second, third, fourth

%\section{Contact:} \href{[email protected]}{[email protected]}
\end{abstract}

\section{Introduction}
\subsection*{Get funky!}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore. Figure \ref{thrombin} is a display of thrombin. 
It's a long, long story... 
My hard drive was nearly full, and the computer wouldn't boot into Windows anymore.
Had a bunch of problems, MFT corruptions, BSODs, disk read errors...
Nothing worked. Then... in February or so, my sister gave me her old computer to use.
My brother removed all the stuff and reformatted it, and then whilst I was sleeping he put my HDD in sister's computer. The computer was now with two HDDs, and working again. (Mine is a MAXTOR and hers a Samsung)
About two days later I was prompted with a BSOD, about software. Looking up on Google (with an old machine) I find a solution but it would mean all my program settings would be deleted, or changed. Didn't care. So I did what was written on the article. Don't remember what happened next, but I know for sure that some programs wouldn't work, or had issues, including the antivirus (avast!), which would give me an error every hour or so. 
There wasn't a way to reinstall, it failed. So I just installed Avira. Stayed with it for some time until I noticed the sound was slowing down randomly, and chopping. I updated the audio drivers but it didn't work. Then I tried a number of things, but no luck. I uninstalled Avira (which was also giving me some errors), and the sound kind of improved, but it was still bad.
Whatever...
The Samsung hard drive also kept disappearing, both from Windows and BIOS, so anything stored on it wouldn't be accessible anymore. It would also make the dreaded clicking noise.

\subsection*{What ever }

Now the most recent stuff... and what is bugging me... this Saturday I was playing some games installed on my sister's hard drive. It was all okay until a clicking noise appeared. The game froze. That happened for a while until a BSOD came, which made me turn off the computer. I immediately thought the HDD was horrible and untrusted, or that a cable was loose.
The computer kept giving me a BSOD.
Left it alone for some time.
Midnight comes, I try starting up the computer, and the click strikes again. But this time with my HDD.
The BSOD was either there, or NTLDR failure, or the drive simply wouldn't be recognised.
It was probably dead, and there was nothing I could do to help.
I got to bed.
Waking up, mum says my computer is faster than ever. 
That was strange, since it was very slow before. But who cares, the hard drive wasn't dead after all. Or so I thought.
Turns out my brother had formatted the Samsung drive (sister's) without telling me, or asking for permission.
Everything that I had was lost, or at least missing.
I then took a peek and Windows said my drive had:
232 GBs of 232 GBs total.
I am now hopeless. I am pretty sure I lost everything, but perhaps there is a small chance of recovering my data. Never made any backups, since there was no way to. I don't have any external drives with me, and the computers we have available have very small capacity. 
It was over 200 GB of data. Everything was important to me. I had thousands and thousands of folders. It would take a long time to search and copy the files.
My mum who knows nothing about computers, told me it might be empty because it's borked. But she also doesn't believe that my stuff is missing.
I can access it fine without any errors. I don't want to put anything there, though, in fears of (hidden) data getting overwritten. All my fault, I'm 

\begin{figure}[ht!]
\includegraphics[scale=0.25]{Thrombin.png}
\caption{Thrombin}
\label{thrombin}
\end{figure}

\end{document}

答案1

这太奇怪了:-)

原因就是里面的这段代码\maketitle

\if@twocolumn
  \ifnum \col@number=\@ne
    \@maketitle
  \else
    \twocolumn[\@maketitle]%
  \fi
\else

这实际上是从 中找到的代码的直接复制article.cls

Now\col@number仅在 LaTeX 内核中设置(为 1 或 2),并且上面的代码是唯一使用它的地方。我花了一段时间才想出为什么在 1994 年添加它,更改日志只说它被添加了 :-)

据我所知,它是为了让某人写

\twocolumn[\maketitle]

\twocolumn设置\col@number=2和, \@twocolumntrue但如果是可选参数,它会在本地设置\col@number回 1。因此,\maketitle可选参数中的a\twocolumn只会执行\@maketitle,而不会执行\twocolumn[\@maketitle],这可能是一个灾难,因为这意味着您会在调用\twocolumn内部得到另一个调用\twocolumn

到目前为止一切都很好,但如果multicol只是加载,为什么会出现问题?

只是因为该包明确设置\col@number=1在顶层,导致标题仅设置在第一列(除了它实际上是一个全宽的框):

%    To allow checking whether some macro is used within the \mc{}
%    environment the counter |\col@number| gets a default of |1|
%    outside the the environment.
% \changes{v1.3d}{1991/10/23}{\cs{col@number} set to one}
%    \begin{macrocode}
\col@number = 1

现在它是 1991 年的,而 LaTeX 似乎是\col@number在 1994 年添加的,所以我想可以说这不是multicol错。另一方面,我很可能是将它添加到内核中的人,或者至少没有抱怨(我知道我已经有它了,multicol所以无论如何这都是一个自发的问题)。

那么如何修复?\twocolumn加载后重新应用multicol,例如,

\usepackage{multicol}
\twocolumn

multicol然而,正如 Mico 正确指出的那样,双列文档的目的是什么?

有人可能会认为可以使用它,例如,

在此处输入图片描述

但这只是看上去有效……一旦多列环境超出列大小,它就会彻底失败(因为它会开始一个新页面(而不是一个新列))。因此,您只能将它用在框内,而不能用在主垂直厨房中。

也许我可以更新 multicol 以使其正常工作\twocolumn,但我确实没有看到它的很多应用程序。

编辑2016

我最终进行了初始化,\col@number因此在顶层它现在将反映 LaTeX 所设置的任何内容(即,它将在双列模式下工作,但只能以上述有限的方式工作(基本上如果在框中使用或仅用于非常短的文本))。

相关内容