Graphics, Figures & TablesRing Composition with parallels and captions

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
GabbeLatex
Posts: 2
Joined: Wed Jan 05, 2022 12:49 am

Ring Composition with parallels and captions

Post by GabbeLatex »

Dear folks!

I'd like to recreate with some good LaTeX code, a picture like this:

Image

I'm not interested in recreating the green boxes on the right. The oval or round shape is mandatory as the parallels lines and all the captions in the positions you see. Oh, even the vertical line that divides in two halves the oval shape must be created.

Thanks for your help and sorry for my strange English :lol: :mrgreen:

Bye! :)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Ring Composition with parallels and captions

Post by Bartman »

You can draw it with the help of the tikz package. The file size of its manual is almost 10 MB.

A suggestion how that could be done:

Code: Select all

\documentclass[tikz]{standalone}
\usepackage[english]{babel}
\usepackage{csquotes}
\usetikzlibrary{shapes.geometric}

\begin{document}
  \begin{tikzpicture}[
    font=\sffamily\strut,% <- added
    every label/.style={align=center}
  ]
  \node [
    draw, 
    ellipse, 
    minimum height=10cm,
    minimum width=\pgfkeysvalueof{/pgf/minimum height}*3/4,
    label=above:\enquote{Text},
    label=260:First line\\Second line,
    label=280:First line\\Second line,
  ] (ellipse) {};
  
  \draw [gray] (ellipse.north) -- (ellipse.south);
  
  \begin{scope}[inner ysep=0pt]% reduces the vertical spacing in the text nodes
  % variable: distance from northern anchor (90 degree)
  \foreach \distanceFromNA in {30,42,...,90}{
    \draw [draw=gray]
      (ellipse.90+\distanceFromNA) node [above left] {Text} 
        -- node [above] {Text}
      (ellipse.90-\distanceFromNA) node [above right] {Text}
    ;
  }
  
  \foreach \distanceFromNA [
    remember=\distanceFromNA as \lastDistanceFromNA (initially 90)
  ] in {102,114,...,150}{
    \draw [draw=gray]
      (ellipse.90+\distanceFromNA) -- node [above] {Text}
      (ellipse.90-\distanceFromNA) 
    ;
    \node [above left] 
      at (ellipse.90+\lastDistanceFromNA|-ellipse.90+\distanceFromNA) {Text}
    ;
    \node [above right] 
      at (ellipse.90-\lastDistanceFromNA|-ellipse.90-\distanceFromNA) {Text}
    ;
  }
  \end{scope}
  \end{tikzpicture}
\end{document}
Last edited by Bartman on Wed Jan 05, 2022 11:09 am, edited 2 times in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10310
Joined: Mon Mar 10, 2008 9:44 pm

Ring Composition with parallels and captions

Post by Stefan Kottwitz »

Bartman wrote:You can draw it with the help of the tikz package.
Very good suggestion!
Bartman wrote:The file size of its manual is almost 10 MB.
@GabbeLatex Don't worry, that's because TikZ is very capable and the manual is excellent. You may have a quick view at examples at TeXample.net or TikZ.net.
Bartman wrote:A suggestion how that could be done
Excellent code!

By the way, as in general nodes are not aligned at the baseline of the text, the alignment may not look perfect if the text has different heights, such as when some letters would have descenders. A quick adjustment can be adding \strut to the font setting, in line 8: font=\sffamily\strut.

Stefan
LaTeX.org admin
Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Ring Composition with parallels and captions

Post by Bartman »

@Stefan Kottwitz Thanks for the hint to the adjustment of the text.
GabbeLatex
Posts: 2
Joined: Wed Jan 05, 2022 12:49 am

Ring Composition with parallels and captions

Post by GabbeLatex »

OMG - Thank You So Much!

You all gave me great suggestions... and I'm really grateful!

Now I have all that I need to start plotting a Ring Composition Structure and, who knows, maybe in a recent future I'll be able to put some other labels on the oval like lines which touch the external border with a panel attached ... (I know I'm not explaining in a decent way :D )

Thank you guys God bless you!

Greetings From Italy

Gabbe
Post Reply