How to create a DNA like figure

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I would like to create a sequence like the one in slide 5 of this Stanford set of slides on edit distance.



I would like something like this:
enter image description here



I don't know what package I can use to do this hence, I haven't done anything yet. Do you know what package can be used for this?










share|improve this question









New contributor




ryuzakinho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • Welcome to TeX.SX! Could you add the image of the sequence to your question and what have you done so far?
    – Bobyandbob
    5 hours ago










  • Possibly related (no duplicate, though): tex.stackexchange.com/q/16572/4918
    – Tobi
    4 hours ago















up vote
1
down vote

favorite












I would like to create a sequence like the one in slide 5 of this Stanford set of slides on edit distance.



I would like something like this:
enter image description here



I don't know what package I can use to do this hence, I haven't done anything yet. Do you know what package can be used for this?










share|improve this question









New contributor




ryuzakinho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • Welcome to TeX.SX! Could you add the image of the sequence to your question and what have you done so far?
    – Bobyandbob
    5 hours ago










  • Possibly related (no duplicate, though): tex.stackexchange.com/q/16572/4918
    – Tobi
    4 hours ago













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I would like to create a sequence like the one in slide 5 of this Stanford set of slides on edit distance.



I would like something like this:
enter image description here



I don't know what package I can use to do this hence, I haven't done anything yet. Do you know what package can be used for this?










share|improve this question









New contributor




ryuzakinho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I would like to create a sequence like the one in slide 5 of this Stanford set of slides on edit distance.



I would like something like this:
enter image description here



I don't know what package I can use to do this hence, I haven't done anything yet. Do you know what package can be used for this?







packages






share|improve this question









New contributor




ryuzakinho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




ryuzakinho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 33 mins ago





















New contributor




ryuzakinho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 5 hours ago









ryuzakinho

1084




1084




New contributor




ryuzakinho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





ryuzakinho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






ryuzakinho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • Welcome to TeX.SX! Could you add the image of the sequence to your question and what have you done so far?
    – Bobyandbob
    5 hours ago










  • Possibly related (no duplicate, though): tex.stackexchange.com/q/16572/4918
    – Tobi
    4 hours ago

















  • Welcome to TeX.SX! Could you add the image of the sequence to your question and what have you done so far?
    – Bobyandbob
    5 hours ago










  • Possibly related (no duplicate, though): tex.stackexchange.com/q/16572/4918
    – Tobi
    4 hours ago
















Welcome to TeX.SX! Could you add the image of the sequence to your question and what have you done so far?
– Bobyandbob
5 hours ago




Welcome to TeX.SX! Could you add the image of the sequence to your question and what have you done so far?
– Bobyandbob
5 hours ago












Possibly related (no duplicate, though): tex.stackexchange.com/q/16572/4918
– Tobi
4 hours ago





Possibly related (no duplicate, though): tex.stackexchange.com/q/16572/4918
– Tobi
4 hours ago











2 Answers
2






active

oldest

votes

















up vote
3
down vote



accepted










If you thought of the image on the slide Minimum Edit Distance, here is a code for that:



documentclass[tikz]standalone

begindocument
begintikzpicture

foreach x/y/z in 0/I/*, 1/N/E,2/T/X,3/E/E, 4/*/C, 5/N/U,6/T/T,7/I/I,8/O/O,9/N/N

pgfmathsetmacrocoordx * 0.3
node (xx) at (coord,0) y;
node (yx) at (coord,-1) z;
draw (xx) -- (yx);

foreach x/y in 0/d,1/s,2/s,4/i,5/s

pgfmathsetmacrocoordx * 0.3;
node[anchor=base] at (coord,-1.5) texttty;

endtikzpicture
enddocument


enter image description here



Edit: I have to mention @AndréC's answer for Vertically misaligned node in tikz which partly helped me creating this figure.






