Page 1 of 1

[Solved] How to make variables with coefficients italic?

PostPosted: Wed Jul 08, 2020 9:01 pm
by 22878
For some reason if a variable has a coefficient next to it the variable will not be italic like variables without coefficients. For instance, 2x, the x won't be italic. What is the easiest way to make these variables italic? I know I can put a space between the coefficient and variable and use nospace to make it how I want, but that's a lot of added code. I also know I can add an "italic" styling to a bracket that encompasses the entire equation and it will make these variables with coefficients italic, but it also makes all the numbers italic and I don't want that. Is there a way to add an italic styling to all text only and not numbers? I tried using the formatting fonts to make text italic, but that doesn't seem to do anything.

Re: How to make variables with coefficients italic?

PostPosted: Wed Jul 08, 2020 9:27 pm
by FJCC
Wrapping the x in brackets seems to work. Compare the two parts of
Code: Select all   Expand viewCollapse view
2{x} + 2x

That is some extra typing but perhaps it is not too much.

Re: How to make variables with coefficients italic?

PostPosted: Wed Jul 08, 2020 10:26 pm
by 22878
FJCC wrote:Wrapping the x in brackets seems to work. Compare the two parts of
Code: Select all   Expand viewCollapse view
2{x} + 2x

That is some extra typing but perhaps it is not too much.


Hey, yes, that works to make the variable italic but then it adds a space between the coefficient and the variable. See image below. I can remove the space with nospace, but that's a lot of extra code. I can add a nospace to a bracket that covers the entire equation and it seems to remove all spaces between coefficients and variables, but not if they are in the numerator or denominator of a fraction. I still have to put brackets around those and add another nospace.

Untitled.png
https://imgbb.com/][img]https://i.ibb.co/w6gz3mp/Untitled.png
Untitled.png (4.25 KiB) Viewed 885 times

Re: How to make variables with coefficients italic?

PostPosted: Thu Jul 16, 2020 12:05 pm
by Lupp
Spaces are delimiters in Math if not made literals explicitly with the help of quotes. Therefore you only need to enter a space in front of the x to make clear that 2x not is a single item. Doing so you will also get a little distance between the 2 and the x - due to Math trying to obey conventions. The distance will be smaller, however, than it would be following the suggestion with the pair of curly brackets.
Try
Code: Select all   Expand viewCollapse view
int {{2 x^2} over {x^{1/3}} + {3 x} over {x ^{1/2}} -1 over {x^{1/3}} dx}

It does as I would expect and like it.
If you like it otherwise, you may reduce the 'Spacing' using the Format menu of Math. I don't know in what way this would afflict different situations. Therefore I would dissuade from "stubborn" settings.

(And, please: Next time also post the MathML code if you again attach a formula as an image. No contributor is fond of wasting time with a reconstruction.)

Re: How to make variables with coefficients italic?

PostPosted: Thu Jul 16, 2020 11:49 pm
by 22878
Lupp wrote:Spaces are delimiters in Math if not made literals explicitly with the help of quotes. Therefore you only need to enter a space in front of the x to make clear that 2x not is a single item. Doing so you will also get a little distance between the 2 and the x - due to Math trying to obey conventions. The distance will be smaller, however, than it would be following the suggestion with the pair of curly brackets.
Try
Code: Select all   Expand viewCollapse view
int {{2 x^2} over {x^{1/3}} + {3 x} over {x ^{1/2}} -1 over {x^{1/3}} dx}

It does as I would expect and like it.
If you like it otherwise, you may reduce the 'Spacing' using the Format menu of Math. I don't know in what way this would afflict different situations. Therefore I would dissuade from "stubborn" settings.

(And, please: Next time also post the MathML code if you again attach a formula as an image. No contributor is fond of wasting time with a reconstruction.)


This is the code I'm using to make it look how I want.

Code: Select all   Expand viewCollapse view
size 28 nospace { {} = int left( { nospace{2 x^2} over {x^{1/3}} } + { nospace{3 x} over {x^{1/3}} } - { 1 over {x^{1/3}} }right)dx }

Re: How to make variables with coefficients italic?

PostPosted: Fri Jul 17, 2020 12:10 am
by Lupp
Well, if you are happy with it, it's ok, of course.

The usage of nospace is not a good solution, however, imo, and the internal setting of a size is similar.

Formulas not keeping standards and using a lot of direct internal formatting cannot easily be harmonized if once needed - when formulas created in different documents get consolidated in a common document e.g. The 'Format' settings should do the formatting, basically (like styles do in text documents or in spreadsheets), and they should be created in a way that the rest is "pure content" as much as possible. Detailed "pretty styling" isn't well merged with automated parts of typesetting.