Initial commit
This commit is contained in:
28
figs/libs/Makefile
Normal file
28
figs/libs/Makefile
Normal file
@ -0,0 +1,28 @@
|
||||
PROJECTNAME=$(basename $(basename $(wildcard *.tikz.tex)))
|
||||
LIBS=$(notdir $(wildcard libs/*))
|
||||
|
||||
PDFS=$(addsuffix .pdf, $(PROJECTNAME))
|
||||
|
||||
all: $(PDFS)
|
||||
|
||||
$(PDFS): $(LIBS)
|
||||
echo $(LIBS)
|
||||
pdflatex -jobname $(basename $@) -file-line-error $(patsubst %.pdf, %.tikz.tex, $@)
|
||||
|
||||
install: $(PDFS)
|
||||
cp $^ $(INSTALLDIR)/
|
||||
|
||||
$(LIBS):
|
||||
ln -fs libs/$@ ./
|
||||
|
||||
clean-libs:
|
||||
rm -f $(LIBS)
|
||||
|
||||
clean-aux:
|
||||
rm -f $(addsuffix .aux, $(PROJECTNAME))
|
||||
rm -f $(addsuffix .log, $(PROJECTNAME))
|
||||
|
||||
clean-tex:
|
||||
rm -f $(PDFS)
|
||||
|
||||
clean: clean-libs clean-aux clean-tex
|
81
figs/libs/shapes.sty
Normal file
81
figs/libs/shapes.sty
Normal file
@ -0,0 +1,81 @@
|
||||
% square lattice (width #1, height #2, origin #3, spacing #4)
|
||||
\def\grid#1#2#3{
|
||||
\foreach\i in {0,...,#2}{
|
||||
\draw#3++(0,\i)--++(#1,0);
|
||||
}
|
||||
\foreach\i in {0,...,#1}{
|
||||
\draw#3++(\i,0)--++(0,#2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
% 3-staircase (color #1, position #2)
|
||||
% speedup
|
||||
\def\staircase#1#2{
|
||||
\fill[color=#1]#2++(-0.5,-0.5)--++(3,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,-3);
|
||||
\draw[color=white]#2++(-0.5,0)--++(3,0);
|
||||
\draw[color=white]#2++(-0.5,1)--++(2,0);
|
||||
\draw[color=white]#2++(-0.5,2)--++(1,0);
|
||||
\draw[color=white]#2++(0,-0.5)--++(0,3);
|
||||
\draw[color=white]#2++(1,-0.5)--++(0,2);
|
||||
\draw[color=white]#2++(2,-0.5)--++(0,1);
|
||||
\draw[color=black]#2++(-0.5,-0.5)--++(3,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,-3);
|
||||
}
|
||||
%\def\staircase#1#2{
|
||||
% \fill[color=#1]#2++(-0.5,-0.5)--++(3,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,-3);
|
||||
% \begin{scope}
|
||||
% \clip#2++(-0.5,-0.5)--++(3,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,-3);
|
||||
% \grid44{[color=white]#2++(-1,-1)}
|
||||
% \end{scope}
|
||||
% \draw[color=black]#2++(-0.5,-0.5)--++(3,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,-3);
|
||||
%}
|
||||
|
||||
% 4-staircase (color #1, position #2)
|
||||
\def\Staircase#1#2{
|
||||
\fill[color=#1]#2++(-0.5,-0.5)--++(4,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,-4);
|
||||
\begin{scope}
|
||||
\clip#2++(-0.5,-0.5)--++(4,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,-4);
|
||||
\grid55{[color=white]#2++(-1,-1)}
|
||||
\end{scope}
|
||||
\draw[color=black]#2++(-0.5,-0.5)--++(4,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,-4);
|
||||
}
|
||||
|
||||
% 5-staircase (color #1, position #2)
|
||||
\def\staircaseV#1#2{
|
||||
\fill[color=#1]#2++(-0.5,-0.5)--++(5,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,-5);
|
||||
\begin{scope}
|
||||
\clip#2++(-0.5,-0.5)--++(5,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,-5);
|
||||
\grid55{[color=white]#2++(-1,-1)}
|
||||
\end{scope}
|
||||
\draw[color=black]#2++(-0.5,-0.5)--++(5,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,1)--++(-1,0)--++(0,-5);
|
||||
}
|
||||
|
||||
% square (color #1, position #2)
|
||||
\def\square#1#2{
|
||||
\fill[color=#1]#2++(-0.5,-0.5)--++(1,0)--++(0,1)--++(-1,0)--++(0,-1);
|
||||
\begin{scope}
|
||||
\clip#2++(-0.5,-0.5)--++(1,0)--++(0,1)--++(-1,0)--++(0,-1);
|
||||
\grid22{[color=white]#2++(-1,-1)}
|
||||
\end{scope}
|
||||
%\draw[color=black]#2++(-0.5,-0.5)--++(1,0)--++(0,1)--++(-1,0)--++(0,-1);
|
||||
}
|
||||
|
||||
% disk (color #1, position #2)
|
||||
\def\disk#1#2{
|
||||
\fill[color=#1]#2circle(2.5);
|
||||
\begin{scope}
|
||||
\clip#2circle(2.5);
|
||||
\grid66{[color=white]#2++(-3,-3)}
|
||||
\end{scope}
|
||||
\draw[color=black]#2circle(2.5);
|
||||
}
|
||||
|
||||
% octagon (color #1, position #2)
|
||||
\def\octagon#1#2{
|
||||
\fill[color=#1]#2++(-1,-2.5)--++(2,0)--++(1.5,1.5)--++(0,2)--++(-1.5,1.5)--++(-2,0)--++(-1.5,-1.5)--++(0,-2)--++(1.5,-1.5);
|
||||
\begin{scope}
|
||||
\clip#2++(-1,-2.5)--++(2,0)--++(1.5,1.5)--++(0,2)--++(-1.5,1.5)--++(-2,0)--++(-1.5,-1.5)--++(0,-2)--++(1.5,-1.5);
|
||||
\grid66{[color=white]#2++(-3,-3)}
|
||||
\end{scope}
|
||||
\draw[color=black]#2++(-1,-2.5)--++(2,0)--++(1.5,1.5)--++(0,2)--++(-1.5,1.5)--++(-2,0)--++(-1.5,-1.5)--++(0,-2)--++(1.5,-1.5);
|
||||
}
|
Reference in New Issue
Block a user