     add_menu(latexbar, templates)
 
     # TODO merge this with the usual text formatting toolbar, such that its list of actions is inserted here
+    # IDEA: maybe, clicking on the "Format" dropdown shows the cloned formatting toolbar?
     text = ["Format", "Text formatting",
             [
              ["<b>Bold</b>", "#bold"]

#

make_bar = (cls) ->
    return $("<span class='btn-group #{cls}'></span>")

# this adds the content of a dropdown menu (basically, single or triple entries)

    # -- r specific --
    rbar = $(".salvus-editor-redit-buttonbar")

    r_basic = make_bar()
    add_icon(r_basic, "<i class='fa'>#</i>", "#comment", "Comment selected text")
    add_icon(r_basic, "$\\vec v$", "#vector", "Insert a vector")

    r_control = $("<span class='btn-group'></span>")
    r_control_entries = ["Control", "Control Structures",
                        [["For-Loop", "#forloop", "Insert a for loop"]
                        ]]
    add_menu(r_control, r_control_entries)

    r_stats = make_bar()
    r_stats_entries = ["Stats", "Basic Statistical Functions",
                      [["Summary of some object", "#summary"]]
                      ]
    add_menu(r_stats, r_stats_entries)

    r_plot = make_bar()
    r_plot_entries = ["Plots", "Basic Plots",
                     [["Plot x/y pairs", "#plot"]
                     ]]
