summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pdfcomment/example_math_markup.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-09-11 00:44:51 +0000
committerKarl Berry <karl@freefriends.org>2010-09-11 00:44:51 +0000
commit7a4867398aac7e40c1ebf080c02bcd8b8f2f64b1 (patch)
treee2367ef9a449608927346f75bd10f3b437cce8c9 /Master/texmf-dist/doc/latex/pdfcomment/example_math_markup.tex
parent0c0cbb6bdf8cafc26e784fc01c5554c79b92af50 (diff)
pdfcomment 1.6 (15aug10)
git-svn-id: svn://tug.org/texlive/trunk@19651 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/pdfcomment/example_math_markup.tex')
-rw-r--r--Master/texmf-dist/doc/latex/pdfcomment/example_math_markup.tex117
1 files changed, 117 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/pdfcomment/example_math_markup.tex b/Master/texmf-dist/doc/latex/pdfcomment/example_math_markup.tex
new file mode 100644
index 00000000000..2c0315b1f51
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pdfcomment/example_math_markup.tex
@@ -0,0 +1,117 @@
+\documentclass[pagesize,11pt,leqno]{scrartcl}
+\usepackage[english]{babel}
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{lmodern}
+\usepackage[leading=1.08]{stonehand}
+\usepackage[svgnames,rgb]{xcolor}
+\usepackage{listings}
+\usepackage[author={Josef Kleber},subject={Math test},color=Khaki]{pdfcomment}
+\begin{document}
+\setlength{\parindent}{0pt}
+\addtokomafont{section}{\normalfont\normalcolor\bfseries}
+\setkomafont{title}{\normalfont\normalcolor\bfseries}
+\author{Josef Kleber}
+\title{Using \texttt{\string\pdfmarkupcomment}\ in math mode}
+\lstset{language=[LaTeX]TeX,numbers=left,numberstyle=\tiny,basicstyle=\ttfamily\small,frame=single,backgroundcolor=\color{LightGoldenrodYellow},keywordstyle=\color{Blue},emph={mathstyle,style}, emphstyle=\color{Tomato},emph={[2]mathpopup},emphstyle={[2]\color{SeaGreen}},morekeywords={pdfmarkupcomment,[,]}}
+\definestyle{mathpopup}{author={},subject={},color=NavajoWhite,markup=Highlight}
+\hypersetup{pdfauthor={Josef Kleber},pdftitle={Using \textbackslash{}pdfmarkupcomment in math mode},pdfsubject={An example file for demonstrating the usage of \textbackslash{}pdfmarkupcomment in math mode},colorlinks=true,pdfborder={0 0 0},linkcolor=blue,citecolor=blue}%
+\maketitle
+\section{Simple formulas}
+PDF annotations work in inline formula ($\pdfmarkupcomment[style=mathpopup]{\sum_{i=1}^{n}i=\frac{1}{2}n\cdot(n+1)}{comment}$), as well as in display mode:
+
+\[\pdfmarkupcomment[style=mathpopup,mathstyle=\displaystyle]{f(x)=\prod_{i=1}^{n}\left(i-\frac{1}{2i}\right)}{comment}\]
+
+\bigskip
+Of course, you can only comment parts of a formula:
+
+\bigskip
+\begin{tabular}{cc}
+\begin{minipage}{0.26\linewidth}
+\[(a+b=c)^{\pdfmarkupcomment[style=mathpopup]{d+e}{comment}}\]
+\end{minipage} &
+\begin{minipage}{0.68\linewidth}
+\begin{lstlisting}
+\[(a+b=c)^{\pdfmarkupcomment[style=mathpopup]
+{d+e}{comment}}\]
+\end{lstlisting}
+\end{minipage}
+\end{tabular}
+
+\bigskip
+As you can see the size of the PDF annoation is too big! The math content is set into a box to measure the size. Unfortunately, the math context gets lost, which results in a wrong size, as the math snippets are set as inline formula into the box by default. You can correct this with the option \texttt{mathstyle} (\texttt{\string\textstyle, \string\displaystyle, \string\scriptstyle, \string\scriptscriptstyle})
+
+\bigskip
+\begin{tabular}{cc}
+\begin{minipage}{0.25\linewidth}
+\[(a+b=c)^{\pdfmarkupcomment[style=mathpopup,mathstyle=\scriptstyle]{d+e}{comment}}\]
+\end{minipage} &
+\begin{minipage}{0.68\linewidth}
+\begin{lstlisting}
+\[(a+b=c)^{\pdfmarkupcomment[style=mathpopup,
+mathstyle=\scriptstyle]{d+e}{comment}}\]
+\end{lstlisting}
+\end{minipage}
+\end{tabular}
+
+\bigskip
+Of course, it also works with equations:
+
+\bigskip
+\begin{tabular}{cc}
+\begin{minipage}{0.41\linewidth}
+\begin{equation}
+\pdfmarkupcomment[style=mathpopup,mathstyle=\displaystyle]{\sum_{i=1}^{n}i=\frac{1}{2}n\cdot(n+1)}{comment}
+\end{equation}\label{eq:display}
+\end{minipage} &
+\begin{minipage}{0.52\linewidth}
+\begin{lstlisting}
+\begin{equation}
+\pdfmarkupcomment[style=mathpopup,
+mathstyle=\displaystyle]
+{\sum_{i=1}^{n}i=\frac{1}{2}n
+\cdot(n+1)}{comment}
+\end{equation}\label{eq:display}
+\end{lstlisting}
+\end{minipage}
+\end{tabular}
+
+\bigskip
+In formula \ref{eq:display} \texttt{mathsytle=\string\displaystyle} was used.
+
+\section{Complex formulas}
+If you use more complex environments like \texttt{eqnarry*}, you can no longer comment the complete formula, as this would break the internals of the environment. Remember that you can only comment, what you can put into a math box (\${}math stuff\${}). Therefore, you can only comment parts of the complex formula:
+
+\bigskip
+\begin{tabular}{cc}
+\begin{minipage}{0.4\linewidth}
+\begin{eqnarray*}
+\pdfmarkupcomment[style=mathpopup]{\mathrm{left}}{comment} &
+\pdfmarkupcomment[style=mathpopup]{\mathrm{middle}}{comment} & \pdfmarkupcomment[style=mathpopup]{\mathrm{right}}{comment}\\
+\pdfmarkupcomment[style=mathpopup,mathstyle=\displaystyle]{\frac{1}{\sqrt{n}}}{comment} = & \pdfmarkupcomment[style=mathpopup,mathstyle=\displaystyle]{\frac{\sqrt{n}}{n}}{comment} = & \pdfmarkupcomment[style=mathpopup,mathstyle=\displaystyle]{\frac{n}{n\sqrt{n}}}{comment}
+\end{eqnarray*}
+\end{minipage} &
+\begin{minipage}{0.53\linewidth}
+\begin{lstlisting}
+\begin{eqnarray*}
+\pdfmarkupcomment[style=mathpopup]
+{\mathrm{left}}{comment} &
+\pdfmarkupcomment[style=mathpopup]
+{\mathrm{middle}}{comment} &
+\pdfmarkupcomment[style=mathpopup]
+{\mathrm{right}}{comment}\\
+\pdfmarkupcomment[style=mathpopup,
+mathstyle=\displaystyle]
+{\frac{1}{\sqrt{n}}}{comment} = &
+\pdfmarkupcomment[style=mathpopup,
+mathstyle=\displaystyle]
+{\frac{\sqrt{n}}{n}}{comment} = &
+\pdfmarkupcomment[style=mathpopup,
+mathstyle=\displaystyle]
+{\frac{n}{n\sqrt{n}}}{comment}
+\end{eqnarray*}
+\end{lstlisting}
+\end{minipage}
+\end{tabular}
+
+\end{document} \ No newline at end of file