MilesCranmer commited on
Commit
0cb1353
1 Parent(s): c6c8728

Fix margins on LaTeX table

Browse files
Files changed (2) hide show
  1. pysr/export_latex.py +1 -1
  2. test/test.py +2 -2
pysr/export_latex.py CHANGED
@@ -12,7 +12,7 @@ def set_precision_of_constants_in_string(s, precision=3):
12
 
13
 
14
  def generate_top_of_latex_table(columns=["Equation", "Complexity", "Loss"]):
15
- margins = "".join([("c" if col == "Equation" else "l") for col in columns])
16
  latex_table_pieces = [
17
  r"\begin{table}[h]",
18
  r"\begin{center}",
 
12
 
13
 
14
  def generate_top_of_latex_table(columns=["Equation", "Complexity", "Loss"]):
15
+ margins = "".join([("l" if col == "Equation" else "c") for col in columns])
16
  latex_table_pieces = [
17
  r"\begin{table}[h]",
18
  r"\begin{center}",
test/test.py CHANGED
@@ -502,7 +502,7 @@ class TestLaTeXTable(unittest.TestCase):
502
  true_latex_table_str = r"""
503
  \begin{table}[h]
504
  \begin{center}
505
- \begin{tabular}{@{}clll@{}}
506
  \toprule
507
  Equation & Complexity & Loss & Score \\
508
  \midrule"""
@@ -510,7 +510,7 @@ class TestLaTeXTable(unittest.TestCase):
510
  true_latex_table_str = r"""
511
  \begin{table}[h]
512
  \begin{center}
513
- \begin{tabular}{@{}cll@{}}
514
  \toprule
515
  Equation & Complexity & Loss \\
516
  \midrule"""
 
502
  true_latex_table_str = r"""
503
  \begin{table}[h]
504
  \begin{center}
505
+ \begin{tabular}{@{}lccc@{}}
506
  \toprule
507
  Equation & Complexity & Loss & Score \\
508
  \midrule"""
 
510
  true_latex_table_str = r"""
511
  \begin{table}[h]
512
  \begin{center}
513
+ \begin{tabular}{@{}lcc@{}}
514
  \toprule
515
  Equation & Complexity & Loss \\
516
  \midrule"""