Bug 32419 - When inserted on Writer, get "Base size" for formulas from underlying paragraph
Summary: When inserted on Writer, get "Base size" for formulas from underlying paragraph
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
3.3.0 RC1
Hardware: All All
: medium enhancement
Assignee: Igor Danilets
URL:
Whiteboard:
Keywords: difficultyInteresting, easyHack, needsDevEval, skillCpp
: 67373 70547 99644 108665 (view as bug list)
Depends on:
Blocks: Formula-Editor
  Show dependency treegraph
 
Reported: 2010-12-15 09:58 UTC by RGB
Modified: 2019-03-08 03:38 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Mock-up for font size menu (27.13 KB, image/png)
2010-12-15 09:58 UTC, RGB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description RGB 2010-12-15 09:58:19 UTC
Created attachment 41148 [details]
Mock-up for font size menu

One thing that will make Math a lot better is the ability to inherit some characteristics from the underlining paragraph.
On the font size menu, Math should have an option for the base size (maybe a check box, see the attached mockup) to enable a time saver feature: load the base size from the underlining paragraph.
Notice that when the "use paragraph settings" (a better wording is needed...) is checked, the base size box is grayed out.
This "paragraph setting" could refer to the paragraph itself or to the character style applied to were the Math object is anchored: this way, by applying a paragraph or character style or even direct formatting to the text surrounding the Math object the font size will be picked as the base size for the formula.

Usercase: A couple of years ago I was appointed to write a physics book for entry level students describing some historical experiments. At the beginning, the editor instruct me to use a big format (A4, with large margins and a 12 points font). I decided to use Writer because the layout I wanted was very difficult to accomplish on LaTeX (several figures wrapped with text, many of them being not rectangular) and the available time was very short. Of course, when I was half way in the writing process, the editor changed mind (budget reasons, I think) and we ended with an A5, 11 points and tiny margins book... Thanks to a proper use of styles, I was able to change page and font sizes in no time, but Math objects... that was no so easy: I needed to edit all the Math objects one by one!
Comment 1 Regina Henschel 2011-07-05 15:54:17 UTC
Till someone implement it, you can use my macros in http://www.rhenschel.homepage.t-online.de/FormulaFontAndSizeToolsInside.odt to adapt formulas to the paragraph.
Comment 2 Björn Michaelsen 2011-12-23 11:34:59 UTC Comment hidden (obsolete)
Comment 3 Björn Michaelsen 2011-12-23 12:57:19 UTC
An EasyHack should have been checked by developers and thus is confirmed regardless of age. Moving back to NEW from NEEDINFO again. Sorry for the hassle.
Comment 4 Francisco 2013-04-14 18:09:01 UTC
This should be implemented... and if not possible, at least a simpler way to edit sizes and typeface of formulas.

> Thanks to a proper use of styles, I was able to change page and font 
> sizes in no time, but Math objects... that was no so easy: I needed 
> to edit all the Math objects one by one!

I have experienced exactly the same issue just some weeks ago.
Comment 5 Francisco 2013-04-14 18:10:31 UTC
Sorry, I forgot to add at the beginning "In my humble opinion..."
Comment 6 Björn Michaelsen 2013-10-04 18:47:31 UTC
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.

see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Comment 7 Yury 2013-12-09 09:57:30 UTC
Would the hacky scripts changing settings formula objects still work in libreoffice 4.1 and libreofficedev 4.2 ? I've been happily using python variation of somebody's code I've seen on forumas or something, going like: 

import uno

def SameFontSettingsForAll( ):
  oDoc = XSCRIPTCONTEXT.getDocument()
  all_embeds = oDoc.getEmbeddedObjects()
  all_embeds_cnt = all_embeds.getCount()
  for i in xrange(0,all_embeds_cnt) :
    embedded = all_embeds.getByIndex(i);
    if embedded.Model.supportsService("com.sun.star.formula.FormulaProperties")
:
...

But in libreoffice 4.1 and libreofficedev 4.2 this fails with explanation:

global name 'xrange' is not defined

What should I change?
Comment 8 Niklas Johansson 2013-12-09 11:17:54 UTC
Yury, please use the users list or Ask for these types of questions. 

Since you asked I'll answer this time. Use range instead of xrange. This is because xrange no longer exist in Python 3.3 which is the version bundled with LibreOffice 4.1. 

For more information see http://docs.python.org/3/whatsnew/3.0.html
Comment 9 Owen Genat (retired) 2014-08-28 11:31:17 UTC
*** Bug 67373 has been marked as a duplicate of this bug. ***
Comment 10 Owen Genat (retired) 2014-08-28 11:32:02 UTC
*** Bug 70547 has been marked as a duplicate of this bug. ***
Comment 11 QA Administrators 2014-10-23 17:31:47 UTC Comment hidden (obsolete)
Comment 12 Yury 2014-11-04 09:32:52 UTC
Strictly speaking, that isn't a bug, but a request for (rather needed) enhancement.
Comment 13 Aneesh Dandime 2015-11-10 04:50:32 UTC
I am taking up the task of implementing this enhancement.
Comment 14 Yury 2015-11-10 05:22:57 UTC
(In reply to Aneesh Dandime from comment #13)
> I am taking up the task of implementing this enhancement.

Nice and commendable :). Thanks in advance!

