Graphics, Figures & Tablesmacro for stair?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
odhage
Posts: 22
Joined: Wed Sep 02, 2015 11:41 am

macro for stair?

Post by odhage »

It would be nice with some kind of macro to easy make a stair (like for example Maslows). It comes in handy when you want to illustrate for example a process with succeding steps depending on the one before. I imagine it could for example be similar to a table in the way you write your stair:

Code: Select all

\begin{stair}{<horisontal direction>}
\up
first step & inside the stair \\
second &\\
third&\\
\down (maybe you need: &\\ ?)
second level again on the other side & inside \\
first again &\\
\end{stair}
There could be default measures that you could change with \setlength or something.
Or it could be a tikz macro?
Can someone please tell me if something like this already exist, or is someone willing to make such a macro?

Kindly
Mikael
Last edited by Johannes_B on Wed Sep 02, 2015 5:32 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Re: macro for stair?

Post by cgnieder »

Hi. What is Maslows? Could you describe what you'd like the output of your code to look like?

Regards
site moderator & package author
odhage
Posts: 22
Joined: Wed Sep 02, 2015 11:41 am

macro for stair?

Post by odhage »

Thank you for your involvment!
A macro or a package or something, I don't know the best solution.
Maslow is famous for his idea of putting our needs in a hierarchy that is sometimes displayed as a pyramid sometimes as a stair.https://en.wikipedia.org/wiki/Maslow's_ ... y_of_needs
An other example is the aging stair, like this Image.
The output I want is simple, just a line as the steps. Maybe some of the parameters can be the same as in a real stair, se attached pdf. With possibility to have text on the steps and inside. Maybe a rail for binding concepts and platforms to show plateau in a development or progress. I want all possible directions.
Attachments
stair_nomenclature.pdf
(198.8 KiB) Downloaded 316 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

macro for stair?

Post by Stefan Kottwitz »

Hi,

I got a first quick idea to make a staircase diagram using a TikZ matrix.
You can see the steps in the matrix. The draw commands goes through matrix
node coordinates. It could be simplified using a \foreach loop, but
I think it already shows what is meant. And, in such a matrix, you could
go upwards and downwards too.

Code: Select all

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
  \matrix (m) [ matrix of nodes, row sep = 3em, column sep = 0em,
                nodes={minimum width = 7em, outer sep = 0em}] {
         &      &        &             & Best \\
         &      &        & Much better &      \\
         &      & better &             &      \\
         & good &        &             &      \\
     bad &      &        &             &      \\
  };
  \draw (m-5-1.south west) -- (m-5-1.south east)
     -- (m-4-2.south west) -- (m-4-2.south east)
     -- (m-3-3.south west) -- (m-3-3.south east)
     -- (m-2-4.south west) -- (m-2-4.south east)
     -- (m-1-5.south west) -- (m-1-5.south east)
  ;
\end{tikzpicture}
\end{document}
staircase-diagram.png
staircase-diagram.png (4.5 KiB) Viewed 6219 times
Stefan
LaTeX.org admin
odhage
Posts: 22
Joined: Wed Sep 02, 2015 11:41 am

Re: macro for stair?

Post by odhage »

Thank you Stefan!
I think that will do the job. I would have loved something with less work with syntax, but it looks good anyway. :P
/Mikael
Post Reply