@@ -932,7 +932,7 @@ def tabulate(tabular_data, headers=(), tablefmt="simple",
932
932
933
933
Various plain-text table formats (`tablefmt`) are supported:
934
934
'plain', 'simple', 'grid', 'pipe', 'orgtbl', 'rst', 'mediawiki',
935
- 'latex', 'latex_raw' and 'latex_booktabs'. Variable `tabulate_formats`
935
+ 'latex', 'latex_raw' and 'latex_booktabs'. Variable `tabulate_formats`
936
936
contains the list of currently supported formats.
937
937
938
938
"plain" format doesn't use any pseudographics to draw tables,
@@ -1074,25 +1074,25 @@ def tabulate(tabular_data, headers=(), tablefmt="simple",
1074
1074
</tbody>
1075
1075
</table>
1076
1076
1077
- "latex" produces a tabular environment of LaTeX document markup and replaces
1078
- common characters like `\` and `_` with their LaTeX correspondents:
1077
+ "latex" produces a tabular environment of LaTeX document markup:
1079
1078
1080
- >>> print(tabulate([["spam_0 ", 41.9999], ["eggs\\ 0 ", "451.0"]], tablefmt="latex"))
1079
+ >>> print(tabulate([["spam ", 41.9999], ["eggs", "451.0"]], tablefmt="latex"))
1081
1080
\\ begin{tabular}{lr}
1082
1081
\\ hline
1083
- spam\\ _0 & 41.9999 \\ \\
1084
- eggs\\ textbackslash{}0 & 451 \\ \\
1082
+ spam & 41.9999 \\ \\
1083
+ eggs & 451 \\ \\
1085
1084
\\ hline
1086
1085
\\ end{tabular}
1087
1086
1088
- "latex_raw" produces a tabular environment of LaTeX document markup without
1089
- replacement of common ciritical LaTeX characters:
1087
+ "latex_raw" is similar to "latex", but doesn't escape special characters,
1088
+ such as backslash and underscore, so LaTeX commands may embedded into
1089
+ cells' values:
1090
1090
1091
- >>> print(tabulate([["spam_0 ", 41.9999], ["eggs \\ 0 ", "451.0"]], tablefmt="latex_raw"))
1091
+ >>> print(tabulate([["spam$_9$ ", 41.9999], ["\\ \\ emph{eggs} ", "451.0"]], tablefmt="latex_raw"))
1092
1092
\\ begin{tabular}{lr}
1093
1093
\\ hline
1094
- spam_0 & 41.9999 \\ \\
1095
- eggs \\ 0 & 451 \\ \\
1094
+ spam$_9$ & 41.9999 \\ \\
1095
+ \\ emph{eggs} & 451 \\ \\
1096
1096
\\ hline
1097
1097
\\ end{tabular}
1098
1098
0 commit comments