资源描述:
《Graphics in LATEX using TikZ》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、GraphicsinLATEXusingTikZZoaWalczakFacultyofMathematicsandComputerScience,UniversityofLodzzofiawal(at)mathdotunidotlodzdotplAbstractInthispaperweexplainsomeofthebasicandalsomoreadvancedfeaturesofthePGFsystem,justenoughforbeginners.Tomakeourdrawingeasier,weuseTikZ,whichisafr
2、ontendlayerforPGF.1IntroductionTheruleisthatallTikZgraphicdrawingcom-mandsmustoccurasanargumentofthetikzcom-Inthispaperweexplainsomeofthebasicandalsomandorinsidea{tikzpicture}environment.ThemoreadvancedfeaturesofthePGFsystem,justLATEXversionofthe{tikzpicture}environmentis:
3、enoughforbeginners.Tomakeourdrawingeasier,weuseTikZ,whichisafrontendlayerforPGF.Thebegin{tikzpicture}[]commandsandsyntaxofTikZwerein
uencedbysuchsourcesasMETAFONT,PSTricks,andothers.end{tikzpicture}ForspecifyingpointsandcoordinatesTikZpro-All
4、optionsgiveninsidetheenvironmentwillvidesaspecialsyntax.Thesimplestwayistouseapplytothewholepicture.twoTEXdimensionsseparatedbycommasinroundForexample,todrawthetrianglebetweenthebrackets,forexample(3pt,10pt).Iftheunitisnotpoints(0;0);(0;2);(2;0)wecanwrite:specied,thedefaul
5、tvaluesofPGF'sxy-coordinatetikzdraw(0,0)--(0,2)--(2,0)--(0,0);systemareused.Thismeansthattheunitx-vectororgoes1cmtotherightandtheunity-vectorgoesbegin{tikzpicture}1cmupward.Wecanalsospecifyapointinthepo-draw(0,0)--(0,2)--(2,0)--(0,0);larcoordinatesystemlikethis:(30:1cm)
6、;thismeansend{tikzpicture}go1cminthedirectionof30degrees".Tocreateapicturemeanstodrawaseriesofwhichproduce:straightorcurvedlines.UsingTikZwecanspecifypathswithsyntaxtakenfromMetaPost.2GettingstartedFirstwehavetosetupourenvironment.Tobeginwith,wesetupourleasfollows:Wecanc
7、hangethethicknessofthelinewiththeoptionlinewidth=,asin:documentclass{article}usepackage{tikz}tikzdraw[linewidth=2mm](0,0)--(0,4);begin{document}FordrawingcirclesandellipseswecanusetheDocumentitselfcircleandellipsepathconstructionoperations.end{document}Thecircl
8、eoperationisfollowedbyaradiusinroundbracketswhiletheellipseoperationisfol-Thenwest