LaTeX兼容处理:Command \newfloat already defined--memoir
(2012-07-16 20:46:25)
标签:
杂谈 |
分类: LATEX使用技巧 |
! LaTeX Error: Command \newfloat already defined.
演示代码如下:
\documentclass[12pt]{memoir}
%preamble
\usepackage{floatrow}
\usepackage{calc}
\usepackage{siunitx}
\usepackage{tikz}
\usepackage{amsmath}
\usetikzlibrary{arrows,trees,shapes}
\usetikzlibrary
{decorations.pathmorphing,decorations.shapes,decorations.pathreplacing}
\usepackage{pgfplots}
\usepackage{multirow}
\usepackage{array}
\usepackage{cancel}
\usetikzlibrary{topaths}
\begin{document}
\begin{figure}[htb]
\begin{tikzpicture}
\end{tikzpicture}
\caption{...}\label{fig:...}
\end{figure}
\end{document}
memoir本身有自己创建浮动体的方法,因此加载 floatrow宏的时候会报错。解决方案是在
\usepackage{floatrow}之前添加语句 \let\newfloat\undefined
代码选自:http://newsgroups.derkeiler.com/Archive/Comp/comp.text.tex/2009-07/msg00211.html
问题二:memoir宏包和 subfigure宏包同样也会产生类似的问题,报错信息如下:
! LaTeX Error: Command \c@lofdepth
already defined.
解决方案如下:在subfigure宏包前添加如下代码即可。
\makeatletter
\let\c@lofdepth\relax
\let\c@lotdepth\relax
\makeatother
\usepackage{subfigure}
二,
! LaTeX Error: Command \proof already
defined.
-
Open your document.
-
From the Typeset menu, choose Preamble.
-
Replace the single line:
\newenvironment{proof}[1][Proof]{\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
with these lines:
\iffalse
\newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\fi
-
Choose OK.