I am trying to clean up the appearance of user-generated documentation in 11.1. I believe in some cases I need to set options based on the front end version: use one value for 10.0-11.0 and a different value for 11.1 or later.
What is the best way to do this?
From this post, I learned that we can use FEPrivate`Switch
to set a different value for each specific version. However, I would prefer to simply decide based on whether the version is less than 11.1 or not. Is this possible? Is there a way to test for inequality, even through FEPrivate`$ProductVersion
appears to be a string?
The best I could come up with so far is
FEPrivate`If[
FEPrivate`MemberQ[{"10.0", "10.1", "10.2", "10.3", "10.4", "11.0"}, FEPrivate`$ProductVersion],
1,
2]
As described in the linked post, you can see the output with
MathLink`CallFrontEndHeld@
FrontEnd`Value[
FEPrivate`If[
FEPrivate`MemberQ[{"10.0", "10.1", "10.2", "10.3", "10.4", "11.0"},
FEPrivate`$ProductVersion], 1, 2]]
This still requires listing each existing version separately, so it is not ideal.
Here is something I tried that did not work:
MathLink`CallFrontEndHeld@FrontEnd`Value[
FEPrivate`If[FEPrivate`Less[FEPrivate`$ProductVersion, 11.1], 1, 2]
]
It returns Null
instead of 1
or 2
.
I think it does not work because $ProductVersion
is a string, not a number.
Why do I need this? You can see that the appearance of the See Also section is not correct in user-generated doc pages:
This is because they have FontFamily -> "Verdana"
hard-coded. Removing this fixes the appearance in 11.1, but breaks it for earlier versions.
Is there a better way to deal with this than to have an explicitly conditional FontFamily
setting in each of these cells? Note that I can't even just change the RefLink style, as that is used elsewhere as well. Is there perhaps a way to change the RefLink style only within the SeeAlso style?