it works again
[pspp] / src / output / tex.c
index cc46ee32272eca101e0f6b379d25ccf92b83367e..bf5eb7115ea540a7e65cbd4debb33970d26b32f3 100644 (file)
@@ -380,16 +380,18 @@ tex_submit (struct output_driver *driver,
 
 static void
 tex_put_footnote_markers (struct tex_driver *tex,
-                          struct footnote **footnotes,
+                          struct pivot_footnote **footnotes,
                           size_t n_footnotes)
 {
   if (n_footnotes > 0)
     shipout (&tex->token_list, "$^{");
   for (size_t i = 0; i < n_footnotes; i++)
     {
-      const struct footnote *f = footnotes[i];
-
-      tex_escape_string (tex, f->marker, true);
+      char *marker = pivot_value_to_string (footnotes[i]->marker,
+                                            SETTINGS_VALUE_SHOW_DEFAULT,
+                                            SETTINGS_VALUE_SHOW_DEFAULT);
+      tex_escape_string (tex, marker, true);
+      free (marker);
     }
   if (n_footnotes > 0)
     shipout (&tex->token_list, "}$");
@@ -409,7 +411,7 @@ tex_output_table_layer (struct tex_driver *tex, const struct pivot_table *pt,
   /* Tables are rendered in TeX with the \halign command.
      This is described in the TeXbook Ch. 22 */
   struct table *title, *layers, *body, *caption;
-  struct footnote **footnotes;
+  struct pivot_footnote **footnotes;
   size_t n_footnotes;
   pivot_output (pt, layer_indexes, &title, &layers, &body,
                 &caption, NULL, &footnotes, &n_footnotes);
@@ -543,10 +545,20 @@ tex_output_table_layer (struct tex_driver *tex, const struct pivot_table *pt,
 
   for (int i = 0; i < n_footnotes; ++i)
     {
+      char *marker = pivot_value_to_string (footnotes[i]->marker,
+                                            SETTINGS_VALUE_SHOW_DEFAULT,
+                                            SETTINGS_VALUE_SHOW_DEFAULT);
+      char *content = pivot_value_to_string (footnotes[i]->content,
+                                            SETTINGS_VALUE_SHOW_DEFAULT,
+                                            SETTINGS_VALUE_SHOW_DEFAULT);
+
       shipout (&tex->token_list, "$^{");
-      tex_escape_string (tex, footnotes[i]->marker, false);
+      tex_escape_string (tex, marker, false);
       shipout (&tex->token_list, "}$");
-      tex_escape_string (tex, footnotes[i]->content, false);
+      tex_escape_string (tex, content, false);
+
+      free (content);
+      free (marker);
     }
 
   shipout (&tex->token_list, "}\n\\vskip 3ex\n\n");