\documentclass[a4paper]{ltxdoc} \usepackage[english]{babel}% \usepackage[latin1]{inputenc}% \usepackage[T1]{fontenc}% \usepackage{textcomp}% \usepackage{bera}% \usepackage{microtype} \usepackage{url}% \usepackage{attachfile}% \usepackage{marginnote}% \usepackage{tabularx} \usepackage{makeidx} \usepackage{moredefs,lips} \usepackage{footmisc} \usepackage{natbib} \usepackage{multicol} \usepackage{listings} \usepackage[svgnames]{xcolor} \usepackage{ltxdocext}% \usepackage{hyperref} \usepackage{pdfcomment} %\usepackage{acrofont}% \CodelineIndex %\EnableCrossrefs %\setfnsymbol{wiley} %\makeatletter %\def\tableofcontents{\@starttoc{toc}} %\makeatother \renewcommand{\arg}[1]{% {\ttfamily\string{}\meta{#1}{\ttfamily\string}}% \index{#1=\string\ttt{#1}, Argument}\index{Argument>#1=\string\ttt{#1}}% }% \renewcommand{\oarg}[1]{% {\ttfamily[%] }\meta{#1}{\ttfamily%[ ]}% \index{#1=\string\ttt{#1}, optionales Argument}% \index{Argument, optional>#1=\string\ttt{#1}}% }% \renewcommand\env{\name@idx{Umgebung}}% \renewcommand*{\file}[1]{% {\ttfamily#1}% \index{#1=\string\ttt{#1}}\index{Datei>#1=\string\ttt{#1}}% }% \newcommand\styleoption{\name@idx{Styleoption}}% \newcommand\stylename{\name@idx{Dokumentenstyle}}% \def\name@idx#1#2{% {\ttfamily#2}% \index{#2\space#1=\string\ttt{#2}\space#1}\index{#1>#2=\string\ttt{#2}}% }% \newcommand*\margcs[1]{\marginnote{\raggedleft\scriptsize #1}} \newcommand*\package[1]{\texttt{#1}\index{#1=\string\ttt{#1}}} \newcommand*\mco[1]{\mbox{\LANGLE\itshape#1\RANGLE}\index{#1, Klassenoptionwert}\index{Klassenoptionwert>#1}} \setlength\parindent{0pt} \makeatletter \renewcommand\@biblabel[1]{\makebox[1.5cm][l]{[#1]}} \makeatother \hypersetup{pdfauthor={Josef Kleber},pdftitle={A user-friendly interface to pdf annotations},pdfsubject={Documentation for LaTeX style pdfcomment.sty}} \begin{document} \bibliographystyle{alphadin} \title{\substyle{pdfcomment.sty} v1.0\footnote{\protect\href{mailto:pdfcomment.sty@pdfcomment.josef-kleber.de}{\texttt{pdfcomment.sty@pdfcomment.josef-kleber.de}}}\\A user-friendly interface to pdf annotations\footnote{\protect\href{http://pdfcomment.josef-kleber.de}{\texttt{http://pdfcomment.josef-kleber.de}}}} \author{Josef Kleber\footnote{\protect\href{mailto:josef.kleber@gmx.de}{\texttt{josef.kleber@gmx.de}}}} \date{\today} \maketitle \begin{abstract} For a long time \texttt{pdflatex}\footnote{Please note that this package is only applicable using \texttt{pdflatex}}\index{pdflatex} offers the command \cmd\pdfannot{} for inserting arbitrary pdf annotations. However, in a form where additional knowledge of the pdf reference is indispensable. \substyle{pdfcomment.sty} is an answer to the -- from time to time -- emerging questions in newsgroups, how one could use the comment function of \texttt{Adobe Reader}. At least out of the \LaTeX{} code \substyle{pdfcomment.sty} offers a convenient and user-friendly possibility to use pdf annotations in pdf files. Unfortunately the support of pdf annotations by pdf viewers is only partly available to nonexistent. The reference viewer for the development of this package is \texttt{Adobe Reader}. If you can't see this annotation \pdfcomment[author={Josef Kleber},subject={Test annotation},color=lime,hspace=18pt]{This is an annotation} you are definitely using the wrong pdf viewer! \end{abstract} \vfill \begin{center} \subsubsection*{Required packages for using \substyle{pdfcomment.sty}} \fbox{\parbox[t]{.8\linewidth}{\small \package{hyperref}, \package{xkeyval}, \package{ifpdf}, \package{marginnote} and the packages loaded by them.}} \end{center} \vfill \clearpage %\begin{multicols}{2} %[\section*{Inhaltsverzeichnis} %\setlength{\columnseprule}{.4pt} %\setlength{\columnsep}{18pt}] %\tableofcontents %\end{multicols} \tableofcontents \clearpage \section{Options} The following options are useable as style options as well as options for the commands presented in section \ref{sec:befehle}. As style options they have global effect, whereas they have only local effect when used in commands. Furthermore global options are not overwritten. \subsection[\texttt{subject}]{\styleoption{subject}}\label{sec:subject} You can use the option \styleoption{subject} for defining the subject of the pdf popup annotations. \subsection[\texttt{author}]{\styleoption{author}}\label{sec:author} You can use the option \styleoption{author} for defining the author of the pdf popup annotations. \subsection[\texttt{color}]{\styleoption{color}}\label{sec:color} You can use the option \styleoption{color} for defining the color of pdf annotations in the form \{0.34 0.56 0.12\} (RGB). If you are using the additional package \package{xcolor} you can use predefined color names, as well as the available optional color names. Furthermore you can use the command \cmd\definecolor{} to define your own named colors. Please take a look at the attached example \file{example.tex}.\marginnote{\attachfile[author={Josef Kleber},subject={example.tex},description={source code: example.tex} ,mimetype={text/plain}, icon={Tag}]{example.tex}} It shows the different possibilities of defining colors. \subsection[\texttt{icon}]{\styleoption{icon}}\label{sec:icon} You can use the option \styleoption{icon} for defining the graphic used for the pdf text annotations. The following icons are defined as mandatory by the pdf reference: \bigskip\pdfcommentsetup{author={Josef Kleber},subject={Icon overview}} \texttt{Comment} \hspace{1em} \pdfcomment[icon=Comment,color=Ivory]{Options: icon=Comment,color=Ivory} \hfill \texttt{Key} \hspace{1em} \pdfcomment[icon=Key,color=Khaki]{Options: icon=Key,color=Khaki} \hfill \texttt{Note} \hspace{1em} \pdfcomment[icon=Note,color=LavenderBlush]{Options: icon=Note,color=LavenderBlush} \hfill \texttt{Help} \hspace{1em} \pdfcomment[icon=Help,color=CornflowerBlue]{Options: icon=Help,color=CornflowerBlue} \bigskip \hspace*{1cm}\texttt{NewParagraph} \hspace{1em} \pdfcomment[icon=NewParagraph,color=SkyBlue]{Options: icon=NewParagraph,color=SkyBlue} \hfill \texttt{Paragraph} \hspace{1em} \pdfcomment[icon=Paragraph,color=SpringGreen]{Options: icon=Paragraph,color=SpringGreen} \hfill \texttt{Insert} \hspace{1em} \pdfcomment[icon=Insert,color=PaleTurquoise]{Options: Insert,color=PaleTurquoise}\hspace{0pt}\hspace*{1cm} \bigskip Furthermore the following icons are also supported by \texttt{Adobe Reader} and some other pdf viewers: \bigskip \texttt{Check} \hspace{1em} \pdfcomment[icon=Check,color=Orchid]{Options: icon=Check,color=Orchid} \hfill \texttt{Circle} \hspace{1em} \pdfcomment[icon=Circle,color=LightCyan]{Options: icon=Circle,color=LightCyan} \hfill \texttt{Cross} \hspace{1em} \pdfcomment[icon=Cross,color=Bisque]{Options: icon=Cross,color=Bisque} \bigskip \hspace*{1cm}\texttt{Star} \hspace{1em} \pdfcomment[icon=Star,color=Aquamarine]{Options: icon=Star,color=Aquamarine} \hfill \texttt{RightArrow} \hspace{1em} \pdfcomment[icon=RightArrow,color=Gainsboro]{Options: icon=RightArrow,color=Gainsboro} \hfill \texttt{RightPointer} \hspace{1em} \pdfcomment[icon=RightPointer,color=Salmon]{Options: icon=RightPointer,color=Salmon}\hspace*{1cm} \bigskip \hspace*{2.5cm}\texttt{UpArrow} \hspace{1em} \pdfcomment[icon=UpArrow,color=Teal]{Options: icon=UpArrow,color=Teal} \hfill \texttt{UpLeftArrow} \hspace{1em} \pdfcomment[icon=UpLeftArrow,color=Magenta]{Options: icon=UpLeftArrow,color=Magenta}\hspace*{2.5cm} \bigskip \subsection[\texttt{open}]{\styleoption{open}}\label{sec:open} You can use the option \styleoption{open} for defining the opening status of the pdf popup annotations. Possible values are \texttt{true} or \texttt{false} (default). \subsection[\texttt{hspace}]{\styleoption{hspace}}\label{sec:hspace} You can use the option \styleoption{hspace} for defining the horizontal space after the pdf text annotations. \section{Commands}\label{sec:befehle} \subsection{Comment commands} You can use the following commands for commenting your documents. \subsubsection{\texorpdfstring{\cs{pdfcomment}}{\textbackslash pdfcomment}} \label{sec:pdfcomment} \cmd\pdfcomment \margcs{\cmd\pdfcomment\\\oarg{options}\marg{comment}} will typeset an annotation into the text at the current \pdfcommentsetup{subject={\textbackslash pdfcomment test},hspace=18pt}\pdfcomment[icon=Star,color=YellowGreen]{This is a comment in the text} position. \subsubsection{\texorpdfstring{\cs{pdfmargincomment}}{\textbackslash pdfmargincomment}} \label{sec:pdfmargincomment} \cmd\pdfmargincomment \margcs{\cmd\pdfmargincomment\\\oarg{options}\marg{comment}} will typeset an annotation into the margin. Please note the positioning of the annotation in this example. This documentation was written with the \LaTeX{} class \texttt{ltxdoc} \pdfcommentsetup{subject={\textbackslash pdfmargincomment test}}\pdfmargincomment[icon=Help,color=DeepPink,hspace=-30pt]{This is a comment in the margin}. Therefore the annotation is typeset into the left margin. \subsection{Misc. commands} \subsubsection{\texorpdfstring{\cs{pdfcommentsetup}}{\textbackslash pdfcommentsetup}} \label{sec:commentsetup} With the command \cmd\pdfcommentsetup \margcs{\cmd\pdfcommentsetup\marg{options}} you can reset the global options at any time. With it, e.g. a co-author can simply use a different optical look, without specifying the options in every comment command. { \clearpage \raggedright \nocite{*} \bibliography{pdfcomment} \addcontentsline{toc}{section}{\refname} } %for index \footnotesize \end{document}