Menu

#31 Text attributes in iFormula

Future_release
open
None
3
2015-04-10
2015-04-07
No

iMath can recognize text attributes for print, but treats them as variables in calculations (or Vice versa).

There are three variables in the example, which I want to find: f_1, f_2 and f_3. And I would like to highlight, that I use the value of y_1 for all of them instead of y_2 and y_3. I tried with the "bold" attribute.

The behaviour depends on how I use it: "bold y_1" or "bold {y_1}".

1 Attachments

Discussion

  • Jan Rheinlaender

    I think this is not really a bug. It just works different than you expect.

    1. iMath treats attributes as part of the variable name. Therefore, "bold y_1" and "y_1" are two different variables. If you have installed the latest beta version, open form the menu "iMath" - "Variable list" and you will see both variables (iMath automatically adds the {} brackets around the variable name to avoid problems with variable names that contain spaces)
    2. The syntax "bold {...}" is not parsed. The "bold" is just skipped. The reason is that there is no good way to handle e.g. bold{y_1 + x_1} and the brackets are unnecessary for the simple case "bold {y_1}"
     
  • zeon_account_will_be_deleted

    So, if I've printed once "bold y_1" to highlight this variable, I should then create "bold y_1 = <something>", right? Ok</something>

    Should we close the ticket or maybe move it to feature request?

     
    • Jan Rheinlaender

      Yes thats right. Just think of your variable being called "bold y_1", not "y_1".

      What feature would you want to request?

       
  • zeon_account_will_be_deleted

    bold y_1 = y_1

     
    • Jan Rheinlaender

      But how should iMath decide when to print y_1 in bold font, e.g. in a generated formula?

      EQDEF bold y = a + b
      VAL(y)

      Result will be y=a+b but should y be bold or not?

       
      • zeon_account_will_be_deleted

        Good question. I've posted my view of it in the ticket #30.

        In the case of equations/expressions with automatic formatting, including that ones, that are generated by GiNaC during recalculations, like VAL(), it's logically to keep attributes only if the variable/expression/number is kept unchanged. If the variable transforms to a numerical value, attributes should be dropped.

        Another example: when we first print "y = bold{a + c} + b", there is no sence to keep "bold' attribute of cource, because varibles will be rearranged:
        VAL(y) -> y = a + b + c

        Actually I just would like to see "bold y" only once in the first equation without automating formatting, when I need to pay attention to it.

         
  • zeon_account_will_be_deleted

    We should distinguish formatting attributes:
    bold, ital, font..., size..., color...
    and attributes, that have exact mathematical sense:
    vec, dot, bar, func.

    E.g. "vec x" and "x" are different mathematical elements and they should be parsed as you said before:
    iMath treats attributes as part of the variable name.

     
    • Jan Rheinlaender

      But I have seen many publications where vectors are always printed in bold type! I think that was the original reason why I made bold etc. a part of the variable name.

      I can't see a good way to enable both behaviours:

      1. Remember that a variable should always be printed in bold type (or always in red colour)
      2. Equate "bold y" and "y"

      Maybe there could be a an option for this? Something like "remembervariableformatting=false" to equate "bolc y" and "y".

       
      • zeon_account_will_be_deleted

        Like this one? Vector is not only bold, but also regular (non-italic). Maybe there is some special attribute in Math? If not, let's make an exception for "bold".

        Feel difference between "func" attribute and a quoted string.

         
        • Jan Rheinlaender

          I just saw there is a non-italic attribute. So vectors should perhaps be

          "bold nitalic v"

          and they look different than "bold func v".

          I'm not so happy about the exception. I would prefer the remembervariableformatting option.

           
          • zeon_account_will_be_deleted

            They may look different because your settings for functions and text in the Math formula may be different.

            Maybe you're right, it's better to add this option. But how it should handle mix of vectors and highlighted text in one document or even one formula? And such name "remembervariableformatting" is very long, imho.

             

            Last edit: zeon_account_will_be_deleted 2015-04-11
            • Jan Rheinlaender

              About mix of vectors and formatting: Isn't the current behaviour enough where bold{x} is pure formatting (with autoformat=false) and bold x is a variable called "bold x" ?

               
              • zeon_account_will_be_deleted

                Maybe. But if iFormula contains a statement like "SUBST", automatic formatting turns on automatically.

                You've left it for a future release. Let's think about it later.

                 
  • Jan Rheinlaender

    Ticket moved from /p/ooo-imath/bugs/12/

     
  • Jan Rheinlaender

    • assigned_to: Jan Rheinlaender
    • Group: Version_2.0.0 --> Future_release
    • Priority: 1 --> 3
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB