我使用 todonotes 包,在表格中遇到了问题。我收到 Float(s) lost 错误。如何在表格单元格中使用 todonotes 包?
梅威瑟:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{ifthen}
\usepackage{xkeyval}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{calc}
\usepackage[
german,
textsize=tiny
]{todonotes}
\usepackage{showframe}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
some more text
and \todo[fancyline]{PSP Nr.} some more
\lipsum[2]
\begin{table}[htp]
\caption{default}
\begin{center}
\begin{tabular}{p{4cm}p{7cm}}
narrow text in table & some more narrow text in table\\
narrow text in table1 & some more %\todo[fancyline]{PSP Nr.} % <-- include this
narrow text in table1\\
\end{tabular}
\end{center}
\label{default}
\end{table}%
\end{document}
答案1
基本问题是您尝试将浮点数放在浮点数内。您可以使用文档中提供的脚注(也是浮点数)的解决方法todonotes
,加载marginnotes
包并替换\marginpar
为\marginnote
:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{ifthen}
\usepackage{xkeyval}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{calc}
\usepackage[
german,
textsize=tiny
]{todonotes}
\usepackage{showframe}
\usepackage{lipsum}
%important part starts here
\usepackage{marginnote}
\renewcommand{\marginpar}{\marginnote}
\begin{document}
\lipsum[1]
some more text
and \todo[fancyline]{PSP Nr.} some more
\lipsum[2]
\begin{table}[htp]
\caption{default}
\begin{center}
\begin{tabular}{p{4cm}p{7cm}}
narrow text in table & some more narrow text in table\\
narrow text in table1 & some more\todo[fancyline]{PSP Nr.} % <-- include this
narrow text in table1\\
\end{tabular}
\end{center}
\label{default}
\end{table}%
\end{document}