share|improve this answer





























    up vote
    0
    down vote













    Here's a realization with xparse. It should be clear what's the role of the first optional argument and of the second. The character ! produces nothing and helps for the alignment.



    documentclassarticle
    usepackageamsmath
    usepackagexparse,array,booktabs

    ExplSyntaxOn
    NewDocumentCommandsedOnormalsizemmo

    group_begin:
    renewcommandarraystretch0
    ttfamily #1
    begintabular @ * tl_count:n #2 wc0.6em@ l @
    tl_map_function:nN #2 ryuza_cell:n \ addlinespace
    tl_map_function:nN #2 ryuza_empty:n \ addlinespace
    tl_map_function:nN #3 ryuza_cell:n
    IfValueT #4
    \ addlinespace tl_map_function:nN #4 ryuza_cell:n
    endtabular
    group_end:


    cs_new_protected:Nn ryuza_cell:n

    str_if_eq:nnTF #1 ! #1 &

    cs_new_protected:Nn ryuza_empty:n

    $Big
    ExplSyntaxOff

    begindocument

    sed
    INTE*NTION
    *EXECUTION
    sed[Large]
    INTE*NTION
    *EXECUTION
    [dss!is!!!!]

    enddocument


    enter image description here





    share




















      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',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );






      ryuzakinho is a new contributor. Be nice, and check out our Code of Conduct.









       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f454114%2fhow-to-create-a-dna-like-figure%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      3
      down vote



      accepted










      If you thought of the image on the slide Minimum Edit Distance, here is a code for that:



      documentclass[tikz]standalone

      begindocument
      begintikzpicture

      foreach x/y/z in 0/I/*, 1/N/E,2/T/X,3/E/E, 4/*/C, 5/N/U,6/T/T,7/I/I,8/O/O,9/N/N

      pgfmathsetmacrocoordx * 0.3
      node (xx) at (coord,0) y;
      node (yx) at (coord,-1) z;
      draw (xx) -- (yx);

      foreach x/y in 0/d,1/s,2/s,4/i,5/s

      pgfmathsetmacrocoordx * 0.3;
      node[anchor=base] at (coord,-1.5) texttty;

      endtikzpicture
      enddocument


      enter image description here



      Edit: I have to mention @AndréC's answer for Vertically misaligned node in tikz which partly helped me creating this figure.






      share|improve this answer


























        up vote
        3
        down vote



        accepted










        If you thought of the image on the slide Minimum Edit Distance, here is a code for that:



        documentclass[tikz]standalone

        begindocument
        begintikzpicture

        foreach x/y/z in 0/I/*, 1/N/E,2/T/X,3/E/E, 4/*/C, 5/N/U,6/T/T,7/I/I,8/O/O,9/N/N

        pgfmathsetmacrocoordx * 0.3
        node (xx) at (coord,0) y;
        node (yx) at (coord,-1) z;
        draw (xx) -- (yx);

        foreach x/y in 0/d,1/s,2/s,4/i,5/s

        pgfmathsetmacrocoordx * 0.3;
        node[anchor=base] at (coord,-1.5) texttty;

        endtikzpicture
        enddocument


        enter image description here



        Edit: I have to mention @AndréC's answer for Vertically misaligned node in tikz which partly helped me creating this figure.






        share|improve this answer
























          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          If you thought of the image on the slide Minimum Edit Distance, here is a code for that:



          documentclass[tikz]standalone

          begindocument
          begintikzpicture

          foreach x/y/z in 0/I/*, 1/N/E,2/T/X,3/E/E, 4/*/C, 5/N/U,6/T/T,7/I/I,8/O/O,9/N/N

          pgfmathsetmacrocoordx * 0.3
          node (xx) at (coord,0) y;
          node (yx) at (coord,-1) z;
          draw (xx) -- (yx);

          foreach x/y in 0/d,1/s,2/s,4/i,5/s

          pgfmathsetmacrocoordx * 0.3;
          node[anchor=base] at (coord,-1.5) texttty;

          endtikzpicture
          enddocument


          enter image description here



          Edit: I have to mention @AndréC's answer for Vertically misaligned node in tikz which partly helped me creating this figure.






          share|improve this answer














          If you thought of the image on the slide Minimum Edit Distance, here is a code for that:



          documentclass[tikz]standalone

          begindocument
          begintikzpicture

          foreach x/y/z in 0/I/*, 1/N/E,2/T/X,3/E/E, 4/*/C, 5/N/U,6/T/T,7/I/I,8/O/O,9/N/N

          pgfmathsetmacrocoordx * 0.3
          node (xx) at (coord,0) y;
          node (yx) at (coord,-1) z;
          draw (xx) -- (yx);

          foreach x/y in 0/d,1/s,2/s,4/i,5/s

          pgfmathsetmacrocoordx * 0.3;
          node[anchor=base] at (coord,-1.5) texttty;

          endtikzpicture
          enddocument


          enter image description here



          Edit: I have to mention @AndréC's answer for Vertically misaligned node in tikz which partly helped me creating this figure.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 3 hours ago

























          answered 4 hours ago









          bmv

          2,437824




          2,437824




















              up vote
              0
              down vote













              Here's a realization with xparse. It should be clear what's the role of the first optional argument and of the second. The character ! produces nothing and helps for the alignment.



              documentclassarticle
              usepackageamsmath
              usepackagexparse,array,booktabs

              ExplSyntaxOn
              NewDocumentCommandsedOnormalsizemmo

              group_begin:
              renewcommandarraystretch0
              ttfamily #1
              begintabular @ * tl_count:n #2 wc0.6em@ l @
              tl_map_function:nN #2 ryuza_cell:n \ addlinespace
              tl_map_function:nN #2 ryuza_empty:n \ addlinespace
              tl_map_function:nN #3 ryuza_cell:n
              IfValueT #4
              \ addlinespace tl_map_function:nN #4 ryuza_cell:n
              endtabular
              group_end:


              cs_new_protected:Nn ryuza_cell:n

              str_if_eq:nnTF #1 ! #1 &

              cs_new_protected:Nn ryuza_empty:n

              $Big
              ExplSyntaxOff

              begindocument

              sed
              INTE*NTION
              *EXECUTION
              sed[Large]
              INTE*NTION
              *EXECUTION
              [dss!is!!!!]

              enddocument


              enter image description here





              share
























                up vote
                0
                down vote













                Here's a realization with xparse. It should be clear what's the role of the first optional argument and of the second. The character ! produces nothing and helps for the alignment.



                documentclassarticle
                usepackageamsmath
                usepackagexparse,array,booktabs

                ExplSyntaxOn
                NewDocumentCommandsedOnormalsizemmo

                group_begin:
                renewcommandarraystretch0
                ttfamily #1
                begintabular @ * tl_count:n #2 wc0.6em@ l @
                tl_map_function:nN #2 ryuza_cell:n \ addlinespace
                tl_map_function:nN #2 ryuza_empty:n \ addlinespace
                tl_map_function:nN #3 ryuza_cell:n
                IfValueT #4
                \ addlinespace tl_map_function:nN #4 ryuza_cell:n
                endtabular
                group_end:


                cs_new_protected:Nn ryuza_cell:n

                str_if_eq:nnTF #1 ! #1 &

                cs_new_protected:Nn ryuza_empty:n

                $Big
                ExplSyntaxOff

                begindocument

                sed
                INTE*NTION
                *EXECUTION
                sed[Large]
                INTE*NTION
                *EXECUTION
                [dss!is!!!!]

                enddocument


                enter image description here





                share






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  Here's a realization with xparse. It should be clear what's the role of the first optional argument and of the second. The character ! produces nothing and helps for the alignment.



                  documentclassarticle
                  usepackageamsmath
                  usepackagexparse,array,booktabs

                  ExplSyntaxOn
                  NewDocumentCommandsedOnormalsizemmo

                  group_begin:
                  renewcommandarraystretch0
                  ttfamily #1
                  begintabular @ * tl_count:n #2 wc0.6em@ l @
                  tl_map_function:nN #2 ryuza_cell:n \ addlinespace
                  tl_map_function:nN #2 ryuza_empty:n \ addlinespace
                  tl_map_function:nN #3 ryuza_cell:n
                  IfValueT #4
                  \ addlinespace tl_map_function:nN #4 ryuza_cell:n
                  endtabular
                  group_end:


                  cs_new_protected:Nn ryuza_cell:n

                  str_if_eq:nnTF #1 ! #1 &

                  cs_new_protected:Nn ryuza_empty:n

                  $Big
                  ExplSyntaxOff

                  begindocument

                  sed
                  INTE*NTION
                  *EXECUTION
                  sed[Large]
                  INTE*NTION
                  *EXECUTION
                  [dss!is!!!!]

                  enddocument


                  enter image description here





                  share












                  Here's a realization with xparse. It should be clear what's the role of the first optional argument and of the second. The character ! produces nothing and helps for the alignment.



                  documentclassarticle
                  usepackageamsmath
                  usepackagexparse,array,booktabs

                  ExplSyntaxOn
                  NewDocumentCommandsedOnormalsizemmo

                  group_begin:
                  renewcommandarraystretch0
                  ttfamily #1
                  begintabular @ * tl_count:n #2 wc0.6em@ l @
                  tl_map_function:nN #2 ryuza_cell:n \ addlinespace
                  tl_map_function:nN #2 ryuza_empty:n \ addlinespace
                  tl_map_function:nN #3 ryuza_cell:n
                  IfValueT #4
                  \ addlinespace tl_map_function:nN #4 ryuza_cell:n
                  endtabular
                  group_end:


                  cs_new_protected:Nn ryuza_cell:n

                  str_if_eq:nnTF #1 ! #1 &

                  cs_new_protected:Nn ryuza_empty:n

                  $Big
                  ExplSyntaxOff

                  begindocument

                  sed
                  INTE*NTION
                  *EXECUTION
                  sed[Large]
                  INTE*NTION
                  *EXECUTION
                  [dss!is!!!!]

                  enddocument


                  enter image description here






                  share











                  share


                  share










                  answered 6 mins ago









                  egreg

                  687k8418313079




                  687k8418313079




















                      ryuzakinho is a new contributor. Be nice, and check out our Code of Conduct.









                       

                      draft saved


                      draft discarded


















                      ryuzakinho is a new contributor. Be nice, and check out our Code of Conduct.












                      ryuzakinho is a new contributor. Be nice, and check out our Code of Conduct.











                      ryuzakinho is a new contributor. Be nice, and check out our Code of Conduct.













                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f454114%2fhow-to-create-a-dna-like-figure%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Comments

                      Popular posts from this blog

                      Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                      Long meetings (6-7 hours a day): Being “babysat” by supervisor

                      Confectionery