While you are digging, would you please consider the following suggestion for your solution: use special set of character styles, used for setting the fontfaces, bold/italics, etc. in formulas?

Those styles could have names on the lines of "*formula", "*formula (functions)", etc., and be initialised, e.g., from default char style. (Can you have "commonly hidden" style names in LO?)

Now, those styles would be used on new formula creation, if present. Their use could be switched off for individual formulas (like with checkbox "use formula look styles" in formula properties). AND their use should be switchable off for the document as a whole, too.

P.S. If I had any hope of implementing it in reasonable timeframe, I'd have a try myself. Current functionality is a pain to work with. As it is, I can only try to envision the look-and-feel of how I'd wish this to work.
Comment 15 Aneesh Dandime 2015-11-10 06:59:58 UTC
(In reply to Yury from comment #14)
> (In reply to Aneesh Dandime from comment #13)
> > I am taking up the task of implementing this enhancement.
> 
> Nice and commendable :). Thanks in advance!
> 
> While you are digging, would you please consider the following suggestion
> for your solution: use special set of character styles, used for setting the
> fontfaces, bold/italics, etc. in formulas?
> 
> Those styles could have names on the lines of "*formula", "*formula
> (functions)", etc., and be initialised, e.g., from default char style. (Can
> you have "commonly hidden" style names in LO?)
> 
> Now, those styles would be used on new formula creation, if present. Their
> use could be switched off for individual formulas (like with checkbox "use
> formula look styles" in formula properties). AND their use should be
> switchable off for the document as a whole, too.
> 
> P.S. If I had any hope of implementing it in reasonable timeframe, I'd have
> a try myself. Current functionality is a pain to work with. As it is, I can
> only try to envision the look-and-feel of how I'd wish this to work.

This is my first "Easy Hack" attempt. In fact LO is my first open source endeavour. I will try my best tho any leads from previous attempts might be handy. So, if you have worked on it previously, please guide me.
Comment 16 Yury 2015-11-10 07:19:54 UTC
(In reply to Aneesh Dandime from comment #15)
> This is my first "Easy Hack" attempt. In fact LO is my first open source
> endeavour. I will try my best tho any leads from previous attempts might be
> handy. So, if you have worked on it previously, please guide me.

I've only made some smallish hacks related to formula export/import. For a quality help you should turn to the developers list, and to irc channels, too, I imagine:

http://news.gmane.org/gmane.comp.documentfoundation.libreoffice.devel for
Comment 17 Robinson Tryon (qubit) 2015-12-14 05:03:43 UTC Comment hidden (obsolete)
Comment 18 Robinson Tryon (qubit) 2016-02-18 14:52:27 UTC Comment hidden (obsolete)
Comment 19 V Stuart Foote 2016-05-03 21:08:08 UTC
*** Bug 99644 has been marked as a duplicate of this bug. ***
Comment 20 jani 2016-06-01 08:10:31 UTC
setting NEEDING, this bug misses code pointer (Mandatory for easy hacks)
Comment 21 Xisco Faulí 2016-09-27 10:36:12 UTC Comment hidden (obsolete)
Comment 22 Buovjaga 2017-06-27 09:20:44 UTC
*** Bug 108665 has been marked as a duplicate of this bug. ***
Comment 23 Roman Kuznetsov 2018-09-27 14:21:07 UTC
there is an extension for formatting of all Math formulas in document 

https://extensions.libreoffice.org/extensions/formatting-of-all-math-formulas

I don't think that we need option for using paragraph settings in LibreOffice Math.

My opinion -> it's WONTFIX now

People, any another opinions?
Comment 24 Regina Henschel 2018-09-27 16:16:33 UTC
No such extension does not solve this request. If I needed a dialog to change font size, then I could use the font dialog of Math. This request is, to get an adapted font size directly without any additional user action.
Comment 25 Roman Kuznetsov 2018-09-27 16:24:24 UTC
(In reply to Regina Henschel from comment #24)
> No such extension does not solve this request. If I needed a dialog to
> change font size, then I could use the font dialog of Math. This request is,
> to get an adapted font size directly without any additional user action.

But why? You can insert all your formulas into document Writer and then you can format its all using extension (set up font and font size). Extension allow to format only selecting formulas in document.

And, IMHO, we should format formulas after format all text in document.

It was only my personal opinion of course.

Let's don't touch this enhancement, ok
Comment 26 Xisco Faulí 2019-03-08 03:38:10 UTC
A polite ping, still working on this bug?