How to draw a diagram of custom subject correlativities












3















I need to create a large diagram i.e. a diagram of custom subject correlativities but I am not able to do certain things. To do this I am going to use TikZ.



Ingredients



The ingredients are:




  1. A title. There is not much to say.


  2. Subjects. To create these objects I will use the source code of this very helpful answer:



    Subject picture




  3. Big rectangles. Every rectangle will indicate the year (a.k.a. level) in which the subjects are grouped:



    Rectangle




  4. Arrows. They relate the subjects within the same year of the curriculum and even between different years:



    Arrow




How things are assembled




  1. The subjects are grouped within a rectangle (year career).

  2. Two subjects can be related in the same year, or in different years. The relation between subjects of the same year are always side by side (one on the left, one on the right).


What I have done



MWE:



documentclass{article}
usepackage[showframe,margin=0in,footskip=0.25in,paperwidth=100cm,paperheight=20cm]{geometry}
usepackage[english]{babel}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}

usepackage{hyperref}
usepackage{tikz}
tikzset{text field/.style={text height=1.5ex,align=center,rounded corners},
title field/.style={text height=2ex,text depth=0.3em,anchor=south,text
width=4.5cm,align=center,font=footnotesizesffamily},
pics/fillable subject/.style={code={%
node[text field] (-TF)
{hspace*{-0.5em}TextField[align=1,name=#1-day,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1 1}]~~/hspace*{-0.15em}TextField[align=1,name=#1-month,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1 1}]~~/hspace*{-0em}TextField[align=1,name=#1-year,width=2em,charsize=7pt,maxlen=4,bordercolor={1 1 1}]{}~};
node[title field] (-Title)
at ([yshift=0.4em]-TF.north) {#1};
draw[rounded corners] (-TF.south west) |- (-Title.south west)
|- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
-- cycle;
draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
}},
pics/nonfillable subject/.style={code={%
node[text field] (-TF)
{hspace{1.2em}~/~hspace{1.15em}~/~hspace{2.35em}{}};
node[title field] (-Title)
at ([yshift=0.4em]-TF.north) {#1};
draw[rounded corners] (-TF.south west) |- (-Title.south west)
|- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
-- cycle;
draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
}},
}

begin{document}

thispagestyle{empty} % To suppress page number

noindent
begin{tikzpicture}
fill[white,fill=orange] (0,0) rectangle (paperwidth,-2cm) node[midway,align=center,font=Huge] {bfseries Some text here\LARGE More text here};
end{tikzpicture}

noindent
begin{Form} % From https://tex.stackexchange.com/a/478346/152550
begin{tikzpicture}
path (0,0) pic (Geo) {nonfillable subject={Subject}} (8.5cm,0) pic (Whatever) {nonfillable subject={Subject}} (15cm,0) pic[draw=red] (Math) {nonfillable subject={Math}};
draw[-latex] (Geo-Title) -- (Whatever-Title);
draw[-latex] (Whatever-Title) -- (Math-Title);
end{tikzpicture}
end{Form}

noindent
begin{tikzpicture}
fill[fill=orange!30,rounded corners=50pt] (0,0) rectangle (11.5cm,-14cm) node[midway,align=center,font=LARGE] {bfseries Level $0$};
end{tikzpicture}

end{document}


What I have done



Final result



This is what I want:



What I want



What I need




  1. The number of rectangles varies between 6 and 7 (not like the last image where they are four). The code should be as simple as possible to be able to add subjects easily.

  2. At most each rectangle has 8 or 9 vertical subjects, and at most each rectangle has 2 horizontal subjects.


  3. The current year's label must be centered superiorly and not centered in the middle:



    Top center




  4. As much as the rectangles and the subjects within the rectangles must be centered horizontally and vertically, not like my MWE that are aligned to the left. Briefly, everything has to be centered:



    Everything has to be centered




  5. There must be an appropriate space between all the objects, and the space between year and year must be the most important thing to take care of since, if there is little space, the arrows will be very close together and the document will look ugly. As a reference, you can take the measurements (in centimeters) that I have calculated:



    Measurements that I have calculated



    If they are 7 years (i.e. the largest amount), then the width of the document will be: (0.5+4.5+1.5+4.5+0.5+3)*7-(3)+(1+1), which is equal to 100.5cm. I have not calculated the height, but it must be around 20cm (considering the maximum of vertical subjects i.e. 8/9/10).



    As long as the length of the sheet is smaller it is much better, but without worsening the diagram visually (because I would also like to adapt the diagram to an A4 format).




The last thing that could happen



(Optional requirement)



Automate the color of the arrows. Each subject has its own arrow color. As you see in "Final result", there are a lot of arrows for each subject, so the ideal would be to have a command that by passing the total number of subjects, say n, divide the gradient of colors in n equal parts, in order to homogenize the colors. If this seems crazy, there is no problem in coloring the arrows manually.



Thanks!!










share|improve this question





























    3















    I need to create a large diagram i.e. a diagram of custom subject correlativities but I am not able to do certain things. To do this I am going to use TikZ.



    Ingredients



    The ingredients are:




    1. A title. There is not much to say.


    2. Subjects. To create these objects I will use the source code of this very helpful answer:



      Subject picture




    3. Big rectangles. Every rectangle will indicate the year (a.k.a. level) in which the subjects are grouped:



      Rectangle




    4. Arrows. They relate the subjects within the same year of the curriculum and even between different years:



      Arrow




    How things are assembled




    1. The subjects are grouped within a rectangle (year career).

    2. Two subjects can be related in the same year, or in different years. The relation between subjects of the same year are always side by side (one on the left, one on the right).


    What I have done



    MWE:



    documentclass{article}
    usepackage[showframe,margin=0in,footskip=0.25in,paperwidth=100cm,paperheight=20cm]{geometry}
    usepackage[english]{babel}
    usepackage[utf8]{inputenc}
    usepackage[T1]{fontenc}

    usepackage{hyperref}
    usepackage{tikz}
    tikzset{text field/.style={text height=1.5ex,align=center,rounded corners},
    title field/.style={text height=2ex,text depth=0.3em,anchor=south,text
    width=4.5cm,align=center,font=footnotesizesffamily},
    pics/fillable subject/.style={code={%
    node[text field] (-TF)
    {hspace*{-0.5em}TextField[align=1,name=#1-day,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1 1}]~~/hspace*{-0.15em}TextField[align=1,name=#1-month,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1 1}]~~/hspace*{-0em}TextField[align=1,name=#1-year,width=2em,charsize=7pt,maxlen=4,bordercolor={1 1 1}]{}~};
    node[title field] (-Title)
    at ([yshift=0.4em]-TF.north) {#1};
    draw[rounded corners] (-TF.south west) |- (-Title.south west)
    |- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
    -- cycle;
    draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
    }},
    pics/nonfillable subject/.style={code={%
    node[text field] (-TF)
    {hspace{1.2em}~/~hspace{1.15em}~/~hspace{2.35em}{}};
    node[title field] (-Title)
    at ([yshift=0.4em]-TF.north) {#1};
    draw[rounded corners] (-TF.south west) |- (-Title.south west)
    |- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
    -- cycle;
    draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
    }},
    }

    begin{document}

    thispagestyle{empty} % To suppress page number

    noindent
    begin{tikzpicture}
    fill[white,fill=orange] (0,0) rectangle (paperwidth,-2cm) node[midway,align=center,font=Huge] {bfseries Some text here\LARGE More text here};
    end{tikzpicture}

    noindent
    begin{Form} % From https://tex.stackexchange.com/a/478346/152550
    begin{tikzpicture}
    path (0,0) pic (Geo) {nonfillable subject={Subject}} (8.5cm,0) pic (Whatever) {nonfillable subject={Subject}} (15cm,0) pic[draw=red] (Math) {nonfillable subject={Math}};
    draw[-latex] (Geo-Title) -- (Whatever-Title);
    draw[-latex] (Whatever-Title) -- (Math-Title);
    end{tikzpicture}
    end{Form}

    noindent
    begin{tikzpicture}
    fill[fill=orange!30,rounded corners=50pt] (0,0) rectangle (11.5cm,-14cm) node[midway,align=center,font=LARGE] {bfseries Level $0$};
    end{tikzpicture}

    end{document}


    What I have done



    Final result



    This is what I want:



    What I want



    What I need




    1. The number of rectangles varies between 6 and 7 (not like the last image where they are four). The code should be as simple as possible to be able to add subjects easily.

    2. At most each rectangle has 8 or 9 vertical subjects, and at most each rectangle has 2 horizontal subjects.


    3. The current year's label must be centered superiorly and not centered in the middle:



      Top center




    4. As much as the rectangles and the subjects within the rectangles must be centered horizontally and vertically, not like my MWE that are aligned to the left. Briefly, everything has to be centered:



      Everything has to be centered




    5. There must be an appropriate space between all the objects, and the space between year and year must be the most important thing to take care of since, if there is little space, the arrows will be very close together and the document will look ugly. As a reference, you can take the measurements (in centimeters) that I have calculated:



      Measurements that I have calculated



      If they are 7 years (i.e. the largest amount), then the width of the document will be: (0.5+4.5+1.5+4.5+0.5+3)*7-(3)+(1+1), which is equal to 100.5cm. I have not calculated the height, but it must be around 20cm (considering the maximum of vertical subjects i.e. 8/9/10).



      As long as the length of the sheet is smaller it is much better, but without worsening the diagram visually (because I would also like to adapt the diagram to an A4 format).




    The last thing that could happen



    (Optional requirement)



    Automate the color of the arrows. Each subject has its own arrow color. As you see in "Final result", there are a lot of arrows for each subject, so the ideal would be to have a command that by passing the total number of subjects, say n, divide the gradient of colors in n equal parts, in order to homogenize the colors. If this seems crazy, there is no problem in coloring the arrows manually.



    Thanks!!










    share|improve this question



























      3












      3








      3








      I need to create a large diagram i.e. a diagram of custom subject correlativities but I am not able to do certain things. To do this I am going to use TikZ.



      Ingredients



      The ingredients are:




      1. A title. There is not much to say.


      2. Subjects. To create these objects I will use the source code of this very helpful answer:



        Subject picture




      3. Big rectangles. Every rectangle will indicate the year (a.k.a. level) in which the subjects are grouped:



        Rectangle




      4. Arrows. They relate the subjects within the same year of the curriculum and even between different years:



        Arrow




      How things are assembled




      1. The subjects are grouped within a rectangle (year career).

      2. Two subjects can be related in the same year, or in different years. The relation between subjects of the same year are always side by side (one on the left, one on the right).


      What I have done



      MWE:



      documentclass{article}
      usepackage[showframe,margin=0in,footskip=0.25in,paperwidth=100cm,paperheight=20cm]{geometry}
      usepackage[english]{babel}
      usepackage[utf8]{inputenc}
      usepackage[T1]{fontenc}

      usepackage{hyperref}
      usepackage{tikz}
      tikzset{text field/.style={text height=1.5ex,align=center,rounded corners},
      title field/.style={text height=2ex,text depth=0.3em,anchor=south,text
      width=4.5cm,align=center,font=footnotesizesffamily},
      pics/fillable subject/.style={code={%
      node[text field] (-TF)
      {hspace*{-0.5em}TextField[align=1,name=#1-day,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1 1}]~~/hspace*{-0.15em}TextField[align=1,name=#1-month,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1 1}]~~/hspace*{-0em}TextField[align=1,name=#1-year,width=2em,charsize=7pt,maxlen=4,bordercolor={1 1 1}]{}~};
      node[title field] (-Title)
      at ([yshift=0.4em]-TF.north) {#1};
      draw[rounded corners] (-TF.south west) |- (-Title.south west)
      |- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
      -- cycle;
      draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
      }},
      pics/nonfillable subject/.style={code={%
      node[text field] (-TF)
      {hspace{1.2em}~/~hspace{1.15em}~/~hspace{2.35em}{}};
      node[title field] (-Title)
      at ([yshift=0.4em]-TF.north) {#1};
      draw[rounded corners] (-TF.south west) |- (-Title.south west)
      |- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
      -- cycle;
      draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
      }},
      }

      begin{document}

      thispagestyle{empty} % To suppress page number

      noindent
      begin{tikzpicture}
      fill[white,fill=orange] (0,0) rectangle (paperwidth,-2cm) node[midway,align=center,font=Huge] {bfseries Some text here\LARGE More text here};
      end{tikzpicture}

      noindent
      begin{Form} % From https://tex.stackexchange.com/a/478346/152550
      begin{tikzpicture}
      path (0,0) pic (Geo) {nonfillable subject={Subject}} (8.5cm,0) pic (Whatever) {nonfillable subject={Subject}} (15cm,0) pic[draw=red] (Math) {nonfillable subject={Math}};
      draw[-latex] (Geo-Title) -- (Whatever-Title);
      draw[-latex] (Whatever-Title) -- (Math-Title);
      end{tikzpicture}
      end{Form}

      noindent
      begin{tikzpicture}
      fill[fill=orange!30,rounded corners=50pt] (0,0) rectangle (11.5cm,-14cm) node[midway,align=center,font=LARGE] {bfseries Level $0$};
      end{tikzpicture}

      end{document}


      What I have done



      Final result



      This is what I want:



      What I want



      What I need




      1. The number of rectangles varies between 6 and 7 (not like the last image where they are four). The code should be as simple as possible to be able to add subjects easily.

      2. At most each rectangle has 8 or 9 vertical subjects, and at most each rectangle has 2 horizontal subjects.


      3. The current year's label must be centered superiorly and not centered in the middle:



        Top center




      4. As much as the rectangles and the subjects within the rectangles must be centered horizontally and vertically, not like my MWE that are aligned to the left. Briefly, everything has to be centered:



        Everything has to be centered




      5. There must be an appropriate space between all the objects, and the space between year and year must be the most important thing to take care of since, if there is little space, the arrows will be very close together and the document will look ugly. As a reference, you can take the measurements (in centimeters) that I have calculated:



        Measurements that I have calculated



        If they are 7 years (i.e. the largest amount), then the width of the document will be: (0.5+4.5+1.5+4.5+0.5+3)*7-(3)+(1+1), which is equal to 100.5cm. I have not calculated the height, but it must be around 20cm (considering the maximum of vertical subjects i.e. 8/9/10).



        As long as the length of the sheet is smaller it is much better, but without worsening the diagram visually (because I would also like to adapt the diagram to an A4 format).




      The last thing that could happen



      (Optional requirement)



      Automate the color of the arrows. Each subject has its own arrow color. As you see in "Final result", there are a lot of arrows for each subject, so the ideal would be to have a command that by passing the total number of subjects, say n, divide the gradient of colors in n equal parts, in order to homogenize the colors. If this seems crazy, there is no problem in coloring the arrows manually.



      Thanks!!










      share|improve this question
















      I need to create a large diagram i.e. a diagram of custom subject correlativities but I am not able to do certain things. To do this I am going to use TikZ.



      Ingredients



      The ingredients are:




      1. A title. There is not much to say.


      2. Subjects. To create these objects I will use the source code of this very helpful answer:



        Subject picture




      3. Big rectangles. Every rectangle will indicate the year (a.k.a. level) in which the subjects are grouped:



        Rectangle




      4. Arrows. They relate the subjects within the same year of the curriculum and even between different years:



        Arrow




      How things are assembled




      1. The subjects are grouped within a rectangle (year career).

      2. Two subjects can be related in the same year, or in different years. The relation between subjects of the same year are always side by side (one on the left, one on the right).


      What I have done



      MWE:



      documentclass{article}
      usepackage[showframe,margin=0in,footskip=0.25in,paperwidth=100cm,paperheight=20cm]{geometry}
      usepackage[english]{babel}
      usepackage[utf8]{inputenc}
      usepackage[T1]{fontenc}

      usepackage{hyperref}
      usepackage{tikz}
      tikzset{text field/.style={text height=1.5ex,align=center,rounded corners},
      title field/.style={text height=2ex,text depth=0.3em,anchor=south,text
      width=4.5cm,align=center,font=footnotesizesffamily},
      pics/fillable subject/.style={code={%
      node[text field] (-TF)
      {hspace*{-0.5em}TextField[align=1,name=#1-day,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1 1}]~~/hspace*{-0.15em}TextField[align=1,name=#1-month,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1 1}]~~/hspace*{-0em}TextField[align=1,name=#1-year,width=2em,charsize=7pt,maxlen=4,bordercolor={1 1 1}]{}~};
      node[title field] (-Title)
      at ([yshift=0.4em]-TF.north) {#1};
      draw[rounded corners] (-TF.south west) |- (-Title.south west)
      |- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
      -- cycle;
      draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
      }},
      pics/nonfillable subject/.style={code={%
      node[text field] (-TF)
      {hspace{1.2em}~/~hspace{1.15em}~/~hspace{2.35em}{}};
      node[title field] (-Title)
      at ([yshift=0.4em]-TF.north) {#1};
      draw[rounded corners] (-TF.south west) |- (-Title.south west)
      |- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
      -- cycle;
      draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
      }},
      }

      begin{document}

      thispagestyle{empty} % To suppress page number

      noindent
      begin{tikzpicture}
      fill[white,fill=orange] (0,0) rectangle (paperwidth,-2cm) node[midway,align=center,font=Huge] {bfseries Some text here\LARGE More text here};
      end{tikzpicture}

      noindent
      begin{Form} % From https://tex.stackexchange.com/a/478346/152550
      begin{tikzpicture}
      path (0,0) pic (Geo) {nonfillable subject={Subject}} (8.5cm,0) pic (Whatever) {nonfillable subject={Subject}} (15cm,0) pic[draw=red] (Math) {nonfillable subject={Math}};
      draw[-latex] (Geo-Title) -- (Whatever-Title);
      draw[-latex] (Whatever-Title) -- (Math-Title);
      end{tikzpicture}
      end{Form}

      noindent
      begin{tikzpicture}
      fill[fill=orange!30,rounded corners=50pt] (0,0) rectangle (11.5cm,-14cm) node[midway,align=center,font=LARGE] {bfseries Level $0$};
      end{tikzpicture}

      end{document}


      What I have done



      Final result



      This is what I want:



      What I want



      What I need




      1. The number of rectangles varies between 6 and 7 (not like the last image where they are four). The code should be as simple as possible to be able to add subjects easily.

      2. At most each rectangle has 8 or 9 vertical subjects, and at most each rectangle has 2 horizontal subjects.


      3. The current year's label must be centered superiorly and not centered in the middle:



        Top center




      4. As much as the rectangles and the subjects within the rectangles must be centered horizontally and vertically, not like my MWE that are aligned to the left. Briefly, everything has to be centered:



        Everything has to be centered




      5. There must be an appropriate space between all the objects, and the space between year and year must be the most important thing to take care of since, if there is little space, the arrows will be very close together and the document will look ugly. As a reference, you can take the measurements (in centimeters) that I have calculated:



        Measurements that I have calculated



        If they are 7 years (i.e. the largest amount), then the width of the document will be: (0.5+4.5+1.5+4.5+0.5+3)*7-(3)+(1+1), which is equal to 100.5cm. I have not calculated the height, but it must be around 20cm (considering the maximum of vertical subjects i.e. 8/9/10).



        As long as the length of the sheet is smaller it is much better, but without worsening the diagram visually (because I would also like to adapt the diagram to an A4 format).




      The last thing that could happen



      (Optional requirement)



      Automate the color of the arrows. Each subject has its own arrow color. As you see in "Final result", there are a lot of arrows for each subject, so the ideal would be to have a command that by passing the total number of subjects, say n, divide the gradient of colors in n equal parts, in order to homogenize the colors. If this seems crazy, there is no problem in coloring the arrows manually.



      Thanks!!







      tikz-pgf horizontal-alignment vertical-alignment diagrams






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 25 mins ago







      manooooh

















      asked 51 mins ago









      manoooohmanooooh

      1,0751516




      1,0751516






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478708%2fhow-to-draw-a-diagram-of-custom-subject-correlativities%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478708%2fhow-to-draw-a-diagram-of-custom-subject-correlativities%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          円仁

          平林たい子

          ティム・エリオット