TikZを使用したカスタムカレンダー
Custom Calendar Using Tikz
解決:
日の配置を少し変更すれば、試行錯誤しながら図形を配置しなくても、簡単に図形を追加して正しい座標を見つけることができます。
追加することにより
毎日/.style={anchor=base}、daytext={\%d=},roundedcorners=0,anchor=base,textheight=1ex,textdepth=-0.5exにカレンダーオプションを追加するだけで、曜日を調整できます何もいじることなく、強調したい日に nodes。day text = {%d =}は、1桁の日を2桁の日と同じ幅にする処理を行います。
を使用して node [anchor = base、xshift = 0.5ex](seg){S};最初の平日の手紙を印刷するために、すべての平日は曜日とうまく一致します。
これらの調整後、次のようなものを使用して個々の日を強調表示できます
if(equals = 01-10){ node [fill = yellow、draw、star] {};}の中に holidaysマクロ。
完全に調整されたコードは次のとおりです。
documentclass [12pt] {article} usepackage {lscape、tikz} usepackage [brazil] {babel} usepackage [latin1] {inputenc} usepackage [margin = 1in、paperwidth = 15.8in、paperheight = 8.5in] {geometry } usepackage {geometry} usepackage {amsmath、color、graphicx} usepackage {amsfonts} usepackage {amssymb} definecolor {Red} {cmyk} {0,1,1,0} def red { color {赤}} definecolor {Blue} {cmyk} {1,1,0,0} def blue { color {Blue}} %%プリアンブル:% Huge usetikzlibrary {arrows、shapes} usetikzlibrary {positioning 、calendar、er} usetikzlibrary {decorations.markings} usetikzlibrary {shapes.geometric} newcommand { calrow} [1] { node [anchor = base、xshift = 0.5ex](seg){S}; %最初の平日をシフト node [base right = of seg](ter){T}; node [base right = of ter](qua){Q}; node [base right = of qua](qui){Q}; node [base right = of qui](sex){ !S}; node [base right = of sex](sab){ !S}; node [base right = of sab](dom){D}; node [black、above = of qui] { textbf {#1}};} newcommand { calperiod} [1] { calendar [dates = the year-#1-01 to the year- #1-最後、毎日/.style={anchor=base}、%Center days day text = {%d =}、rounded corners = 0、anchor = base、text height = 1ex、text depth = -0.5ex ]%ノードの配置を簡単にするif(Sunday)[red] holidays;} newcommand { holidays} {if(equals = 01-15){ node [draw、regularpolygon、regularpolygonsides = 3] {}; } if(equals = 01-20){ node [draw、cloud] {};} if(equals = 01-10){ node [fill = yellow、draw、star] {};} if(equals = 01 -06)[black!50]%if(equals = 04-04)[black!50]%if(equals = 04-05)[black!50]%if(equals = 04-25)[black!50] %if(equals = 05-01)[black!50]%if(equals = 05-01)[black!50]%if(equals = 06-02){ draw(-0.25,0.135)circle(9.0pt );}%if(equals = 08-15)[black!50]%if(equals = 11-01)[black!50]%if(equals = 12-08)[black!50]%if(equals = 12-25)[black!50]%if(equals = 12-26)[black!50]%} colorlet {darkgreen} {green!50!black} begin {document} begin {tikzpicture} [すべてのカレンダー/.style={week lis t}]% node [star、draw、minimum size = .4cm、star point ratio = 1.0、thick] at(calendar- the year-08-29){}; sffamily matrix [%row 1 / .style = {black、node distance = .3ex}、%row 3 / .style = {black、node distance = .3ex}、column sep = 1ex、%draw = black、thick 、丸められた角= 30pt、%postaction = {decorate、decoration = {markings、mark = at position 0.51 with { node [fill = white、text = black、font = { bfseries Large}](year){ the year};}}}%フレームの年:decorations.markingsライブラリ] {%%最初の行:曜日と月 calrow {Janeiro}& calrow {Fevereiro}& calrow {Março}& calrow {Abril} & calrow {Maio}& calrow {Junho} \%2行目:calendar calperiod {01}& calperiod {02}& calperiod {03}& calperiod {04}& calperiod {05}& calperiod {06} \ [0.4cm]%3行目:曜日と月 calrow {Julho}& calrow {Agosto}& calrow {Setembro}& calrow {Outubro}& calrow {Novembro}& calrow {Dezembro} \%4行目:calendar calperiod {07}& calperiod {08}& calperiod {09}& calperiod {10}& calperiod {11}& calperiod {12} \}; end {tikzpicture} end {document}
なんて複雑な例でしょう。そして、なぜあなたはbabelとtikzを2回ロードするのですか?
これに加えて、何か他のものを描くのは簡単です:
documentclass {article} usepackage {tikz} usetikzlibrary {calendar、shapes} begin {document} begin {tikzpicture} makeatletter calendar(K)[dates = 2011-01-01 to 2011-03-30、weekリスト、左上の月ラベル、月yshift = 45pt、月コード= { node(mo)[anchor = west、yshift = -2pt、xshift = -1pt] { tiny Mo}; node(di)at(mo.center)[毎月、anchor = center、xshift = [メール保護] @ [メール保護]] { tiny Di};}]; draw [black](K-2011-01-01)node [starburst、draw] {}; draw [black](K-2011-02-15)node [正多角形、正多角形sides = 6、draw] {〜}; end {tikzpicture} end {document}
内部でTikZ-drawingコマンドを変更できますif(equals = 01-15){ draw(-0.348,0.135)circle(9.0pt);}(たとえば、52行目)を自分に合ったものに変更しますが、配置をいじる必要があります。
塗りつぶされた円はで行うことができます{ fill [semitransparent、red](-。25、.2)circle(.25);}。 TikZ-Manualの「装飾」セクションを見ると、選択した日に好きなものを描くことができるはずです。