我对 Tex Exchange 还很陌生。希望你们能帮我画出这张图:
平均能量损失源代码:
\documentclass[10pt,a4paper]{article}
\usepackage[hmargin=2cm,vmargin=1cm]{geometry}
\renewcommand{\rmdefault}{bch} % change default font
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,fit,positioning,shapes.symbols,chains}
%%%<
\usepackage{verbatim}
\usepackage[active,tightpage,floats]{preview}
\setlength\PreviewBorder{5pt}%
%%%>
\begin{comment}
:Title: Porter model
A Porter five (or six) forces model.
\end{comment}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% BEGIN DOCUMENT
\begin{document}
\begin{figure}[h]
\centering
\begin{tikzpicture}
[node distance = 1cm, auto,font=\footnotesize,
% STYLES
every node/.style={node distance=3cm},
% The comment style is used to describe the characteristics of each force
comment/.style={rectangle, inner sep= 5pt, text width=4cm, node distance=0.25cm, font=\scriptsize\sffamily},
% The force style is used to draw the forces' name
force/.style={rectangle, draw, fill=black!10, inner sep=5pt, text width=4cm, text badly centered, minimum height=1.2cm, font=\bfseries\footnotesize\sffamily}]
% Draw forces
\node [force] (rivalry) {Rivalry among existing competitors};
\node [force, above of=rivalry] (substitutes) {Threat of substitutes};
\node [force, text width=3cm, dashed, left=1cm of substitutes] (state) {Public policies};
\node [force, left=1cm of rivalry] (suppliers) {Bargaining power of suppliers};
\node [force, right=1cm of rivalry] (users) {Bargaining power of users};
\node [force, below of=rivalry] (entrants) {Threat of new entrants};
%%%%%%%%%%%%%%%
% Change data from here
% RIVALRY
\node [comment, below=0.25 of rivalry] (comment-rivalry) {(+) A war against Microsoft\\
(+) Limiting sunk costs\\
(+) Coopetition};
% SUPPLIERS
\node [comment, below=0.25cm of suppliers] {(+) Efficiency\\
(+) Attracting other developers\\
(+) Creating a Chrome community};
% SUBSTITUTES
\node [comment, right=0.25 of substitutes] {(+) Portability};
% USERS
\node [comment, below=0.25 of users] {(+) Increasing the user information\\
(+) Reducing the switching costs};
% NEW ENTRANTS
\node [comment, right=0.25 of entrants] {(+) EC vs. Microsoft};
% PUBLIC POLICIES
\node [comment, text width=3cm, below=0.25 of state] {(+) Positively framed\\
(+) Transparency\\
(--) A new monopoly?};
%%%%%%%%%%%%%%%%
% Draw the links between forces
\path[->,thick]
(substitutes) edge (rivalry)
(suppliers) edge (rivalry)
(users) edge (rivalry)
(entrants) edge (comment-rivalry);
\end{tikzpicture}
\caption{FOSS in Chrome influences industry structure by increasing competition}
\label{fig:6forces}
\end{figure}
\end{document}
答案1
这是一个很好的起点:
\documentclass{standalone}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{amsmath, amssymb}
\usetikzlibrary{positioning, fit, arrows.meta, calc}
\begin{document}
\tikzset{
basic/.style={
draw,
rectangle,
minimum width=9em,
text centered
},
placeholder/.style={
basic,
draw=white
},
arrsty/.style={
draw=black,
-latex
}
}
% use sans serif font by default
\begin{tikzpicture}[every node/.style={font=\sffamily}]
\node[basic] (tAmount) {tAmount};
\node[basic, below=of tAmount] (tTransferAmount) {tTransferAmount};
\node[basic, right=of tTransferAmount] (tFee) {tFee};
\node[below=of tTransferAmount] (anchor1) {};
% compute the center point of tTransferAmount and tFee
\coordinate (point1) at ($0.5*(tTransferAmount.east)+0.5*(tFee.west)$);
\node[basic, minimum width=7em, text width=7em] (addTotOwned) at (anchor1.center-|point1) {Add to\\tOwned[receipt]};
\node[placeholder, left=of tTransferAmount] (anchor2) {};
% place the other node symmetricly
\coordinate (point2) at ($0.5*(anchor2.east)+0.5*(tTransferAmount.west)$);
\node[basic, minimum width=7em, text width=7em, text centered] (subFromtOwned) at (anchor1.center-|point2) {Subtract from\\tOwned[receipt]};
\node (anchor3) at ($0.5*(addTotOwned.east)+0.5*(subFromtOwned.west)$) {};
\node[basic, below=of anchor3, minimum width=32.8em] (convert) {convert(r$=$rate$\times$t)};
% draw some arrows and put the text in
\path[arrsty] (tAmount)-|(anchor2.center)--(convert.north-|anchor2.center);
\path[arrsty] (tAmount)--node[midway, xshift=1.2em, font=\sffamily\bfseries\small] (ninety-perct) {90\%} (tTransferAmount);
\path[arrsty] (tAmount)-|(tFee);
\path[arrsty] (tFee)--(convert.north-|tFee.center);
\node[xshift=1.2em, font=\sffamily\bfseries\small] at (ninety-perct-|tFee.center) {10\%};
\path[arrsty] (anchor2.center)-| node[pos=0.8, left] {(1)} (subFromtOwned);
\path[arrsty] (tTransferAmount)-| node[pos=0.8, left] {(2)} (addTotOwned);
\node[basic, below=of convert] (rTransferAmount) {rTransferAmount};
\node[basic] (rAmount) at (rTransferAmount-|anchor2.center) (rAmount) {rAmount};
\node[basic] (rFee) at (rTransferAmount-|tFee.center) {rFee};
\node[basic, below=of rAmount, text width=8em] (subFromrOwned) {Subtract from\\rOwned[sender]};
\node[basic, below=of rTransferAmount, text width=8em] (addTorOwned) {Add to\\rOwned[recipent]};
\node[basic, below=of rFee, text width=8em] (subFromrTotal) {Subtract from\\rTotal};
% draw arrows
\path[arrsty] (convert.south-|rAmount)--(rAmount);
\path[arrsty] (convert.south-|rTransferAmount)--(rTransferAmount);
\path[arrsty] (convert.south-|rFee)--(rFee);
\path[arrsty] (rAmount)--(subFromrOwned);
\path[arrsty] (rTransferAmount)--(addTorOwned);
\path[arrsty] (rFee)--(subFromrTotal);
% outer dotted box
\node[fit=(tAmount)(convert)(subFromrOwned)(subFromrTotal), dotted, draw=black, inner sep=1em] (dottedbox1) {};
\node[anchor=north east, xshift=-1em] (TX1) at (dottedbox1.north west) {TX1};
\end{tikzpicture}
\end{document}