3
$\begingroup$

I can enter large integer numbers as 2*^11. Is there any way to get such an object as output? I am asking because I want to generate ticks for my plot in this form, i.e., without a dot tailing the number. Here is specifically the command I am using

Needs["CustomTicks`"];
Needs["MaTeX`"]
LinTicks[0, 10^12, TickLabelFunction -> (MaTeX[ScientificForm[#]] &)]

enter image description here

I want to remove the dot after the 2 in the red circled entry.

$\endgroup$
5
$\begingroup$

One silly idea is to use:

ScientificForm[#, NumberPoint->""]&

It is silly because it will give wrong answers if more than 1 significant digit is shown (but maybe this doesn't happen in your usage?). You could instead come up with a more complicated function to format the numbers.


The following answer is not helpful. Only real numbers get scientific formatting, so preventing numericization will also prevent scientific formatting. However, it may be useful for other situations where unneeded numericization occurs.

However, it is possible that the real issue is the tick generation code is mistakenly numericizing the labels. If that is the issue here, than you can prevent it by using a wrapper. For example:

SetAttributes[NHoldForm, NHoldFirst];
NHoldForm /: MakeBoxes[NHoldForm[e_], f_] := MakeBoxes[e, f]

Then try using the following:

TickLabelFunction -> (MaTeX[NHoldForm @ ScientificForm[#]] &)

I don't use those packages, so this is just a guess.

$\endgroup$
  • $\begingroup$ I like this idea. At least for ticks, if some of them have a number after the dot, then all numbers should be given with that precision. For instance, ticks should then be {$2.0\times 10^{11}$,$2.5\times10^{11}$,...} in LaTeX form. $\endgroup$ – Felix Mar 2 '17 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.