如何在表格中添加待办事项

如何在表格中添加待办事项

我使用 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} 

在此处输入图片描述

相关内容