diff options
Diffstat (limited to 'figs/libs')
-rw-r--r-- | figs/libs/Makefile | 28 | ||||
-rw-r--r-- | figs/libs/graphene.sty | 86 |
2 files changed, 114 insertions, 0 deletions
diff --git a/figs/libs/Makefile b/figs/libs/Makefile new file mode 100644 index 0000000..5704428 --- /dev/null +++ b/figs/libs/Makefile @@ -0,0 +1,28 @@ +PROJECTNAME=$(basename $(wildcard *.tex)) +LIBS=$(notdir $(wildcard libs/*)) + +PDFS=$(addsuffix .pdf, $(PROJECTNAME)) + +all: $(PDFS) + +$(PDFS): $(LIBS) + echo $(LIBS) + pdflatex -file-line-error $(patsubst %.pdf, %.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 diff --git a/figs/libs/graphene.sty b/figs/libs/graphene.sty new file mode 100644 index 0000000..40ffd03 --- /dev/null +++ b/figs/libs/graphene.sty @@ -0,0 +1,86 @@ +%% +%% Macros to draw graphene lattices +%% + +% numerical values +% sqrt(3)/2 +\def\sqrttt{0.866} +% sqrt(3) +\def\sqrtt {1.732} + +%l1 +\def\lo{(1.5,\sqrttt)} +%l2 +\def\lt{(1.5,-\sqrttt)} +%-l1 +\def\mlo{(-1.5,-\sqrttt)} +%-l2 +\def\mlt{(-1.5,\sqrttt)} + +% shapes +\def\square#1#2#3{\draw[#3]#1++(-#2,-#2)--++(#2,0)--++(#2,0)--++(0,#2)--++(0,#2)--++(-#2,0)--++(-#2,0)--++(0,-#2)--++(0,-#2);} +\def\fullsquare#1#2#3{\fill[#3]#1++(-#2,-#2)--++(#2,0)--++(#2,0)--++(0,#2)--++(0,#2)--++(-#2,0)--++(-#2,0)--++(0,-#2)--++(0,-#2);} + +% atoms +\def\a#1#2{\fill[#2]#1circle(.1);} +\def\b#1#2{\fullsquare{#1}{.1}{#2}} +\def\at#1#2{\fill[color=white]#1circle(.1);\draw[#2]#1circle(.1);} +\def\bt#1#2{\fullsquare{#1}{.17}{color=white}\square{#1}{.17}{#2}} + + +% draw a hexagon +\def\hexagon#1#2{ + % draw the lines one at a time (so that dashes overlap if the line is dashed) + \draw[#2]#1++(1,0)--++(120:1); + \draw[#2]#1++(-120:1)--++(120:1); + \draw[#2]#1++(60:1)--++(-1,0); + \draw[#2]#1++(-60:1)--++(-1,0); + \draw[#2]#1++(120:1)--++(-120:1); + \draw[#2]#1++(1,0)--++(-120:1); +} + +% draw the atoms around a hexagon +\def\as#1#2{ + \a{#1++(1,0)}{#2} + \a{#1++(120:1)}{#2} + \a{#1++(-120:1)}{#2} +} +\def\ats#1#2{ + \at{#1++(1,0)}{#2} + \at{#1++(120:1)}{#2} + \at{#1++(-120:1)}{#2} +} +\def\bs#1#2{ + \b{#1++(-1,0)}{#2} + \b{#1++(60:1)}{#2} + \b{#1++(-60:1)}{#2} +} +\def\bts#1#2{ + \bt{#1++(-1,0)}{#2} + \bt{#1++(60:1)}{#2} + \bt{#1++(-60:1)}{#2} +} + +% base lattice +\def\graphene#1#2{ + \hexagon{#1}{#2} + \hexagon{#1++\lo}{#2} + \hexagon{#1++\lt}{#2} + \hexagon{#1++\mlo}{#2} + \hexagon{#1++\mlt}{#2} + \hexagon{#1++\lo++\mlt}{#2} + \hexagon{#1++\lo++\mlt++\lo}{#2} + \hexagon{#1++\lo++\mlt++\mlt}{#2} +} + +% base lattice of sites +\def\sitelattice#1#2#3{ + \csname #1s\endcsname{#2}{#3} + \csname #1s\endcsname{#2++\lo}{#3} + \csname #1s\endcsname{#2++\lt}{#3} + \csname #1s\endcsname{#2++\mlo}{#3} + \csname #1s\endcsname{#2++\mlt}{#3} + \csname #1s\endcsname{#2++\lo++\mlt}{#3} + \csname #1s\endcsname{#2++\lo++\mlt++\lo}{#3} + \csname #1s\endcsname{#2++\lo++\mlt++\mlt}{#3} +} |