加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

LaTeX兼容处理:Command \newfloat already defined--memoir

(2012-07-16 20:46:25)
标签:

杂谈

分类: LATEX使用技巧
memoir类与一些宏包兼容的时候,会产生如下错误,错误提示内容提示如下:
 
一,
! LaTeX Error: Command \newfloat already defined.
               Or name \end... illegal, see p.192 of the manual.

演示代码如下:

\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.
               Or name \end... illegal, see p.192 of the manual.

解决方案如下:在subfigure宏包前添加如下代码即可。

\makeatletter
\let\c@lofdepth\relax
\let\c@lotdepth\relax
\makeatother
\usepackage{subfigure}

 

二,

 

! LaTeX Error: Command \proof already defined.
               Or name \end... illegal, see p.192 of the manual.

  1. Open your document.

  2. From the Typeset menu, choose Preamble.

  3. 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

  4. Choose OK.

  OR 注释掉 模板中的 amsthm宏包 即可

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有