概要** ❧ 交差点ライブラリ ❧ アローチップライブラリ ❧ Decorations libraries ❧ Calc library ❧ Mindmap library ❧ Shapes library ❧ Paper Folding library ❧ Chains library ❧ Shapes library ❧ TikZ への雑多な貢献
TikZの特殊なライブラリを探すことはよくあります。今のところ、すべてのライブラリをロードするパッケージはありません。
*利用可能なすべてのライブラリのリストと短い紹介文(2-3文)はありますか?
ここに集めることができるかもしれません
以下に、ライブラリの一覧と、それぞれの目的の簡単なまとめを示します(提供されるコードはLaTeXおよび/またはPlain TeX用のもので、ConTeXt用のものではありません)。
usetikzlibrary{arrows.meta}
(`amentusetikzlibrary{arrows}
is deprecated).アローチップのライブラリです。詳細は以下を参照usetikzlibrary{automata}
でアクセスでき、有限状態オートマトンやチューリングマシンを描くために使用されます。 これらのグラフを描くためには、各ノード、その名前、相対的な位置、および各ノード間のパスの種類が定義されている。usetikzlibrary{backgrounds}
でアクセスでき、 "defines background for pictures" でアクセスできます。 Tikzpictureでこれを使用するには、例えば begin{tikzpicture}[show background rectangle]
のように、オプションが渡され、ピクチャの前に背景の矩形スタイルが定義されています。(例: tikzset{background rectangle/.style={<define background rectangle style here>}}
.usetikzlibrary{calc}
からアクセスし、複雑な座標計算を行うことができます。詳細は以下を参照usetikzlibrary{calendar}
です。 このライブラリは、カレンダーを表示するために使用されます (Ronsealのことだと思いますಭ)。 カレンダーは calendar[
display options and date options](
Name (optional)`) というように定義する。usetikzlibrary{er}
, automata drawing library と同様に、各ノード、各ノード間の各エッジ、および任意の属性が定義されています。 注意点として、属性には下線を引くべきであるが、醜い上に実装が困難であるため、使用しない。 代わりにイタリックが使われる。container''slibrary{intersections}
からアクセスできます。詳細は以下を参照usetikzlibrary{mindmap}
からアクセスします。詳細は以下を参照usetikzlibrary{matrix}
です。 行列は maths モードと同じように定義されますが、行列の各項目には 1 から始まるノードとして値が割り当てられ、各ノードを識別して操作することができます。 デリミタはマトリックスオプションで選択することができ、"Any delimiter that is acceptable to TeX's left
command" を使用することができます。tempusetikzlibrary{folding}
.詳細は以下を参照usetikzlibrary{patterns}
. このパッケージは、領域を塗りつぶすためのパターンを定義します" 。 ドキュメントでは、各パターンに名前が付けられ、例が示されています。usetikzlibrary{plothandlers}
. TikZはこのライブラリを自動的にロードする。 各点はプロット用に(ノードとして)定義され、各点には曲線が配置されます。usetikzlibrary{plotmarks}
is used to define additional styles for plots as used above. 各ポイントは pgfuseplotmark{
Plot description`` として定義されます。ССikzlibrary{shapes}
または usetikzlibrary{shapes.
shape type}
を使用します。 幾何学図形は、名前付きの図形(星形、菱形など)、または指定された辺数の多角形、記号図形、例えば禁煙標識で使用される "禁止記号"、複数の(テキスト)部分を持つ "マルチパート図形、そして最後に、取り消し線付きのクロスなど、前のカテゴリに合わない "misc" の図形が利用可能です。詳しくは下記をご覧くださいsusetikzlibrary{snakes}
and can be best described as curved lines, and are used either between nodes or a border to a shape , or as independent shapes.usetikzlibrary{topaths}
です。 このライブラリは、2点間のパスを定義するために使用され、自動的にロードされます。 さらに、2つのシェイプ間の曲線や、ノードに戻るループのような形をとることができます。usetikzlibrary{trees}
でアクセスできる。 木上の各点はノードとして定義され、子を持ち、各子はそれ自身の子を持つことができる。 木の方向や、子が出る角度も指定できるが、放っておいてもそれなりの結果が得られる。
出典逆カンマは tikzpgfmanual とカレンダーのサンプルより引用しました。矢印ヒントライブラリ。 ==================。
\ usetikzlibrary{arrows.me ta}
によってアクセスされました。
説明:。 さまざまな新しいカスタマイズ可能な矢印のヒントを提供します。
例。
\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
\foreach \arrowtipkind[count=\i from 0] in {
Circle,
Diamond,
Ellipse,
Kite,
Latex,
Rectangle,
Square,
Stealth,
Triangle,
Turned Square,
Arc Barb,
Bracket,
Hooks,
Tee Barb,
Parenthesis,
Implies,
Butt Cap,
Fast Round,
Fast Triangle,
Round Cap,
Triangle Cap}{\foreach \specs[count=\j from 0] in {round, open, fill=red, {round, fill=blue, length=2.5mm, slant=.5}}{\draw[-{\arrowtipkind[\specs]}, yshift=-1.5*\i cm -0.2*\j cm] (0,0) -- +(1,0)\ifnum\j=0 node[above,midway,font=\scriptsize\ttfamily]{\arrowtipkind}\fi;};};
%%% Tips with particular options:
% Arc Barb[sep, arc=<angle>, length=<dim>, line width=<dim>, width=<dim>, reversed, round, slant=<num>, harpoon, left, right, <color>]
% Bracket[sep, reversed, round, slant=<num>, left, right, harpoon, reversed, <color>]
% Hooks[sep, arc=<angle>, length=<dim>, line width=<dim>, width=<dim>, reversed, round, slant=<num>, harpoon, left, right, <color>]
% Tee Barb[sep, inset=<dim>, inset'=<dim> <num>, line width=<dim>, reversed, round, slant=<num>, harpoon, left, right, <color>] thin thick
% Implies[<color>]
\end{tikzpicture}
\end{document}
Ti k Z / PGF 3.0.1aマニュアルセクション矢印。
。。
Accessed by usetikzlibrary{intersections}
__.
Description パスの交差点を自動計算できるようにする。
例 1__
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
% Draw to path and give a name to them
\draw [red, name path={red line}] (0,0) -- (4,3);
\draw [blue, name path={blue curve}] (1,-0.5) to[out=80, in=100] (3,2);
% use the intersections on a path to giv them coordinates
% and draw a line between them
\draw [green, name intersections={of=red line and blue curve,
by={first intersect, second intersect}}]
(first intersect) -- (second intersect);
% one can use the coordinates furtheron
\node [above] at (first intersect) {A};
\node [below] at (second intersect) {B};
\end{tikzpicture}
\end{document}
!結果]1です。
例 2__
\documentclass{standalone}% or wathever you want
% load packages
\usepackage{tikz, xcolor}
% load libraries
\usetikzlibrary{intersections,shapes.arrows,calc}
% define light and dark gray
\definecolor{lgray}{cmyk}{0,0,0,0.2}
\definecolor{dgray}{cmyk}{0,0,0,0.7}
% make some settings
\tikzset{%
% style for the intersecting path, which
% are nessesary for the calculation but
% shouldn't be drawn in the final image
ipath/.style={
% draw,% comment this aout after construction
red
},
% style for an arrow used as object
optical arrow/.style={%
fill=dgray,
inner sep=3pt,
shape=single arrow,
minimum width=0.5cm,
minimum height=1.5cm,
outer sep=0pt,
shape border rotate=90,
},
% style for the virtual image
virtual optical arrow/.style={%
fill=lgray,
inner sep=3pt,
shape=single arrow,
minimum width=0.5cm,
minimum height=1.5cm,
outer sep=0pt,
shape border rotate=90,
},
% style for the mirror
mirror/.style={%
line width=2pt,
},
% style for the axis
optical axis/.style={%
thin,
},
% style for light rays
ray/.style={%
thin,
->,
},
% style for imagined rays, which ar not real
% but help by constructin the image
imagined ray/.style={%
ray, dgray, -,
},
% alias
virtual ray/.style={imagined ray},
% style for (focal) points
point/.style={%
fill=black,
radius=0.8pt,
inner sep=1pt,
shape=circle,
minimum size=2pt,
outer sep=2pt
},
}
% set three layers
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
% and define shortcuts to access them
\newcommand{\bglayer}[1]{%
\begin{pgfonlayer}{background}%
#1%
\end{pgfonlayer}%
}
\newcommand{\fglayer}[1]{%
\begin{pgfonlayer}{foreground}%
#1%
\end{pgfonlayer}%
}
\begin{document}
\begin{tikzpicture}
% define the bounding box is nessesarx because the ipaths
% make it bigger than needed
\path [use as bounding box] (-5.2,-5) rectangle (6.2,5);
% define variables, you may vary them a little
%% radius
\def\radius{5}
\def\radiusII{5.05}
%% focal distancs = \radius/2
\def\focal{2.5}
%% object size
\def\size{1.cm}
%% object width
\def\owidth{1.25}
% draw mirror
%% the extra ipath is nessesary to get nicer rays
\path [ipath, name path=M] (\radius,0) ++(90:\radius)
arc (90:270:\radius);
\fglayer{%
\draw [mirror] (\radiusII-0.05,0) ++(130:\radiusII)
arc (130:240:\radiusII);
}
% draw focal point
\node (B) at (\focal,0) [point] {};
% draw object
\node (O) [optical arrow,anchor=tail, minimum height=\size] %
at (\owidth,0) {};
%% description
\node [above right] at (O.tip) {object};
% rays
%% draw axis ray
\draw [ray] (O.tip) -- (0,0) -- ($(0,0)!3!(\owidth,-\size)$);
%% draw parallel ray
\path [ipath, name path=PS] (O.tip) -- ++(-3,0);
\draw [ray, name intersections={of=M and PS, by=M-PS}]
(O.tip) -- (M-PS) -- ($(M-PS)!2!(B)$);
%% caculate virtual axis ray
\path [ipath, name path=AS-V] ($(0,0)!-4!(\owidth,-\size)$) -- (0,0);
%% calculate virtual parallel ray
\path [ipath, name path=PS-V] ($(M-PS)!-4!(B)$) -- (M-PS);
%% draw virtual axis ray
\draw [imagined ray, name intersections={of=AS-V and PS-V, by=Tip-V}]
(Tip-V) -- (0,0);
%% draw virtual axis ray
\draw [imagined ray] (Tip-V) -- (M-PS);
% draw virtual object
\bglayer{\path let \p{1}=(Tip-V) in
(Tip-V) node (V) [minimum height=\size,
scale={\y{1}/\size*0.665},
virtual optical arrow,anchor=tip
] {};}
%% description
\path (V.west) node [left] {virtual image};
% draw optical axis
\fglayer{\draw [optical axis] (-5,0) --++(11,0);}
\end{tikzpicture}
\end{document}
!幅が描かれたipaths]2です。
!最終画像]3。
Reference
pgfmanual.pdf
, pp.131 et sec.
計算ライブラリ。 -----------------。
\ usetikzlibrary {calc}
がアクセス。
説明。 拡張座標計算を可能にします。
例。
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
% make some mathematical calculations
\node (a) at (1,1) {A};
\fill [red] ($(a) + 1/3*(1cm,0)$) circle (2pt);
% draw a segment of a path between two points
\coordinate (b) at (0,0);
\coordinate (c) at (0.5,3);
\fill (b) circle (1pt) (c) circle (1pt);
\draw [blue!50!green, ->] (b) -- ($(b)!1.5!(c)$);
\draw [blue, ->] (b) -- ($(b)!0.5!(c)$);
% draw a parallel line
\draw [green] (2,0) coordinate (d) -- (3,4) coordinate (e);
\draw [green, dashed] (2.5,1) -- ++($(e)-(d)$);
\end{tikzpicture}
\end{document}
結果。!
参照。
pgfmanual.pd f
。
Accessed by usetikzlibrary{folding}
__.
Description
コマンドは1つだけだが、(デスクトップで使うような)本格的なカレンダーを作成するのに便利である。
Example
\documentclass{standalone}
\usepackage{tikz, xcolor}
\usetikzlibrary{folding,calendar}
\begin{document}
\sffamily\scriptsize
\begin{tikzpicture}[transform shape]
\tikzstyle{every calendar}=
[
%Formats calendars and sets positions
at={(-8ex,4ex)},
week list,
month label above centered,
month text=\bfseries\textcolor{red}{\%mt} \%y0,
if={(Sunday) [black!50]}
]
\tikzfoldingdodecahedron
[
%Sets size of calendar
folding line length=2.5cm,
%Adds calendar image to each face
face 1={ \calendar [dates=\the\year-01-01 to \the\year-01-last];},
face 2={ \calendar [dates=\the\year-02-01 to \the\year-02-last];},
face 3={ \calendar [dates=\the\year-03-01 to \the\year-03-last];},
face 4={ \calendar [dates=\the\year-04-01 to \the\year-04-last];},
face 5={ \calendar [dates=\the\year-05-01 to \the\year-05-last];},
face 6={ \calendar [dates=\the\year-06-01 to \the\year-06-last];},
face 7={ \calendar [dates=\the\year-07-01 to \the\year-07-last];},
face 8={ \calendar [dates=\the\year-08-01 to \the\year-08-last];},
face 9={ \calendar [dates=\the\year-09-01 to \the\year-09-last];},
face 10={\calendar [dates=\the\year-10-01 to \the\year-10-last];},
face 11={\calendar [dates=\the\year-11-01 to \the\year-11-last];},
face 12={\calendar [dates=\the\year-12-01 to \the\year-12-last];},
];
\end{tikzpicture}
\end{document}
!結果]1です。
Reference
pgfmanual.pdf
, pp.202 et sec.
ライブラリを形作ります。 -----------------。
\ usetikzlibrary {shapes}
がアクセス。
説明。 形状をフローチャートの一部として配置できます。
例。
\documentclass{standalone}
\usepackage{tikz, xcolor}
\usetikzlibrary{shapes,arrows}
\tikzstyle{decision} = [diamond, draw, text width=4.5em,
text badly centered, node distance=2cm,
inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, text width=5em,
text centered, rounded corners,
minimum height=4em, node distance=3cm]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{cloud} = [draw, ellipse, node distance=2.5cm, minimum height=2em]
\tikzstyle{blank} = [node distance=1cm]
\begin{document}
\begin{tikzpicture}[node distance = 3cm, auto]
% Place nodes
\node [cloud] (init) {n};
\node [blank, below of=init] (sup) {};
\node [decision, below of=sup] (square) {$n^2 \le 1$};
\node [cloud, right of=square] (end) {End};
\node [block, left of=square] (newN) {$n = \frac{2}{n}$};
% Draw edges
\path [line] (init) -- (square);
\path [line] (square) -- node [near start] {yes} (end);
\path [line] (square) -- node [near start] {no} (newN);
\path [line] (newN) |- (sup);
\end{tikzpicture}
\end{document}
結果。! 参照。 http://www.texample.net/tikz/examples/simple-flow-chart/。 大学のインタビューで尋ねられた質問の例から、開始するためのベースとして使用され、サポートとして使用される追加のスタイル(空白)。
マインドマップライブラリ。
------。
\ usetikzlibrary {mindmap}
がアクセス。
説明。
メインのフォーカスポイントは中央に配置され、サブポイントは分岐しています。 各ノードは、その子と同様に定義されています。 ノードは互いに分離することもでき、各ノードは異なる色を付けて相互接続することもできます。 注釈も利用できます。
例。
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{mindmap,backgrounds}
\begin{document}
\tikzstyle{root concept}+=[concept color=blue!20,minimum size=2cm]
\tikzstyle{level 1 concept}+=[sibling angle=45]
\begin{tikzpicture}[mindmap]
\node [concept] (n1) {Stack Exchange Sites}
child[concept color=red,grow=45] {node[concept] (c1) {Meta}}
child[concept color=orange,grow=0] {node[concept] (c2) {Q \& A}}
child[concept color=green,grow=-45] {node[concept] (c3) {Chat}};
\begin{pgfonlayer}{background}
\draw [concept connection] (c1) edge (c2)
edge (c3)
(c2) edge (c3);
\end{pgfonlayer}
\node [extra concept] at (0,10) (n2) {\TeX {} and \LaTeX {}Stack Exchange}
child[concept color=red,grow=45] {node[concept] (s1) {Meta}}
child[concept color=orange,grow=0] {node[concept] (s2) {Q \& A}}
child[concept color=green,grow=-45] {node[concept] (s3) {Chat}};
\begin{pgfonlayer}{background}
\draw [concept connection] (s1) edge (s2)
edge (s3)
(s2) edge (s3)
(n1) edge (n2);
\end{pgfonlayer}
\end{tikzpicture}
\end{document}
結果。!
参照。
pgfmanual.pd f
、pp。 207 et sec。
チェーンライブラリ。
------。
\ usetikzlibrary {chains}
がアクセス。
説明。
チェーンは、行または列に配置され、通常はエッジで接続されるノードのシーケンスです。 より一般的には、分岐ネットワークのノードを体系的に配置するために使用できます。 行と列でのノードの配置については、マトリックスを使用することもできます(参照。
pgfmanual.pd f
)のセクション17ですが、チェーンを使用して、たとえば行列を使用してすでに接続されているノード間の接続を説明することもできます。 したがって、要素の配置にマトリックスを使用することはしばしば理にかなっています。
接続を説明するチェーン。。
チェーンの例。
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,% for the rectangle
chains,% provides the chains
scopes}% allows to replace \begin{scope} \end{scope} with {}
\begin{document}
\begin{tikzpicture}[
nonterminal/.style={
rectangle,
minimum size=6mm,
very thick,
draw=red!50!black!50,
top color=white, % a shading that is white at the top...
bottom color=red!50!black!20, % and something else at the bottom
font=\itshape
},
terminal/.style={
rectangle,minimum size=6mm,rounded corners=3mm,
very thick,draw=black!50,
top color=white,bottom color=black!20,
font=\ttfamily
},
node distance=5mm, every on chain/.style={join}, every join/.style={->}
]
{ [start chain]
\node [on chain,nonterminal] {unsigned integer};
\node [on chain,terminal] {.};
\node [on chain,terminal] {digit};
\node [on chain,terminal] {E};
{ [start branch=plus]
\node (plus) [terminal,on chain=going above right] {+};
}
{ [start branch=minus]
\node (minus) [terminal,on chain=going below right] {-};
}
\node [on chain, nonterminal, join=with chain/plus-end, join=with chain/minus-end] {unsigned integer};
}
\end{tikzpicture}
\end{document}
チェーン。! マトリックスとチェーンの例。
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,% for the rectangle
chains,% provides the chains
scopes}% allows to replace \begin{scope} \end{scope} with {}
\begin{document}
\begin{tikzpicture}[
nonterminal/.style={
rectangle,
minimum size=6mm,
very thick,
draw=red!50!black!50,
top color=white, % a shading that is white at the top...
bottom color=red!50!black!20, % and something else at the bottom
font=\itshape
},
terminal/.style={
rectangle,minimum size=6mm,rounded corners=3mm,
very thick,draw=black!50,
top color=white,bottom color=black!20,
font=\ttfamily
},
every on chain/.style={join}, every join/.style={->}
]
\matrix[column sep=4mm] {
% First row:
& & & & \node (plus) [terminal] {+};&\\
% Second row:
\node (ui1) [nonterminal] {unsigned integer};&
\node (dot) [terminal] {.}; &
\node (digit) [terminal] {digit}; &
\node (e) [terminal] {E}; &
& % space in between
\node (ui2) [nonterminal] {unsigned integer};\\
% Third row:
& & & & \node (minus)[terminal] {-};&\\
};
{ [start chain]
\chainin (ui1);
\chainin (dot);
\chainin (digit);
\chainin (e);
{ [start branch=plus]
\chainin (plus);
}
{ [start branch=minus]
\chainin (minus);
}
\chainin (ui2) [join=with chain/plus-end, join=with chain/minus-end];
}
\end{tikzpicture}
\end{document}
マトリックス。! ラベル付きチェーン。
「チェーン」ライブラリによって作成されたエッジにラボを追加する必要がある場合があります(前に)。 ライブラリではネイティブにサポートされていませんが、ライブラリを微調整でサポートできます。
例は次のとおりです。
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,% for the rectangle
chains,% provides the chains
scopes}% allows to replace \begin{scope} \end{scope} with {}
\makeatletter
\def\tikz@lib@parse@join#1{%
\def\tikz@temp{#1}%
\ifx\tikz@temp\pgfutil@empty%
\tikz@lib@parse@join@by by \pgf@stop%
\else%
\pgfutil@in@{with }{#1}%
\ifpgfutil@in@% 'with [by] [label]'
\pgfutil@in@{by }{#1}%
\ifpgfutil@in@% 'with by [label]'
\pgfutil@in@{label }{#1}%
\ifpgfutil@in@% 'with by label'
\tikz@lib@parse@join@with@by@label#1\pgf@stop%
\else% 'with by'
\tikz@lib@parse@join@with@by#1\pgf@stop%
\fi%
\else% 'with [label]'
\pgfutil@in@{label }{#1}%
\ifpgfutil@in@% 'with label'
\tikz@lib@parse@join@with@label#1\pgf@stop%
\else% with
\tikz@lib@parse@join@with@by#1 by \pgf@stop%
\fi%
\fi%
\else% '[by] [label]'
\pgfutil@in@{by }{#1}%
\ifpgfutil@in@% 'by [label]'
\pgfutil@in@{label }{#1}%
\ifpgfutil@in@% 'by label'
\tikz@lib@parse@join@by@label#1\pgf@stop%
\else% 'by'
\tikz@lib@parse@join@by#1\pgf@stop%
\fi%
\else% '[label]'
\pgfutil@in@{label }{#1}%
\ifpgfutil@in@% 'label'
\tikz@lib@parse@join@label#1\pgf@stop%
\else%
\tikz@lib@parse@join@by#1 by \pgf@stop%
\fi%
\fi%
\fi%
\fi%
}
\def\tikz@lib@parse@join@with@by@label with #1 by #2 label #3\pgf@stop{%
\tikzset{after node path={(#1)edge[every join,#2]#3(\tikzchaincurrent)}}%
}
\def\tikz@lib@parse@join@with@label with #1 label #2\pgf@stop{%
\tikzset{after node path={(#1)edge[every join]#2(\tikzchaincurrent)}}%
}
\def\tikz@lib@parse@join@by@label by #1 label #2\pgf@stop{%
\tikzset{after node path={\ifx\tikzchainprevious\pgfutil@empty\else(\tikzchainprevious)edge[every join,#1]#2(\tikzchaincurrent)\fi}}%
}
\def\tikz@lib@parse@join@label label #1\pgf@stop{%
\tikzset{after node path={\ifx\tikzchainprevious\pgfutil@empty\else(\tikzchainprevious)edge[every join]#1(\tikzchaincurrent)\fi}}%
}
\makeatother
\begin{document}
\begin{tikzpicture}[
nonterminal/.style={
rectangle,
minimum size=6mm,
very thick,
draw=red!50!black!50,
top color=white, % a shading that is white at the top...
bottom color=red!50!black!20, % and something else at the bottom
font=\itshape
},
terminal/.style={
rectangle,minimum size=6mm,rounded corners=3mm,
very thick,draw=black!50,
top color=white,bottom color=black!20,
font=\ttfamily
},
every on chain/.style={join}, every join/.style={->}
]
\matrix[column sep=4mm] {
% First row:
& & & & \node (plus) [terminal] {+};&\\
% Second row:
\node (ui1) [nonterminal] {unsigned integer};&
\node (dot) [terminal] {.}; &
\node (digit) [terminal] {digit}; &
\node (e) [terminal] {E}; &
& % space in between
\node (ui2) [nonterminal] {unsigned integer};\\
% Third row:
& & & & \node (minus)[terminal] {-};&\\
};
{ [start chain]
\chainin (ui1);
\chainin (dot);
\chainin (digit);
\chainin (e);
{ [start branch=plus]
\chainin (plus) [join=label {node[above left]{a label}}];
}
{ [start branch=minus]
\chainin (minus);
}
\chainin (ui2) [join=with chain/plus-end label {node[above right] {plus label}}, join=with chain/minus-end by dashed label {node [below right]{minus label}}];
}
\end{tikzpicture}
\end{document}
エッジあり。! 参照。
pgfmanual.pd f
、pp。 284秒. 例は、チュートリアルの簡略版です。図をチェーンに配置する、pp。 60。
ライブラリを形作ります。 -----------------。
\ usetikzlibrary {shapes、shapes.ge ometric、shapes.sy mbols、shapes.ar lows、shapes.mu llipart、shapes.ca llouts、shapes.mi sc}
でアクセス。
説明。 標準的なもの以外にもいくつかの形を提供します。
例。
\documentclass[parskip]{scrartcl}
\usepackage[margin=5mm,a3paper]{geometry}
\usepackage{kerkis}
\usepackage{tikz}
\usetikzlibrary{
shapes,
shapes.geometric,
shapes.symbols,
shapes.arrows,
shapes.multipart,
shapes.callouts,
shapes.misc}
\begin{document}
\tikzset{every node/.style={draw=red!20!black,fill=orange!50!red!50!white,text=black,inner sep=2pt}}
{\LARGE \textbf{Standard shapes}}\\
\foreach \shape in {circle,rectangle}
{ \begin{tikzpicture}
\node[shape=\shape] {\shape};
\end{tikzpicture}
}
\\\hrule
{\LARGE \textbf{Geometric shapes}}\\
\foreach \shape in {diamond,ellipse,trapezium,semicircle,regular polygon,star,isosceles triangle,kite,dart,circular sector,cylinder}
{ \begin{tikzpicture}
\node[shape=\shape] {\shape};
\end{tikzpicture}
}
\\\hrule
{\LARGE \textbf{Symbol shapes}}\\
\foreach \shape in {forbidden sign,magnifying glass,cloud,starburst,signal,tape}
{ \begin{tikzpicture}
\node[shape=\shape] {\shape};
\end{tikzpicture}
}
\\\hrule
{\LARGE \textbf{Arrow shapes}}\\
\foreach \shape in {single arrow,double arrow,arrow box}
{ \begin{tikzpicture}
\node[shape=\shape] {\shape};
\end{tikzpicture}
}
\\\hrule
{\LARGE \textbf{Multipart shapes}}\\
\foreach \shape in {circle split,circle solidus,ellipse split,rectangle split}
{ \begin{tikzpicture}
\node[shape=\shape] {\shape};
\end{tikzpicture}
}
\\\hrule
{\LARGE \textbf{Callout shapes}}\\
\foreach \shape in {ellipse callout,rectangle callout,cloud callout}
{ \begin{tikzpicture}
\node[shape=\shape] {\shape};
\end{tikzpicture}
}
\\\hrule
{\LARGE \textbf{Miscellaneous shapes}}\\
\foreach \shape in {cross out,strike out,rounded rectangle,chamfered rectangle}
{ \begin{tikzpicture}
\node[shape=\shape] {\shape};
\end{tikzpicture}
}
\end{document}
ここに画像の説明を入力してください。!
参照。
pgfmanual.pd f
、419〜461ページ。
すべてのライブラリとpfdmanualの短い定義を含むPDFを作成しました。
ここに画像の説明を入力してください。! PDFはtable-libraryにあります。
これは最初のバージョンであり、再読も修正もしておらず、注文は問題ないと思います。 グラフに関する最後のライブラリにはluatexが必要です。
多分これはこの答えを出すのに適切な場所ではありませんが、私はそれが誰かを助けるかもしれないと思います。
Ti k Zへのいくつかの貢献を含むリンクを次に示します。それらのいくつかはパッケージとしてロードする必要があり、いくつかは一般的に \ usetikzlibrary
を介してライブラリとしてロードできますが、 Ti k Z / PGFマニュアル。代わりに、パッケージなどの独自のドキュメントがあります。
パッケージ/ライブラリのいくつかと、それが何をしているのかを非常に簡単に説明します。
-knots
(tikzライブラリ):交差点を簡単に計算して結び目を描画し、パスを複数のパスに自動的に分割する環境を提供します。
-hobbys
(tikzライブラリ):特定のポイントセットを介して滑らかな曲線を生成するJohn Hobbyのアルゴリズムの実装。これにより、通常の「プロット」演算子よりも曲線のさらなるカスタマイズが可能になり、結果はカスタマイズなしで「プロット」よりもはるかに優れています。
-forest
:Ti k Zだけでツリーを描く前に明確に考慮する必要がある、非常に改善されたツリー描画メカニズムを提供します。
-tikz-cd
:事前定義されたマクロと可換図を描画するためのデフォルト設定を通じてサポートを提供します。
-prooftree
:プロフツリーを描くためのサポートを提供します。パッケージは、数学を教えるために使用される数学のプロフツリーに焦点を当てています。
-pgf-spectra
:簡単な構文を使用して要素のスペクトルを描画します(現在99が利用可能)。
-bloques
:制御理論(エンジニアリング)で使用されるブロック図の描画を容易にするためのマクロのセットを提供します。
-circuitikz
:電子回路の描画に使用されます。
-tikzscale
: tikzpicture
sと \ includegraphics
の間のインターフェースを提供し、tikzpicturesのスケーリング方法を提供します。
私は以前のリンクで 65 の貢献を数えました、上記の引用は決して最高でも特別でもありません、それは私が遭遇したものだけです。
------。
ユーザーの@Qrrbrbirlbelにも含まれています(どうやってそう言うのですか??)5つのニートライブラリ(はい、 \ usetikzlibrary
がロードされています)、残念ながらマニュアルがなく、CTANからは入手できません(うまくいけば、そこに到達します)が、[QrrbrbirlbelのGitHubアカウント](
node-families
ライブラリは、"依存ノードサイズ"に応答して開発されました。OPは、関連するノードの自動再サイジングを要求して、最小サイズが同じになるようにしています。 次のキーを使用して、同じ次元を持つノードの特定のファミリにノードを割り当てます。 これは画像ごとに機能し、「。aux」ファイルを使用するため、少なくとも2つのコンパイルが必要になります。
-`最小幅=< family>`;。
-`最小高さ=< family> `;。
-`テキストの高さ=< family> `;。
-`テキスト幅=< family>`。
-paths.or tho
(ここにコードファイルおよびlibファイルここに)。
このライブラリは、Ti k Zが自然に持っている( |-
と-|
)のようなパス演算子を導入しますが、 |-|
や- |-
のようにより高度です。 この回答とこれにも、ライブラリに関する詳細情報が含まれています。
paths.re ctangle
ライブラリは、 rectangle
パス演算子に2つの同様のタイマー(パスに沿ってノードを配置する関数)を提供します。 通常 \ drawを行うとき。 (0,0。) 長方形ノード。[pos = x。]A} 。(1,1。)
ノード A
は、2つの座標を結ぶ線に沿った位置に配置されます。, paths.re ctangle
。, x
は 1
より大きい値を想定できます。 (2
まで。) 実際の長方形のパスを表します。, 座標間の線ではありません。, よりよく説明されるように。 [この答え。]https://tex.stackexchange.com/a/106571/16595。).
このライブラリを使用すると、図形を画像パターンで埋めることができ、テクスチャのある画像を作成するのに非常に役立ちます。 この回答で説明されています。
これは、1つのノードを他のいくつかのノードに対して配置する方法を提供し、ノードをまたがるノードのセットと同じ大きさにする機能も提供します。 それとは別に、元の「ポジショニング」ライブラリよりも多くのポジショニングオプションがあります。マニュアルがないため、情報はTeX.SX検索エンジンから収集する必要があります(このリンクは適切なフィルターで自動検索します)。
アクセス者 \ usetikzlibrary {装飾。<装飾ライブラリの名前>}
。
説明。 名前が示すように、これらのライブラリはパスを飾ります。 パスが別のパスで置き換えられることもあります。
すべての装飾ライブラリを以下に示します。 Ctrl< / kbd>を使用します。 + F< / kbd> (Windows)必要なライブラリにアクセスします。
---。
\ usetikzlibrary{decorations.pa thmorphing}
によってアクセスされました。
説明 [Ti k Zマニュアルから]。 装飾を形作る経路は、装飾される経路を「形」または「変形」します。 これは、以前は直線であったものがその後、蛇行曲線であり、 ⁇ 起がある可能性があることを意味します。
例。
\documentclass[tikz,margin=1]{standalone}
\usetikzlibrary{decorations.pathmorphing}
\def\y{0}
\newcommand\decorated[1]{
\tikzset{decoration=#1}
\draw[thin,red] (0,\y) to[bend left] (1,\y);
\filldraw[decorate,fill=yellow!60,very thick] (0,\y) to[bend left] (1,\y)
node[right,font=\ttfamily] {#1};
\let\auxy\y
\pgfmathsetmacro\y{\auxy+1}
}
\begin{document}
\begin{tikzpicture}[y=-1cm,x=3cm]
\decorated{lineto}
\decorated{straight zigzag}
\decorated{random steps}
\decorated{saw}
\decorated{zigzag}
% We are not able to use our command here :(
\tikzset{decoration=bent}
\draw[thin,red] (0,\y) -- (1,\y);
\filldraw[decorate,fill=yellow!60,very thick] (0,\y) -- (1,\y)
node[right,font=\ttfamily] {bent};
\let\auxy\y
\pgfmathsetmacro\y{\auxy+1}
% %
\decorated{bumps}
\decorated{coil}
\decorated{curveto}
\decorated{snake}
\end{tikzpicture}
\end{document}
。。
---。
\ usetikzlibrary{decorations.pa threplacing}
によってアクセスされました。
説明 [Ti k Zマニュアルから]。 このライブラリは、装飾されるパスを別のパスに置き換える装飾を定義します。 モーフィングの装飾とは異なり、置き換えられたパスはかなり異なる場合があります。たとえば、直線は一連の円に置き換えられます。
例。
*ほとんどの装飾。
``` latex。
\ documentclass [tikz、margin = 1] {standalone}。
\ usetikzlibrary{decorations.pa 3位}。
\ def \ y {{{0}}}。
\ newcommand \ decorated [1] {。
\ tikzset {decoration =#1}。
\ draw [thin、red](0、\ y)〜[bend left](1、\ y);。
\ draw [decorate、very thick](0、\ y)〜[bend left](1、\ y)。
node [right、font = \ ttfamily] {#1};。
\ let \ auxy \ y。
\ pgfmathsetmacro \ y {\ auxy + 1}。
}。
\ begin {document}。
\ begin {tikzpicture} [y = -1cm、x = 3cm]。
\装飾された{国境}。
%ここではコマンドを使用できません:(。
\ tikzset {decoration = brace}。
\ draw [thin、red](0、\ y)-(1、\ y);。
\ draw [decorate、very thick](0、\ y)-(1、\ y)。
node [right、font = \ ttfamily] {brace} ;。
\ let \ auxy \ y。
\ pgfmathsetmacro \ y {\ auxy + 3}。
% %。
\装飾された{拡大する波}。
\ let \ auxy \ y。
\ pgfmathsetmacro \ y {\ auxy + 1.5}。
\装飾された{ティック}。
\装飾された{波}。
\ end {tikzpicture}。
\ end {document}。
``。
[。![ここに画像の説明を入力してください][2]][2]。
*特別な装飾:「ショーパス構造」。
``` latex。
%出典:TikZ-PGFマニュアルバージョン3.1.3、2019年5月9日、636ページ。
\ documentclass [tikz、margin = 1] {standalone}。
\ usetikzlibrary{decorations.pa 3位}。
\ begin {document}。
\ begin {tikzpicture} [。
> =ステルス、。
すべてのノード/。style= {midway、sloped、font = \ tiny}、。
装飾= {。
パス構成を表示します。
moveto code = {。
\ fill [red](\ tikzinputsegmentfirst)円(2pt)。
ノード[fill = none、under] {moveto};}、。
lineto code = {。
\ draw [青、->](\ tikzinputsegmentfirst)-(\ tikzinputsegmentlast)。
ノード[上] {lineto};}、。
curveto code = {。
\ draw [緑。!75。!黒、->](\ tikzinputsegmentfirst)。 .. コントロール。
(\ tikzinputsegmentsupporta)および(\ tikzinputsegmentsupportb)。
(\ tikzinputsegmentlast)ノード[上] {curveto};}、。. closepath code = {。
\ draw [オレンジ、->](\ tikzinputsegmentfirst)-(\ tikzinputsegmentlast)。
ノード[上] {closepath};}。
}]。
\ draw [ヘルプライン]グリッド(3,2);。
\ path [decorate](0,0)-(3,1)アーク(0:180:1.5および1)-サイクル;。
\ end {tikzpicture}。
\ end {document}。
``。
[。![ここに画像の説明を入力してください][3]][3]。
---。
\ usetikzlibrary{decorations.ma rkings}
によってアクセスされました。
説明 [Ti k Zマニュアルから]。 マーキングは、「小さな画像」、より正確には、特定の位置のパスに「配置」されている「スコープの内容」と考えることができます。
例。
\documentclass[tikz,margin=1]{standalone}
\usetikzlibrary{decorations.markings}
\begin{document}
\colorlet{darkgreen}{green!70!black}
\begin{tikzpicture}[>=stealth]
\path (0,1) node[right,inner sep=0pt,font=\ttfamily] {markings};
\draw[postaction=decorate,decoration={
markings,
mark=at position 0.5 with \arrow{>}
}] (0,0) -- (3,0) node[right=1ex] {One marking only};
\draw[postaction=decorate,decoration={
markings,
mark=at position 1/3 with {
\draw[red,thick] (-2pt,-2pt) -- (2pt,2pt);
\draw[red,thick] (-2pt,2pt) -- (2pt,-2pt);
},
mark=at position 2/3 with {
\draw[darkgreen,thick] (-2pt,0) -- (0,-2pt) -- (2pt,2pt);
}
}] (0,-1) -- (3,-1) node[right=1ex] {Two markings};
\draw[postaction=decorate,decoration={
markings,
mark=between positions 0 and 1 step 0.2 with {
\filldraw[fill=yellow]
(-3pt,-3pt) -- (3pt,-3pt) -- (0,3pt) -- cycle;
\draw (0,2pt) -- (0,-1pt);
\fill (0,-2pt) circle (.5pt);
}
}] (0,-2) to[bend left] (3,-2) node[right=1ex] {Several markings};
\end{tikzpicture}
\end{document}
。。
---。
\ usetikzlibrary{decorations.fo otprints}
によってアクセスされました。
説明 [Ti k Zマニュアルから]。 このライブラリの装飾は、誰かがパスに沿って「歩いた」かのように、足跡がほとんどないパスを装飾するために使用できます。
例。
\documentclass[tikz,margin=1]{standalone}
\usetikzlibrary{decorations.footprints}
\begin{document}
\begin{tikzpicture}[y=-1.5cm,x=3cm]
\path (0,0) node[right,inner sep=0pt,font=\ttfamily] {footprints};
\foreach \i [count=\j] in {gnome,human,bird,felis silvestris} {
\tikzset{decoration={footprints,foot of=\i}}
\draw[thin,red] (0,\j) to[bend left] (1,\j);
\draw[decorate] (0,\j) to[bend left] (1,\j) node[right] {\i};
}
\end{tikzpicture}
\end{document}
。。
---。
\ usetikzlibrary{decorations.sh apes}
によってアクセスされました。
説明 [Ti k Zマニュアルから]。 該当なし。
例。
\documentclass[tikz,margin=1]{standalone}
\usetikzlibrary{decorations.shapes}
\def\y{0}
\newcommand\decorated[1]{
\tikzset{decoration=#1}
\draw[thin,red] (0,\y) to[bend left] (1,\y);
\draw[decorate] (0,\y) to[bend left] (1,\y)
node[right,font=\ttfamily] {#1};
\let\auxy\y
\pgfmathsetmacro\y{\auxy+1}
}
\begin{document}
\begin{tikzpicture}[y=-1cm,x=3cm]
\decorated{crosses}
\decorated{triangles}
\decorated{shape backgrounds} % You can customize it. See more in the manual
\end{tikzpicture}
\end{document}
。。
---。
\ usetikzlibrary{decorations.te xt}
によってアクセスされました。
説明 [Ti k Zマニュアルから]。 このライブラリの装飾は、いくつかのテキストでパスを飾ります。 これは、曲線に従うテキストを描くために使用できます。
例。
\documentclass[tikz,margin=2]{standalone}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}[y=-1cm,x=3cm]
\draw[postaction=decorate,decoration=text along path,
/pgf/decoration/text={Hello world}]
(0,0) to[bend left] (1,0) node[right=1ex,font=\ttfamily] {text along path};
% Source: The TikZ - PGF manual, version 3.1.3, 9 May 2019, page 652
\tikzset{
decoration={
text effects along path,
text={Hello world},
text align=center,
text effects/.cd,
character count=\i,
characters={xslant=0.5, text along path, name=c-\i}
}
}
\draw[postaction=decorate] (0,1) -- (1,3.5)
node[right=1ex,font=\ttfamily] {text effects along path};
\end{tikzpicture}
\end{document}
。。
---。
\ usetikzlibrary{decorations.fr actals}
によってアクセスされました。
説明 [Ti k Zマニュアルから]。
このライブラリの装飾は、フラクタル線を作成するために使用できます。
例。
\documentclass[tikz,margin=1]{standalone}
\usetikzlibrary{decorations.fractals}
\def\y{0}
\newcommand\decorated[3][]{
\tikzset{decoration=#2}
\draw[ultra thin,red] (0,\y) -- (1,\y);
\draw[#1] decorate {
decorate {
decorate {
(0,\y) -- (1,\y)
}
}
};
\path (1,\y) node[right=1ex,font=\ttfamily] {#2};
\let\auxy\y
\pgfmathsetmacro\y{\auxy+#3}
}
\begin{document}
\begin{tikzpicture}[y=-1cm,x=3cm]
\decorated{Koch curve type 1}{1.5}
\decorated{Koch curve type 2}{2}
\decorated{Koch snowflake}{1}
\decorated[ultra thick]{Cantor set}{0}
\end{tikzpicture}
\end{document}
。。