3

I am writing my assignment in LyX. I am very new to this program, but I would like to create a scheme similar to this:

Shceme

Is this possible to do? Does anyone have templates similar to this one? I would appreciate your help.

Sebastiano
  • 54,118
Andreas
  • 51
  • Welcome to LaTeX! Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document. A pointer: try the tikz package – Moriambar May 20 '17 at 09:35
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. There are many ways to do that, for example with a tikz matrix. See here: http://www.texample.net/tikz/examples/feature/matrices/ also on this site you could find several examples, like: https://tex.stackexchange.com/a/370306/101651. Please try to do something by yourself and, if you have any problem, add an MWE to your question. – CarLaTeX May 20 '17 at 09:38
  • 3
    Try searching this this site for e.g. flowchart or organization chart, or see Texample.net (http://www.texample.net/tikz/examples/simple-flow-chart/). In LyX you'll need to write the TikZ code (if you choose to use TikZ) in a TeX code inset (aka ERT). – Torbjørn T. May 20 '17 at 09:38
  • 2
    To the downvoters: one downvote is even too much, let's give the OP time for updating his question! Idem for the ready-to-close ones... – CarLaTeX May 20 '17 at 09:52
  • Consider using dia. See here: https://tex.stackexchange.com/a/367703/12212 – scottkosty May 21 '17 at 07:29

1 Answers1

6

You could use tikz directly in LyX.

Choose Document --> Settings --> LaTeX preamble and add these two lines:

\usepackage{tikz}
\usetikzlibrary{matrix,shapes}

Then, in your document - within a figure environment (since I wrote \centering it should be put within a group), or a center environment directly (without \centering) or any other similar way you like - put the following code in an ERT (pressing ctrl+L or the specific icon or via menu Insert --> TeX code). Note that when pasting code into an ERT you must use Ctrl + Shift + V (Edit -> Paste special) to preserve line breaks.

\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}

After running and this is the result:

enter image description here

This is the complete code you could save with a .lyx extension and open directly in 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
CarLaTeX
  • 62,716
  • (+1) I took the liberty of adding a small note about pasting into ERTs. I didn't remove the \centering, though it might perhaps be better to place it in a group, or remove it, so that the rest of the document isn't centered as well ... – Torbjørn T. Oct 28 '17 at 21:43
  • @TorbjørnT. Thank you for the editing. In my example it is within a figure enrivonrment (see the .lyx file), however I'll add a note. – CarLaTeX Oct 28 '17 at 21:45
  • @TorbjørnT. Note added, hoping it's clear :):):) – CarLaTeX Oct 28 '17 at 22:00
  • Oh, right, sorry about that. Didn't notice the figure. – Torbjørn T. Oct 28 '17 at 22:10
  • @TorbjørnT. It's very difficult to notice something in a LyX code LOL! Do they really write \begin_layout Plain Layout ... \end_layout for every line of ERT? OMG! – CarLaTeX Oct 28 '17 at 22:13
  • 1
    Well, the format of the .lyx file isn't really relevant for users, it's auto generated after all, and should be easily parsed by computers, not humans. – Torbjørn T. Oct 28 '17 at 22:18
  • @TorbjørnT. Now I understand why it is so long! :) – CarLaTeX Oct 28 '17 at 22:20