I added a Layout Feature to the Latex Workshop and published it as Tex Workshop .

Layout Feature

You can create a layout.tex under the project root folder, and then reference it in other tex files.


layout.tex  under project root:

latex documentclass{article} usepackage{xeCJK} usepackage{ctex} usepackage{float} usepackage{tikz} usetikzlibrary{automata,positioning} begin{document} {children} end{document}

Reference it in other tex files using % !layout   

So you can focus on what you really care in the specific file, no need to write the header and footer again and again. Hooray!

latex % !layout begin{figure}[H] centering begin{tikzpicture}[>=stealth, shorten >=1pt, node distance=4cm, on grid, auto, every state/.style={draw=black!60, fill=black!5, very thick} ] node[state] (mid) {U 公司}; node[state] (upper) [above=of mid] {产品 A}; node[state] (right) [right=of mid] {产品 B}; node[state] (lower) [left=of mid] {C}; node[state] (left) [below=of mid] {D}; path[->] % FROM BEND/LOOP POSITION OF LABEL LABEL TO (mid) edge node {u.com/path-a} (upper) (mid) edge node {u.com/path-b} (right) (mid) edge node {u.com/path-c} (lower) (mid) edge node {u.com/path-d} (left) ; end{tikzpicture}

caption[xxx]{ yyy } end{figure}

### You get the preview right away ![0720c0c9-17e1-463f-8430-537eff108f1e.png](https://cdn.nlark.com/yuque/0/2020/png/221736/1583764967869-6aecf62b-1c78-4de0-adca-18a4be0da51b.png#align=left&display=inline&height=1921&name=0720c0c9-17e1-463f-8430-537eff108f1e.png&originHeight=1921&originWidth=3000&size=612426&status=done&style=none&width=3000)