答案1
您可以tikz
直接在 LyX 中使用。
选择Document --> Settings --> LaTeX preamble
并添加以下两行:
\usepackage{tikz}
\usetikzlibrary{matrix,shapes}
然后,在您的文档中 - 在figure
环境中(因为我写道\centering
它应该放在组中),或center
直接在环境中(没有\centering
)或任何其他您喜欢的类似方式 - 将以下代码放入ERT
(按ctrl+L或特定图标或通过菜单Insert --> TeX code
)。请注意,将代码粘贴到时,ERT
您必须使用Ctrl+ Shift+ V( Edit -> Paste special
) 来保留换行符。
\centering\noindent%
\begin{tikzpicture}[
ellipsenode/.style={
ellipse,
fill=orange,
inner sep=4pt,
text width=5em,
text=white,
text centered
},
rectnode/.style={
rounded corners,
fill=#1,
inner sep=10pt,
text=white,
text width=7em,
text centered
},
graynode/.style={
draw=gray,
very thick,
inner sep=4pt,
text=gray,
text centered
},
myline/.style={
draw=#1,
line width=1.5pt,
},
]
\matrix[
matrix of nodes,
column sep=1.2em,
row sep=4ex,
row 1/.style={nodes={ellipsenode}},
row 2/.style={nodes={rectnode={black}}},
row 3/.style={nodes={graynode}},
row 4/.style={nodes={rectnode={black}}},
row 5/.style={nodes={rectnode={orange}}},
] (m) {
{\textbf{Investor} \\ \textit{\small(LP)}} & {\textbf{Investor} \\ \textit{\small(LP)}} & {\textbf{Investor} \\ \textit{\small(LP)}} \\
& {\textbf{General} \\ \textbf{Partner} \textit{\small(GP)}} \\
& Limited Partner Agreement \\
& {\textbf{Limited} \\ \textbf{Liability}\\ \textbf{Partnership}\\ \textit{\small(LLP)}} \\
{\textbf{Portfolio} \\ \textbf{Companies}} & {\textbf{Portfolio} \\ \textbf{Companies}} & {\textbf{Portfolio} \\ \textbf{Companies}} \\
};
\draw[myline=orange] (m-1-1.south) |- (m-4-2)
(m-1-2.west) -- ++(-3em,0) |- (m-4-2.165)
(m-1-3.south) |- (m-4-2)
(m-4-2.south) -- (m-5-2)
(m-4-2.south) -- ++(0,-2ex) -| (m-5-1)
(m-4-2.south) -- ++(0,-2ex) -| (m-5-3)
;
\draw[myline=gray, dashed] (m-1-1.-45) |- (m-2-2)
(m-1-2) -- (m-2-2)
(m-1-3.-135) |- (m-2-2)
;
\draw[myline=orange, dashed] (m-2-2) -- (m-3-2) -- (m-4-2);
\end{tikzpicture}
运行之后结果如下:
.lyx
这是您可以使用扩展保存并直接在 LyX 中打开的完整代码:
#LyX 2.2 created this file. For more info see http://www.lyx.org/
\lyxformat 508
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass article
\begin_preamble
\usepackage{tikz}
\usetikzlibrary{matrix,shapes}
\end_preamble
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
centering
\backslash
noindent%
\end_layout
\begin_layout Plain Layout
\backslash
begin{tikzpicture}[
\end_layout
\begin_layout Plain Layout
ellipsenode/.style={
\end_layout
\begin_layout Plain Layout
ellipse,
\end_layout
\begin_layout Plain Layout
fill=orange,
\end_layout
\begin_layout Plain Layout
inner sep=4pt,
\end_layout
\begin_layout Plain Layout
text width=5em,
\end_layout
\begin_layout Plain Layout
text=white,
\end_layout
\begin_layout Plain Layout
text centered
\end_layout
\begin_layout Plain Layout
},
\end_layout
\begin_layout Plain Layout
rectnode/.style={
\end_layout
\begin_layout Plain Layout
rounded corners,
\end_layout
\begin_layout Plain Layout
fill=#1,
\end_layout
\begin_layout Plain Layout
inner sep=10pt,
\end_layout
\begin_layout Plain Layout
text=white,
\end_layout
\begin_layout Plain Layout
text width=7em,
\end_layout
\begin_layout Plain Layout
text centered
\end_layout
\begin_layout Plain Layout
},
\end_layout
\begin_layout Plain Layout
graynode/.style={
\end_layout
\begin_layout Plain Layout
draw=gray,
\end_layout
\begin_layout Plain Layout
very thick,
\end_layout
\begin_layout Plain Layout
inner sep=4pt,
\end_layout
\begin_layout Plain Layout
text=gray,
\end_layout
\begin_layout Plain Layout
text centered
\end_layout
\begin_layout Plain Layout
},
\end_layout
\begin_layout Plain Layout
myline/.style={
\end_layout
\begin_layout Plain Layout
draw=#1,
\end_layout
\begin_layout Plain Layout
line width=1.5pt,
\end_layout
\begin_layout Plain Layout
},
\end_layout
\begin_layout Plain Layout
]
\end_layout
\begin_layout Plain Layout
\backslash
matrix[
\end_layout
\begin_layout Plain Layout
matrix of nodes,
\end_layout
\begin_layout Plain Layout
column sep=1.2em,
\end_layout
\begin_layout Plain Layout
row sep=4ex,
\end_layout
\begin_layout Plain Layout
row 1/.style={nodes={ellipsenode}},
\end_layout
\begin_layout Plain Layout
row 2/.style={nodes={rectnode={black}}},
\end_layout
\begin_layout Plain Layout
row 3/.style={nodes={graynode}},
\end_layout
\begin_layout Plain Layout
row 4/.style={nodes={rectnode={black}}},
\end_layout
\begin_layout Plain Layout
row 5/.style={nodes={rectnode={orange}}},
\end_layout
\begin_layout Plain Layout
] (m) {
\end_layout
\begin_layout Plain Layout
{
\backslash
textbf{Investor}
\backslash
\backslash
\backslash
textit{
\backslash
small(LP)}} & {
\backslash
textbf{Investor}
\backslash
\backslash
\backslash
textit{
\backslash
small(LP)}} & {
\backslash
textbf{Investor}
\backslash
\backslash
\backslash
textit{
\backslash
small(LP)}}
\backslash
\backslash
\end_layout
\begin_layout Plain Layout
& {
\backslash
textbf{General}
\backslash
\backslash
\backslash
textbf{Partner}
\backslash
textit{
\backslash
small(GP)}}
\backslash
\backslash
\end_layout
\begin_layout Plain Layout
& Limited Partner Agreement
\backslash
\backslash
\end_layout
\begin_layout Plain Layout
& {
\backslash
textbf{Limited}
\backslash
\backslash
\backslash
textbf{Liability}
\backslash
\backslash
\backslash
textbf{Partnership}
\backslash
\backslash
\backslash
textit{
\backslash
small(LLP)}}
\backslash
\backslash
\end_layout
\begin_layout Plain Layout
{
\backslash
textbf{Portfolio}
\backslash
\backslash
\backslash
textbf{Companies}} & {
\backslash
textbf{Portfolio}
\backslash
\backslash
\backslash
textbf{Companies}} & {
\backslash
textbf{Portfolio}
\backslash
\backslash
\backslash
textbf{Companies}}
\backslash
\backslash
\end_layout
\begin_layout Plain Layout
};
\end_layout
\begin_layout Plain Layout
\backslash
draw[myline=orange] (m-1-1.south) |- (m-4-2)
\end_layout
\begin_layout Plain Layout
(m-1-2.west) -- ++(-3em,0) |- (m-4-2.165)
\end_layout
\begin_layout Plain Layout
(m-1-3.south) |- (m-4-2)
\end_layout
\begin_layout Plain Layout
(m-4-2.south) -- (m-5-2)
\end_layout
\begin_layout Plain Layout
(m-4-2.south) -- ++(0,-2ex) -| (m-5-1)
\end_layout
\begin_layout Plain Layout
(m-4-2.south) -- ++(0,-2ex) -| (m-5-3)
\end_layout
\begin_layout Plain Layout
;
\end_layout
\begin_layout Plain Layout
\backslash
draw[myline=gray, dashed] (m-1-1.-45) |- (m-2-2)
\end_layout
\begin_layout Plain Layout
(m-1-2) -- (m-2-2)
\end_layout
\begin_layout Plain Layout
(m-1-3.-135) |- (m-2-2)
\end_layout
\begin_layout Plain Layout
;
\end_layout
\begin_layout Plain Layout
\backslash
draw[myline=orange, dashed] (m-2-2) -- (m-3-2) -- (m-4-2);
\end_layout
\begin_layout Plain Layout
\backslash
end{tikzpicture}
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
My figure
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\end_body
\end_document