def _add_docs(object_map, docs, typ, head):
    """
    Adds documentation for a set of pyomo components to a markdown table

    Args:
        object_map (PyomoSympyBimap): Pyomo, sympy, LaTeX mapping
        docs: string containing a mardown table
        typ: the class of objects to document (Var, Expression, ExternalFunction)
        head: a string to used in the sybol table heading for this class of objects
    Returns:
        A new string markdown table with added doc rows.
    """
    docked = set() # components already documented, mainly for indexed compoents
    whead = True  # write heading before adding first item
    for i, sc in enumerate(object_map.sympyVars()):
        c = object_map.getPyomoSymbol(sc)
        c = c.parent_component() # Document the parent for indexed comps
        if not isinstance(c, typ): continue
        if whead: # add heading if is first entry in this section
            docs += "**{}** | **Doc** | **Path**\n".format(head)
            whead = False
        if id(c) not in docked:
            docked.add(id(c)) # make sure we don't get a line for every index
            try: #just document the parent of indexed vars
                s = object_map.parent_symbol[c][1]
            except KeyError: # non-indexed vars
                s = object_map.sympy2latex[sc]
            docs += "${}$|{}|{}\n".format(s, c.doc, c)
    return docs