![如何在表格中添加待办事项](https://linux22.com/image/365775/%E5%A6%82%E4%BD%95%E5%9C%A8%E8%A1%A8%E6%A0%BC%E4%B8%AD%E6%B7%BB%E5%8A%A0%E5%BE%85%E5%8A%9E%E4%BA%8B%E9%A1%B9.png)
我使用 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}