MathJax, create a fraction, but don't center it relative to text - mathjax

I want to be able to make a fraction. Which I have done:
However, I want the numerator to be regular text. I just want to underline "whose company" and place a B below it. So something more like:

Try
\mathop{\underline{\text{Whose Company}}}\limits_{\hbox{B}}

Related

FormatNumber - How to hide comma as decimal seperator?

OK this is really bugging me now.
We use comma as decimal seperator and I want to hide it if decimals are 0.
How do you do that?
For example for number: '15.213.122,00'
I would like to show just '15.213.122' and not '15.213.122,'
#.###,## Doesn't work. This might work for english muberics tho: #,###.##
Excel does it for you if you set the formatting to "General". Unless you want some special format, which requires something else.

How to put comma in a number excel

I have two numbers : 7,8 and 6,8.
When I multiply these numbers I get #VALUE!. I know, this happens because excel thinks, these numbers are strings because of the comma. But i cannot use separator . (point) because in my task, numbers are with , (comma). I tried different number functions, but all of them converts numbers with point (eg. 7.8 , 6.8). What I need to do? Thanks for advices.
To multiply them as whole numbers, use:
=SUBSTITUTE(A1,",","")*SUBSTITUTE(B1,",","")
to display 5304. To multiply as decimal fractionals, use:
=SUBSTITUTE(A1,",",".")*SUBSTITUTE(B1,",",".")
to display 53.04
Go to Advanced Options
Deselect "Use System Separators"
Fill in comma for decimal and space for thousands
Now you can do it:
This will make the change for all Excel documents.
An alternative, which will make the change throughout your system, would be to change your Windows Regional settings the same way. Be sure to change both number and currency if you do that.

Trying to show only a certain amount of numbers

To make the sale to my customer I need to import numbers from a report into an Excel document. For example the number coming in will be 14.182392. The only reason for my guy not to buy the product is because he only wants to view 14.182 on the Excel sheet. Okay so the other catch is, the number CANNOT be rounded in any shape or form.
So what I need is a way to just show so much of number, WITHOUT ROUNDING.
Is this possible? Any ideas of how I could get around this would be fantastic.
Please try:
=TEXT(INT(A1)+VALUE(LEFT(MOD(A1,1),5)),"00.000")
Firstly =TRUNC is a better answer (much shorter). My version was connected with uncertainty in your requirement (it is odd!) and in the hope it might be easier to adjust if not exactly what you/your boss wanted.
TRUNC literally just truncates the decimals (no rounding!) to a length to suit (ie 3 if to show nn.182 given nn.182392 or say nn.182999).
LEFT may also be a better choice, but that depends upon knowing how large the integer part of your number is. =LEFT(A1,6) would display 14.189 given say 14.189999 in A1. However it would show 1.4189 given 1.4189999 in A1 (ie four decimal places).
The formula above combines text manipulation with number manipulation.:
INT takes just the integer value (here 14.)
MOD takes just the modulus – the residual that is not an integer after division, in this case by 1. So just the .182392 part. LEFT is then applied here in a similar way to as used above, but without needing to concern oneself with the length of the integer part of the source value (ie 14 or 1 etc does not matter).
VALUE then converts the result back into numeric format (string manipulation functions such as LEFT always return text format) so our abbreviated decimal string can then be added to our integer.
Finally, the TEXT part is for formatting but is hard or impossible to justify! About the only use is that it displays the result left-justified in the cell – perhaps a little warning that the number displayed is not the “true” value (eg it won’t SUM) because, as a result of a formula, it won’t be marked with a little green warning triangle.
The displayed values can use the TRUNC function like this,
=TRUNC(A1, 3)
But you must use A1 in any calculations to retain the precision of the raw value.
Easiest way I know:
=LEFT(A1; x)
where x = the amount of characters You want. Mind that the dot counts as a character as well.

How do I change the color of each letter in a sentence in LaTeX?

I've been struggling in find the solution for the following problem.
If I want to change the color of each letter in a sentence in latex, how can I do it? Let's say that I want to write "Merry Christmas" using the colors red and green and alternating between them.
I want to define a command and use a forloop to change the color of each letter, but I don't know:
How can I find the number of letters in a sentence (excluding spaces) to give the upper limit for the forloop?
How can I define a string with the two colors to use in the forloop?
So far my silly "solution" is to do it manually, like:
\documentclass[a4paper,12pt]{article}
\usepackage[utf8x]{inputenc}
\usepackage{xcolor}
\begin{document}
\textcolor{red}{M}\textcolor{green}{e}\textcolor{red}{r}
\textcolor{green}{r}\textcolor{red}{y}\textcolor{green}{C}
\textcolor{red}{h}\textcolor{green}{r}\textcolor{red}{i}
\textcolor{green}{s}\textcolor{red}{t}\textcolor{green}{m}
\textcolor{red}{a}\textcolor{green}{s}\textcolor{red}{!}
\end{document}
From what I saw I can define an environment and use a loop to alternate between the colors, I don't have a sensilble solution, but it would be something like:
\newenvironment{redgreen}{
\forloop{WORDNUMBER}{1}{\VALUE{WORDNUMBER} < \LENGHT{WORDNUMBER}}{
\textcolor{red}{WORDNUMBER}
\textcolor{green}{WORDNUMBER + 1}
WORDNUMBER = WORDNUMBER + 2
}
}
The parts with capital letters I know won't work, I just want to give an example of what I'm willing to do. I want to find a way to get the number of letters in the sentence that I would put inside the redgreen block and somehow use the forloop to change the color of each letter in the sentence alternating between red and green. I'm not sure how the forloop works in latex, so everything in the example above may be trash.

Calculating all number from a text file (division)

I have a file or a text which contains huge numbers. This is how it looks:
2622256647732477952, 3146707977278973440, 3776049572734768128, 4531259487281721344, 5437511384738065408, 6525013661685678080, 7830016394022813696, 9396019672827375616, 11275223607392849920, 13530268328871419904,
I want to divide every number by the factor of 100. Is there any fast way to do this? notepadd++ maybe? or any 3rd party editor which is able to do such stuff?
It's around 1000 numbers would be pretty time consuming to do this manually.
All the numbers seem to be integers. If that is true, and if they are all above 100 (the divisor), why not just use a regular expression to insert a decimal point in every number.
In Notepad++ try:
Search string: (\d+)(\d{2})
Replace string: $1.$2
Check "Regular expression" box and hit "Replace all".
Edit:
In the special case you mention in your comment, where the decimals should just be disregarded, you can simply use (\d+)\d{2} as search string and $1 as the replace string. Note that the result won't be rounded to the nearest integer though (11189 should become 112 really, but you'll get 111).
Other options include importing the string into Excel or other spreadsheet software and use a formula in there, writing a javascript snippet to split the string up and divide each number etc.

Resources