为页面边框上的表格文本创建注释

为页面边框上的表格文本创建注释

我有一张有 2 列的表格(用于词汇,也用于完整的句子),我想在其中一列的页面边框上添加注释。但是必须能够将注释与一组特定的单词相关联(以防我的词汇表上有一个完整的句子,而我只注释了句子中的一个或几个单词)。我想到过这样的事情。但是当您使用表格时,此包不起作用,我正在做什么):非常感谢您的任何提示!

答案1

非常粗略的草稿:

%&pdflatex
\documentclass{article}

\usepackage{tikz}

\newcommand\remarkomark[2]{%
  \tikz[remember picture,baseline=(start-#1.base)]%
    \node[draw=orange](start-#1){#2};%
}
\newcommand\remarkotext[2]{%
  \marginpar{\tikz[remember picture]%
    \node[fill=orange!20,rectangle,text width=\marginparwidth](end-#1){#2};}%
  \tikz[remember picture,overlay]%
    \draw[overlay,<-,thick,red] %
      (end-#1.west)-- ++ (-0.5\marginparsep,0)
      |- (start-#1.south);%
}

\newcommand\remarko[3]{%
  % #1 symbolic name for node positions
  % #2 marked text
  % #3 explanation in border
  \tikz[remember picture,baseline=(start-#1.base)]%
    \node[draw=orange](start-#1){#2};%
  %
  \marginpar{\tikz[remember picture]%
    \node[fill=orange!20,rectangle,text width=\marginparwidth](end-#1){#3};}%
  \tikz[remember picture,overlay]%
    \draw[overlay,<-,thick,red] %
      (end-#1.west)-- ++ (-0.5\marginparsep,0)
      |- (start-#1.south);%
}

\begin{document}
  It's just filling anyway. It's just filling anyway. It's just filling anyway.
  Lorem ipsum dolor \remarko{test}{sit}{or stand or whatever} amet.
  Does it make a difference what I write here? It's just filling anyway.
  It's just filling anyway. It's just filling anyway. It's just filling anyway.
  Lorem ipsum dolor \remarko{test2}{sit}{or stand or whatever, hell I might
  even be yodeling?} amet.
  \begin{table}\centering
  Does it make a difference what I write here?
  Lorem ipsum dolor \remarkomark{test3}{sit} amet.
  Does it make a difference what I write here?
  Lorem ipsum dolor \remarkomark{test4}{sit}{or stand or whatever} amet.
  Does it make a difference what I write here?
  \end{table}
  \remarkotext{test3}{or stand or whatever}
  \remarkotext{test4}{or stand or whatever, I might even be yodeling?}
\end{document}

仍需完成:

  • 正确的双弯路径
  • 双页模式

哦,它需要运行两次 pdflatex,当然,如果你的解释落在不同的页面上,它就会崩溃。但无论如何,在这种情况下你也无能为力。

答案2

我不太清楚你在找什么。我做了一个草率的例子,主要是为了看看我是否理解你在问什么。这是代码和 pdf。如果这接近你想要的,那么用宏来自动化这个会很容易。

\documentclass{article}
\usepackage{pst-all}
\begin{document}
\centerline{\bfseries My Table}\par
\begin{tabular}[t]{c|p{5cm}}
{\bfseries Vocables} & {\hfill\bfseries Explanations\hfill} \\\hline
\null\rule{0pt}{1pt} &  \\
{\red \framebox[1cm]{{\black blah}}} &
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent
tortor. Suspendisse scelerisque mi non risus. \\
{\blue \framebox[1cm]{{\black blee}}} &
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent
tortor. Suspendisse scelerisque mi non risus. \\
\end{tabular}

\marginpar{\red\framebox{%
\parbox{0.65in}{\black Lorem ipsum dolor sit amet, consectetur adipiscing elit.}}}

\marginpar{\blue\framebox{%
\parbox{0.65in}{\black Lorem ipsum dolor sit amet, consectetur adipiscing elit.}}}

\vspace{1cm}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent
tortor. Suspendisse scelerisque mi non risus. Duis vitae ligula eget
nunc fermentum malesuada. Class aptent taciti sociosqu ad litora
torquent per conubia nostra, per inceptos himenaeos. In ante ipsum,
iaculis quis, sollicitudin non, sagittis ut, tortor. Etiam rutrum.
Cras ut lectus at enim consectetur malesuada. Curabitur dui erat,
ultrices id, euismod vel, adipiscing at, mauris. Donec congue dui et
metus. Donec erat. Pellentesque cursus velit a velit. Morbi tincidunt
molestie diam. Nam molestie neque eget erat.
\end{document}

替代文本

相关内容