MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / nestedLists

Method nestedLists

SLiCAP/SLiCAPlatex.py:827–865  ·  view source on GitHub ↗

Creates and returns a LaTeX table snippet that can be included in a LaTeX document. Each list is converted into a table row and must have equal lengths. There can be one column with units. A label can be given as reference and a caption can be added. :par

(self, headerList, linesList, unitpos=None, caption='', 
                    label='', color="myyellow")

Source from the content-addressed store, hash-verified

825 return Snippet(TEX, self.format)
826
827 def nestedLists(self, headerList, linesList, unitpos=None, caption='',
828 label='', color="myyellow"):
829 """
830 Creates and returns a LaTeX table snippet that can be included in a
831 LaTeX document. Each list is converted into a table row and
832 must have equal lengths. There can be one column with units.
833
834 A label can be given as reference and a caption can be added.
835
836 :param headerList: List with column headers.
837 :type headerList: list with strings
838
839 :param linesList: List with lists of table data for each table row
840 :type linesList: list
841
842 :param unitpos: Position of column with units (will be typesetted with mathrm)
843 :type unitpos: int, str
844
845 :param caption: Table caption, defauls to ''
846 :type caption: str
847
848 :param label: Table reference label
849 :type label: str
850
851 :param color: Alternate row color name, should be defined in
852 'preambuleSLiCAP.tex' defaults to 'myyellow'. Use None for
853 no background color.
854 :type color: str
855
856 :return: LaTeX snippet to be included in a LaTeX document
857 :rtype: str
858 """
859 alignstring = "[c]{"
860 for item in headerList:
861 alignstring += "l"
862 alignstring += "}"
863 TEX = _TEXcreateCSVtable(headerList, linesList, alignstring,
864 unitpos, caption, label, color)
865 return Snippet(TEX, self.format)
866
867def sub2rm(textext):
868 """

Callers

nothing calls this directly

Calls 2

SnippetClass · 0.90
_TEXcreateCSVtableFunction · 0.85

Tested by

no test coverage detected