summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-07-06 21:28:20 +0000
committerKarl Berry <karl@freefriends.org>2017-07-06 21:28:20 +0000
commitc42ed950c46f42b713218d67e694ec05041734ba (patch)
treeacb59c17d9fa02c8d45cc7cfe4940446b9a7ec05
parent4344c241bb6300f064703c309f98ea1fa550fc21 (diff)
zebra-goodies (6jul17)
git-svn-id: svn://tug.org/texlive/trunk@44760 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/zebra-goodies/README.md46
-rw-r--r--Master/texmf-dist/tex/latex/zebra-goodies/zebra-goodies.sty127
-rwxr-xr-xMaster/tlpkg/bin/tlpkg-ctan-check3
-rw-r--r--Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc1
-rw-r--r--Master/tlpkg/tlpsrc/zebra-goodies.tlpsrc0
5 files changed, 176 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/zebra-goodies/README.md b/Master/texmf-dist/doc/latex/zebra-goodies/README.md
new file mode 100644
index 00000000000..db6c3bec3ce
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/zebra-goodies/README.md
@@ -0,0 +1,46 @@
+# zebra-goodies
+
+A collection of handy macros for paper writing in my group. Do remove this
+package once the paper is finished.
+
+This is not intended for general cases. Use it at your own risk.
+
+## Options
+
+* `draft`: boolean option, whether to show the notes. Enabled by default. Example to disable it:
+
+```latex
+\usepackage[draft=false]{zebra-goodies}
+```
+
+* `microtype`: boolean option, whether to load package `microtype`. Enabled by default.
+
+## Take Notes
+
+Add comments, todos, anything you like during revise in a colorful way. The package also summarizes the revise notes at the end of the document. Predefined commands are as follows:
+
+```latex
+\todo[<who>]{bla bla}
+\fixed[<who>]{bla bla}
+\comment[<who>]{bla bla}
+\note[<who>]{bla bla}
+\placeholder[<who>]{bla bla}
+```
+
+To define new note commands:
+
+```latex
+% \zebranewnote{<note name>}{<xcolor color>}
+\zebranewnote{question}{red!80}
+
+\question{what's this?}
+```
+
+## Use Colors
+
+Several colors are provided via `xcolor` for ploting:
+- `zebrablue`
+- `zebrared`
+- `zebrayellow`
+- `zebrapurple`
+- `zebragreen`
diff --git a/Master/texmf-dist/tex/latex/zebra-goodies/zebra-goodies.sty b/Master/texmf-dist/tex/latex/zebra-goodies/zebra-goodies.sty
new file mode 100644
index 00000000000..6f87fe2bdfd
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/zebra-goodies/zebra-goodies.sty
@@ -0,0 +1,127 @@
+%% Copyright (C) 2017 by Ruini Xue <xueruini@gmail.com>
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3a
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3a or later is part of all distributions of LaTeX
+%% version 2004/10/01 or later.
+\ProvidesPackage{zebra-goodies}[2017/07/05 0.1.0 LaTeX goodies for paper writing.]
+
+\RequirePackage{kvoptions}
+\SetupKeyvalOptions{
+ family=zebra,
+ prefix=zebr@,
+ setkeys=\kvsetkeys}
+\DeclareBoolOption{draft}
+\DeclareBoolOption{microtype}
+\setkeys{zebra}{draft,microtype}
+\ProcessKeyvalOptions{zebra}
+
+% comment this if you do not need.
+\ifzebr@microtype
+ \RequirePackage{microtype}
+\fi
+\RequirePackage[table]{xcolor}
+\RequirePackage{tikzpagenodes}
+\RequirePackage{marginnote}
+\RequirePackage{manfnt}
+
+%%%%%%%%%%%%%%%%%%
+% zebra-note
+%%%%%%%%%%%%%%%%%%
+
+% From: http://tex.stackexchange.com/questions/247449/making-marginnote-to-appear-either-side-of-twocolumn-twoside-document-part-ii
+% I did a little edit.
+\newlength{\zebr@tempdima}
+\newcount{\zebr@tikzpage}
+
+\newcommand*{\zebr@marginnote}[1]{%
+ \begin{tikzpicture}[remember picture, overlay]%
+ \pgfextractx{\zebr@tempdima}{\pgfpointanchor{current page text area}{center}}%
+ \global\zebr@tempdima=\zebr@tempdima
+ \global\zebr@tikzpage=\oddpage@page
+ \end{tikzpicture}%
+ \begingroup
+ \ifdim\zebr@tempdima>0pt \reversemarginpar\fi
+ \marginnote{#1}%
+ \endgroup% resets \reversemarginpar
+}
+
+\def\zebr@note{%
+ \ifzebr@draft\expandafter\zebr@note@\else\expandafter\@gobblefour\fi}
+
+% #1: note name
+% #2: color
+% #3: assignee
+% #4: note text
+\newcommand{\zebr@note@}[4]{%
+ \zebr@marginnote{\textcolor{#2}{\dbend}}%
+ \expandafter\stepcounter{zebr@num@#1}%
+ \textcolor{#2}{[\textbf{\MakeUppercase{#1}\textit{#3}:} #4]}}
+
+\newcommand{\zebr@prepend}[2]{%
+ \ifx\relax#2\relax\relax\else#1#2\fi}
+
+\def\zebranewnote#1#2{%
+ \@ifundefined{#1}{\zebr@newnote{#1}{#2}}{%
+ \PackageWarning{zebra}{zebra already defines note: '#1'}}}
+\global\def\zebr@noteslist{}
+\def\zebr@newnote#1#2{%
+ \g@addto@macro\zebr@noteslist{,#1}%
+ \expandafter\newcounter\expandafter{zebr@num@#1}
+ \expandafter\newcommand\csname zebr@color@#1\endcsname{#2}
+ \expandafter\newcommand\csname #1\endcsname[2][]{%
+ \zebr@note{#1}{#2}{\zebr@prepend{@}{##1}}{##2}}}
+
+\def\zebr@listnotes{%
+ \ifzebr@draft\zebr@listnotes@\fi}
+
+\def\zebr@listnotes@{%
+ \def\temp@a{}
+ \edef\temp@noteslist{\expandafter\@gobble\zebr@noteslist}
+ \@for\temp@b:=\temp@noteslist\do{%
+ \expandafter\ifnum\expandafter\value\expandafter{zebr@num@\temp@b} > 0%
+ \def\temp@c{\expandafter\csname thezebr@num@\temp@b\endcsname}
+ \edef\temp@d{\noexpand\textcolor{\expandafter\csname zebr@color@\temp@b\endcsname}{\temp@b} \noexpand & \temp@c \noexpand\\}
+ \expandafter\g@addto@macro\expandafter\temp@a\expandafter{\temp@d}%
+ \fi}
+ \ifx\temp@a\@empty\else%
+ \noindent\dotfill\par
+ \section*{Zebra Notes}
+ \par \medskip
+ \begin{center}
+ \rowcolors{1}{gray!10}{white}
+ \begin{tabular}{lr}
+ \hline
+ Type & Number \\\hline
+ \temp@a
+ \hline
+ \end{tabular}
+ \par \medskip
+ \textbf{Do fix all of them before submitting.}
+ \end{center}
+ \fi}
+
+\AtEndDocument{\zebr@listnotes}
+
+\zebranewnote{todo}{purple}
+\zebranewnote{fixed}{teal}
+\zebranewnote{comment}{blue}
+\zebranewnote{note}{violet}
+\zebranewnote{placeholder}{gray}
+
+%%%%%%%%%%%%%%
+% zebra-color
+%%%%%%%%%%%%%%
+\definecolor{zebrablue}{HTML}{4F81BD}
+\definecolor{zebrared}{HTML}{C0504D}
+\definecolor{zebragreen}{HTML}{9BBB00}
+\definecolor{zebrapurple}{HTML}{9F4C7C}
+\definecolor{zebrayellow}{HTML}{D9CD2E}
+\definecolor{zebragreen2}{HTML}{00E000}
+
+\endinput
diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check
index 3a3dc1a8fa8..005150d6db1 100755
--- a/Master/tlpkg/bin/tlpkg-ctan-check
+++ b/Master/tlpkg/bin/tlpkg-ctan-check
@@ -678,7 +678,8 @@ my @TLP_working = qw(
yafoot yagusylo yaletter yannisgr yathesis yax
ycbook ydoc yfonts yfonts-t1 yhmath
yinit-otf york-thesis youngtab yplan ytableau
- zed-csp zhnumber ziffer zhmetrics zhmetrics-uptex zhspacing zlmtt
+ zebra-goodies zed-csp
+ zhnumber zhmetrics zhmetrics-uptex zhspacing ziffer zlmtt
zwgetfdate zwpagelayout
zxjafbfont zxjafont zxjatype
);
diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
index cbeb6d10a85..938c825902e 100644
--- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
+++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
@@ -1146,6 +1146,7 @@ depend yagusylo
depend ycbook
depend ydoc
depend yplan
+depend zebra-goodies
depend zed-csp
depend ziffer
depend zwgetfdate
diff --git a/Master/tlpkg/tlpsrc/zebra-goodies.tlpsrc b/Master/tlpkg/tlpsrc/zebra-goodies.tlpsrc
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Master/tlpkg/tlpsrc/zebra-goodies.tlpsrc