Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Usage
-----

Download [pdfpcnotes.sty](https://raw.github.com/cebe/pdfpc-latex-notes/master/pdfpcnotes.sty)
from github and put it somewhere where latex can find it.
from github and put it somewhere where latex can find it.
The same directory as your `.tex` file will work.

Add `\usepackage{pdfpcnotes}` somewhere before `\begin{document}` in your `.tex`-file.
Expand All @@ -21,6 +21,11 @@ Behavior will be the same but it will additionally write notes to file in pdfpc
When running for example `pdflatex` you will end up with an additional `.pdfpc` file that
will automatically be recognized by pdfpc and displays your notes nicely in the notes section on your control screen.

Options
-------

- `formatting`: Automatically post-process the generated file to fix
newline and paragraph formatting. (requires `-shell-escape`)

Anything not working yet?
-------------------------
Expand Down
15 changes: 13 additions & 2 deletions pdfpcnotes.sty
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
\ProvidesPackage{pdfpcnotes}

\newif\ifpdfpcnotes@formatting
\DeclareOption{formatting}{\pdfpcnotes@formattingtrue}
\ProcessOptions\relax

% create a new file handle
\newwrite\pdfpcnotesfile

Expand All @@ -9,10 +13,14 @@
\immediate\write\pdfpcnotesfile{[notes]}
}
% define a # http://tex.stackexchange.com/a/37757/10327
% also define a \
\begingroup
\catcode`\#=12
\gdef\hashchar{#}%
\endgroup
\catcode `\|=0
\catcode `\\=11
|gdef|bschar{\}
|endgroup


\def\lastframenumber{0}
Expand All @@ -38,5 +46,8 @@
% close file on \begin{document}
\AtEndDocument{%
\immediate\closeout\pdfpcnotesfile
\ifpdfpcnotes@formatting
\immediate\write18{sed -i 's/\bschar\bschar\bschar\bschar/\bschar n/g' \jobname.pdfpc}
\immediate\write18{sed -i 's/\bschar\bschar par /\bschar n\bschar n/g' \jobname.pdfpc}
\fi
}