[Solved] How to make variables with coefficients italic?

Discuss the formula editor

[Solved] How to make variables with coefficients italic?

Postby 22878 » Wed Jul 08, 2020 9:01 pm

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.
Last edited by MrProgrammer on Thu Jul 23, 2020 5:09 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved]
OpenOffice 4.1.5 on Windows 10
22878
 
Posts: 20
Joined: Tue Jul 07, 2020 1:02 am

Re: How to make variables with coefficients italic?

Postby FJCC » Wed Jul 08, 2020 9:27 pm

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.
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 7834
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: How to make variables with coefficients italic?

Postby 22878 » Wed Jul 08, 2020 10:26 pm

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 883 times
OpenOffice 4.1.5 on Windows 10
22878
 
Posts: 20
Joined: Tue Jul 07, 2020 1:02 am

Re: How to make variables with coefficients italic?

Postby Lupp » Thu Jul 16, 2020 12:05 pm

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.)
On Windows 10: LibreOffice 7.0 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
Lupp
Volunteer
 
Posts: 2937
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: How to make variables with coefficients italic?

Postby 22878 » Thu Jul 16, 2020 11:49 pm

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 }
OpenOffice 4.1.5 on Windows 10
22878
 
Posts: 20
Joined: Tue Jul 07, 2020 1:02 am

Re: How to make variables with coefficients italic?

Postby Lupp » Fri Jul 17, 2020 12:10 am

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.
On Windows 10: LibreOffice 7.0 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
Lupp
Volunteer
 
Posts: 2937
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany


Return to Math

Who is online

Users browsing this forum: No registered users and 2 guests