handouts/Advanced/DFAs/tikxset.tex

79 lines
1.3 KiB
TeX
Raw Normal View History

2023-05-06 10:19:14 -07:00
\usetikzlibrary{arrows.meta}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{patterns}
% We put nodes in a separate layer, so we can
% slightly overlap with paths for a perfect fit
\pgfdeclarelayer{nodes}
\pgfdeclarelayer{path}
\pgfsetlayers{main,nodes}
% Layer settings
\tikzset{
% Layer hack, lets us write
% later = * in scopes.
layer/.style = {
execute at begin scope={\pgfonlayer{#1}},
execute at end scope={\endpgfonlayer}
},
%
2023-05-14 09:42:14 -07:00
% Arrowhead tweak
2023-05-06 10:19:14 -07:00
>={Latex[ width=2mm, length=2mm ]},
2023-05-14 09:42:14 -07:00
%
% Labels inside edges
2023-05-06 10:19:14 -07:00
label/.style = {
2023-05-14 09:42:14 -07:00
rectangle,
2023-05-06 10:19:14 -07:00
% For automatic red background in solutions
fill = \ORMCbgcolor,
2023-05-14 09:42:14 -07:00
draw = none,
rounded corners = 0mm
2023-05-06 10:19:14 -07:00
},
%
% Nodes
main/.style = {
draw,
circle,
2023-05-14 09:42:14 -07:00
fill = white,
line width = 0.35mm
2023-05-06 10:19:14 -07:00
},
accept/.style = {
draw,
circle,
fill = white,
double,
2023-05-14 09:42:14 -07:00
double distance = 0.5mm,
line width = 0.35mm
},
start/.style = {
draw,
rectangle,
fill = white,
line width = 0.35mm
},
%
% Loop tweaks
loop above/.style = {
min distance = 2mm,
looseness = 8,
out = 45,
in = 135
},
loop below/.style = {
min distance = 5mm,
looseness = 10,
out = 315,
in = 225
},
loop right/.style = {
min distance = 5mm,
looseness = 10,
out = 45,
in = 315
2023-05-06 10:19:14 -07:00
},
2023-05-14 09:42:14 -07:00
loop left/.style = {
min distance = 5mm,
looseness = 10,
out = 135,
in = 215
2023-05-06 10:19:14 -07:00
}
}