概述
题主下定决心要实现这种吗,老实讲,这着实有点工作量,不如直接ppt做好。不过既然题主问了,我正好感兴趣,第一次用latex绘图包,花了点时间试了一下。该实现涉及的package叫tikz,是latex专门用来画矢量图的包,大概实现了如下的效果,没有添加颜色和适当布局,题主如果有时间和精力可以进一步学习tikz进行延拓。
======================= 更新
最近又看了下tikz的文档,发现自己第一个版本实现实在太丑陋,所以重制了一下,更美观一点,颜色也加上了:
代码如下
documentclass[]{article}
usepackage{amsmath}
usepackage{tikz}
usepackage{bm} % bold mathusepackage{color} % change text colorusetikzlibrary{tikzmark,positioning}
tikzstyle{block} = [draw,rectangle,thick,minimum height=2em,minimum width=2em,anchor=west]
renewcommand{vec}[1]{ensuremath{boldsymbol{#1}}} % bold vectors
begin{document}
begin{tikzpicture}[overlay, remember picture,>=stealth]
node[block,draw=blue,dotted] (eq1) {$varphi(vecx)=frac{1}{4piepsilon_0}int_Vtikzmarknode[align=right]{rho}{rho}(vecx')[frac{1}{R}-vecx'cdottikzmarknode{nabla}{nabla}frac{1}{R}+frac{1}{2}tikzmarknode{x1}{vecx}'vecx':nablanablafrac{1}{R}+cdots]mathrmdV'$};
node[block,draw=blue!60,dotted,below=1.5cm of eq1.west, anchor=west] (eq2) {$Q=int_Vrho(vecx')mathrm{d}V'$};
node[block,draw=violet,dotted,right=of eq2] (eq3) {$vecp=int_Vrho(vecx')vecx'mathrm{d}V'$};
node[block,draw=red!80,dotted,below=1cm of eq2.west, anchor=west] (eq4) {$mathcal{D}=int_V3vecx'vecx'rho(vecx')mathrm{d}V'$};
node[block,draw=none,below=1cm of eq4.west, anchor=west] (eq5) {$mathcal{D}_{ij}=int_V3vecx'vecx'rho(vecx')mathrm{d}V'quadquadi=1-3, j=1-3$};
node[block,draw=cyan,below=1cm of eq5.west, anchor=west] (eq6) {$varphi(vecx)=cdotscdotscdotscdotscdotscdotscdotscdotscdotscdotscdotscdots$};
draw [->, draw=blue] (eq2.north) -- (rho);
% draw [->] (eq3.north) -- (nabla); draw [
draw [
end{tikzpicture}
end{document}
另外,我很想把documentclass从article换成standalone,但是换了之后图片格式就乱了,希望有大佬能替我解答一下!
=====================================
以下是原始回答:
没有进行精细地参数调整,所以效果很糙,见谅。
documentclass[]{article}
usepackage{amsmath}
usepackage{tikz}
usetikzlibrary{tikzmark}
begin{document}
begin{tikzpicture}[overlay, remember picture,>=stealth]
node [rectangle, draw, align=right, text width=0.8textwidth] (eq1){
begin{minipage}{textwidth}
centering
$phi(x)=frac{1}{4piepsilon_0}int_Vtikzmarknode{rho}{rho}(x)[frac{1}{R}-xcdottikzmarknode{nabla}{nabla}frac{1}{R}+frac{1}{2}tikzmarknode{x}{x'}x':+cdots]$
end{minipage}
};
node [rectangle, draw, left=1.5cm, below=1.5cm, text width=3.5cm] (eq2){
begin{minipage}{textwidth}
centering
$Q=int_Vrho(x')mathrm{d}V'$
end{minipage}
};
node [rectangle, draw, right=1cm, text width=3.5cm] (eq3) at (eq2.east){
begin{minipage}{textwidth}
centering
$Q=int_Vrho(x')mathrm{d}V'$
end{minipage}
};
node [rectangle, draw, below=1cm, text width=3.5cm] (eq4) at (eq2.south){
begin{minipage}{textwidth}
centering
$Q=int_Vrho(x')mathrm{d}V'$
end{minipage}
};
draw [->] (eq2.north) -- (rho);
% draw [->] (eq3.north) -- (nabla); draw [
draw [
end{tikzpicture}
end{document}
给题主推荐几个教程,可以学习一下,里面很多操作的解释基本在下面第一个tikz pgf manual里讲解了https://www.bu.edu/math/files/2013/08/tikzpgfmanual.pdfwww.bu.eduTiKZ 制图简要教程 - LaTeX科技排版工作室www.latexstudio.net
题主可以学习下,这个例子进行适当扩展Observer/Estimator | TikZ exampletexample.net
代码如下:
% Observer/Estimator% Author: Dominik Haumanndocumentclass[landscape,a5paper,11pt]{article}
usepackage[utf8x]{inputenc} % utf8 encodingusepackage[T1]{fontenc} % use T1 fontsusepackage{amsmath} % nice math symbolsusepackage{bm} % bold mathusepackage{color} % change text color
usepackage{tikz}
usetikzlibrary{decorations.pathmorphing} % for snake linesusetikzlibrary{matrix} % for block alignmentusetikzlibrary{arrows} % for arrow headsusetikzlibrary{calc} % for manimulation of coordinates
% TikZ styles for drawingtikzstyle{block} = [draw,rectangle,thick,minimum height=2em,minimum width=2em]
tikzstyle{sum} = [draw,circle,inner sep=0mm,minimum size=2mm]
tikzstyle{connector} = [->,thick]
tikzstyle{line} = [thick]
tikzstyle{branch} = [circle,inner sep=0pt,minimum size=1mm,fill=black,draw=black]
tikzstyle{guide} = []
tikzstyle{snakeline} = [connector, decorate, decoration={pre length=0.2cm,
post length=0.2cm, snake, amplitude=.4mm,
segment length=2mm},thick, magenta, ->]
renewcommand{vec}[1]{ensuremath{boldsymbol{#1}}} % bold vectorsdef myneq {skew{-2}not =} % neq alone skews the dash
begin{document}
begin{tikzpicture}[scale=1, auto, >=stealth']
small
% node placement with matrix library: 5x4 array matrix[ampersand replacement=&, row sep=0.2cm, column sep=0.4cm] {
% node[block] (F1) {$vec{u}_i=F_i({widetilde{vec{x}}_j}_{j=1}^N)$}; &
node[branch] (u1) {}; &
&
node[block] (f1) {$begin{matrix}dot{vec{x}}_i=f_i(vec{x}_i,textcolor{red}{{widetilde{vec{x}}_j}_{jmyneqi}},vec{u}_i,t)\vec{y}_i=g_i(vec{x}_i,textcolor{blue}{{widetilde{vec{x}}_j}_{jmyneqi}},t)end{matrix}$}; & \
&
&
&
node[block] (L1) {$vec{e}_i(vec{y}_i-widetilde{vec{y}}_i)$};&
node [sum] (e1) {}; \
&
&
node[sum] (v1) {}; &
node[block] (o1) {$begin{matrix}dot{widetilde{vec{x}}}_i=widetilde{f}_i(widetilde{vec{x}}_i,textcolor{red}{{widetilde{vec{x}}_j}_{jmyneqi}},vec{v}_i, t)\widetilde{vec{y}}_i=g_i(widetilde{vec{x}}_i,textcolor{blue}{{widetilde{vec{x}}_j}_{jmyneqi}},t)end{matrix}$};
&
\
node[guide] (i1) {}; & & & & \
};
% now link the nodes draw [line] (F1) -- (u1);
draw [connector] (u1) -- node {$u_i$} (f1);
draw [connector] (f1) -| node[near end] {$vec{y}_i$} (e1);
draw [connector] (e1) -- (L1);
draw [connector] (L1) -| (v1);
draw [connector] (v1) -- node {$vec{v}_i$} (o1);
draw [connector] (u1) |- (v1);
draw [connector] (o1) -| node[pos=0.96] {$-$} node [near end, swap]
{$widetilde{vec{y}}_i$} (e1);
draw [connector] (o1.south) -- ++(0,-.5cm) -| node [near start]
{$widetilde{vec{x}}_i$} ($(F1.south)+(0.4cm,0em)$);
% draw the snake lines with offset (using the calc library) draw [snakeline] ($(i1)-(0.4cm,-1cm)$) -- node
{${widetilde{vec{x}}_j}_{jmyneqi}$} ($(F1.south)-(0.4cm,0em)$);
draw [snakeline, swap] ($(v1.east)-(1.0cm,0.4cm)$) -- node
{${widetilde{vec{x}}_j}_{jmyneqi}$} ($(o1.west)-(0cm,0.4cm)$);
draw [snakeline, swap] ($(u1.east)+(0.1cm,-0.4cm)$) -- node
{${widetilde{vec{x}}_j}_{jmyneqi}$} ($(f1.west)-(0cm,0.4cm)$);
end{tikzpicture}
end{document}
最后
以上就是自觉服饰为你收集整理的tikz 折线 箭头_这种箭头用LaTex怎么实现?的全部内容,希望文章能够帮你解决tikz 折线 箭头_这种箭头用LaTex怎么实现?所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复