Repository: LMFDB/lmfdb

Issue:
Consistency in indicating cardinality
In some places we use #S to denote the cardinality of S (e.g. on the abstract groups pages), and in other places we use |S| (e.g. on number field and p-adic field pages).  We  should be consistent.


Discussion:
I'm fine with either.  Given that the groups pages are newer, should we adjust them?
@roed314 I think that makes sense, as far as I can tell we use |G| everywhere else (Galois groups, local fields, and number fields).  If we decide want to switch to #G we should update the style guide and then make the change everywhere.
Can we use `\card{G}` everywhere so that the source is semantic and the macro definition
encodes the choice you are making?
On Wed, 17 Nov 2021, 12:35 David W. Farmer, ***@***.***>
wrote:

> Can we use \card{G} everywhere so that the source is semantic and the
> macro definition
> encodes the choice you are making?
>

That exactly what I would suggest though it would be more work to change
all the old occurrences.

—
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/LMFDB/lmfdb/issues/4867#issuecomment-971538665>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAXU32MGIFPXEE7GSAYOITLUMOORNANCNFSM5IEXTG7Q>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
>


Resolving patch:
diff --git a/lmfdb/galois_groups/transitive_group.py b/lmfdb/galois_groups/transitive_group.py
--- a/lmfdb/galois_groups/transitive_group.py
+++ b/lmfdb/galois_groups/transitive_group.py
@@ -115,7 +115,7 @@ def display_short(self, emptyifnotpretty=False):
         gp_label = f"{self.order()}.{self.gapid()}"
         group = db.gps_groups.lookup(gp_label)
         if group and group.get('tex_name'):
-            return "${group['tex_name']}$"
+            return f"${group['tex_name']}$"
         if emptyifnotpretty:
             return ""
         return self._data['name']
diff --git a/lmfdb/groups/abstract/web_groups.py b/lmfdb/groups/abstract/web_groups.py
--- a/lmfdb/groups/abstract/web_groups.py
+++ b/lmfdb/groups/abstract/web_groups.py
@@ -117,9 +117,9 @@ def properties(self):
             props.append(("Abelian", "yes"))
             if self.simple:
                 props.extend([("Simple", "yes"),
-                              (r"#$\operatorname{Aut}(G)$", web_latex(factor(self.aut_order)))])
+                              (r"$\card{\operatorname{Aut}(G)}$", web_latex(factor(self.aut_order)))])
             else:
-                props.append((r"#$\operatorname{Aut}(G)$", web_latex(factor(self.aut_order))))
+                props.append((r"$\card{\operatorname{Aut}(G)}$", web_latex(factor(self.aut_order))))
         else:
             if self.simple:
                 props.append(("Simple", "yes"))
@@ -127,10 +127,10 @@ def properties(self):
                 props.extend([("Nilpotent", nilp_str),
                               ("Solvable", solv_str)])
             props.extend([
-                (r"#$G^{\mathrm{ab}}$", web_latex(self.Gab_order_factor())),
-                ("#$Z(G)$", web_latex(self.cent_order_factor())),
-                (r"#$\operatorname{Aut}(G)$", web_latex(factor(self.aut_order))),
-                (r"#$\operatorname{Out}(G)$", web_latex(factor(self.outer_order))),
+                (r"$\card{G^{\mathrm{ab}}}$", web_latex(self.Gab_order_factor())),
+                ("$\card{Z(G)}$", web_latex(self.cent_order_factor())),
+                (r"$\card{\operatorname{Aut}(G)}$", web_latex(factor(self.aut_order))),
+                (r"$\card{\operatorname{Out}(G)}$", web_latex(factor(self.outer_order))),
             ])
         props.extend([
             ("Rank", f"${self.rank}$"),


Test patch: