acer

33400 Reputation

29 Badges

20 years, 332 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

In my Maple 2019 (and at least back to Maple 2016) I can use Shift-F5 to get into the mode where input is in 2D Math that does not execute.

And I can toggle between these input modes.

Shift-F5   (non-executable 2D Math, or toggle)

Ctl-r   (executable 2D Math)

Ctl-t    (plain text)

 

Is E supposed to denote the ellipsoid from your earlier question?

Please don't ask the same question more than once.

Put your followup details here, instead of in a new thread.

I just want to make sure that I get it straight what your issue is.

Is the following summary correct? In your Maple 2019,
 - You switch between text and inactive inline 2D Math and back again using Ctl-F5 and Ctl-t, and that part works fine.
 - When you copy and paste such a block of text (that contains inactive inline 2D Math) then all of the inline 2D Math becomes active and executes when you do hit the !!! icon, etc. And that, of course, would not be fine.

If that second bullet point is the essence of your problem then, sorry, I don't of a setting that will make Copy&Paste directly respect the "activeness" of the 2D Math blocks inlined in text paragraphs.

@mmcdara I agree that it is difficult because there is little to no documentation of the so-called TypeMK used for rendering 2D Math.

It is somewhat similar to what gets constructed by calls to Typesetting:-Typeset, the major difference being that it is a specially marked up single name rather than a nested function call. For example,

foo := Typesetting:-Typeset(sqrt(x)^K);

Typesetting:-msup(Typesetting:-mfenced(Typesetting:-msqrt(Typesetting:-mi("x"))), Typesetting:-mi("K"))

lprint(foo);

Typesetting:-msup(Typesetting:-mfenced(Typesetting:-msqrt(Typesetting:-mi("x"))
),Typesetting:-mi("K"))

bar := `#msup(mfenced(msqrt(mi("x"))),mi("K"))`;

`#msup(mfenced(msqrt(mi("x"))),mi("K"))`

lprint(bar);  # just a name, with special markups/prefix/suffix

`#msup(mfenced(msqrt(mi("x"))),mi("K"))`

Download TypeMK_ex.mw

As for HTML and unicode entities within typeset stuff, here is an example. Note that the unicode representation can be in the decimal or hex format, where the distinction is accompanied by the extra x symbol. I usually do a web search when I forget an entity name. (Eg, this)

restart;

kernelopts(version);

`Maple 2019.0, X86 64 LINUX, Mar 9 2019, Build ID 1384062`

`←`;

`←`

`←`;

`←`

`#mo("←")`;

`#mo("←")`

convert(8592,hex);

`2190`

`#mo("←")`;

`#mo("←")`

nprintf(`#mo("&#x%a;")`, 2190);

`#mo("←")`

nprintf(`#mo("&#x%s;")`, convert(8592,hex));

`#mo("←")`

convert(`2190`, decimal, hex);

8592

nprintf(`#mo("&#%a;")`, convert(`2190`, decimal, hex));

`#mo("←")`

Download entity_unicode_typeset.mw

 

@mmcdara I may well not understand properly what kind of characters you want, and where, but perhaps this will give you some ideas. 

I wasn't sure if you wanted to replace the symbol "ID" used at a vertex, or place something at that level, etc.

Note that plots:-textplot allows the supposed text to be supplied as typeset(some_seq) where some_seq can be an expression sequence containing "\n" entries. And you can use entities in the other entries of such a sequence to be typeset.

NAC_ac.mw

@mmcdara I'm curious about your need that made you turn to image drawing facilities to modify/construct your rendered graphs (in the Graph theory sense).

The results from DrawGraph look much better than they used to. But I'd agree that there is room for improvement.

One way to get typeset Greek letters or other entities on the vertices of a drawn Graph is by using normal alphabetic characters in the Graph passed to DrawGraph and then substitution into the resulting PLOT structure. Eg, using a variety of ways (HTML entities, straight Greel letter name, unicode),

restart;

plots:-setoptions(gridlines=false):

with(GraphTheory):

P := DrawGraph(Graph(directed,{["a","b"],["cc","b"],
                               ["cc","a"],["cc","d"]})):

subs(["a"=Psi,
      "b"=`Ψ`,
      "cc"=`#mrow(mo("Ψ"),mo("↑"))`,
      "d"=`#mo(↑)`],
     P);

 

Download graph_entity1.mw

Or did your goal also include a customized look for the arrows designating a directed Graph, eg. something like this where the edge is depicted with a stretched arrow entity?

I understand, if you've already got a working mechanism for doing any or all of that via drawing and images. I was just curious about the main obstacles you faced.

@mmcdara I do not always mention it when I submit a bug report against an issue I find while investigating a Question in this forum.

I mentioned here to convey also that I considered this example a weakness in simplify, since the Question and my Answer were more about how to apply commands to each entry of the Matrix. (The OP seemed to have already found an adequate command, but wanted to apply it throughout, I believe.)

I considered the example something that simplify might reasonably be expected to handle itself (ie. the trig arguments are not large integers, and expand doesn't blow the individual trig calls up to huge expressions.)

Bug reports generally help.

The simplify command is being improved in at least some ways. Consider this basic example, which produces zero in Maple 2019,

restart;
ff := cosh(z) + sinh(z):
simplify( exp(z) - ff );
                          0

@michalkvasnicka On what grounds do you make this strong claim?

Could you give your example?

Additional details that might be relevant include: Maple version, Operating system, Maple language pack (if any).

In case anyone's interested, I'm submitting a bug report about this weakness in simplify ,

restart;

ee := cos(omega*t + alpha)/2
      - cos(omega*t + alpha + Pi/3)/2
      - sin(omega*t + alpha + Pi/6)/2:

expand(ee);
                               0

lprint( simplify(ee) );
  1/2*cos(omega*t+alpha)-1/2*cos(omega*t+alpha+1/3*Pi)-1/2*sin(omega*t+alpha+1/6*Pi)

lprint( simplify(ee, trig) );
  1/2*cos(omega*t+alpha)-1/2*cos(omega*t+alpha+1/3*Pi)-1/2*sin(omega*t+alpha+1/6*Pi)

@nm The scenario you describe -- with nested calls to commands without proper regard for what they might return and a reasonable chance of a mistaken call -- sounds to me like inadequate type checking, parameter checking, and quality of programming on the user's part.

@tomleslie I agree with you, Tom.

This member's habit of posting only images is very rude and unhelpful behavior.

Why are you using squiggly brackets {...} ? Those are for creating sets.

Your code attempts to add/subtract sets, which does not make sense.

Use round brackets as delimiters.

@mmcdara It's not difficult to roll your own code that constructs the XML for the running sequence of GUI Tables to embed.

The following was done in Maple 2015.2.

It would be nice is DocumentTools:-Tabulate offered an option to treat mxn or mxnx3 float[8] Arrays as images. Then you could use the Tab2 approach directly. I'll submit a Software Change Request.

restart;

F := proc()
  local blankblock,i, im, p, S, xml;
  uses DocumentTools, DocumentTools:-Layout;

  for i from 1 to 4 do

    # delay for demo purpose only
    if i<>1 then Threads:-Sleep(1.5); end if;

    # p is some plot, and im is some image
    # This is just a toy example, p and im don't have
    # any special meaning.
    #
    S := Statistics:-Sample(Uniform(0,1),[1..50,1..3,1..3]);
    p := plots:-pointplot(S[..,1..2,1], size=[300,300],
                          symbolsize=15, symbol=solidcircle);
    im := Array(S,datatype=float[8]);

    xml[i] := Table(Column(weight=40),Column(weight=20),
                    Column(weight=40),
                    interior=none,alignment=center,
                    widthmode=pixels,width=500,
                    Row(align=center,
                        Cell(InlinePlot(p)),
                        Cell(sprintf("Iteration %a of 4",i)),
                        Cell(Image(im,height=270,width=270))));

    blankblock := DocumentBlock(Group(Input(Textfield("\n"))));
    InsertContent(Worksheet(seq(op([xml[j],
                                    blankblock]),j=1..i)));

  end do;

  return NULL;

end proc:

 

F();

 

Download Tab3.mw

First 239 240 241 242 243 244 245 Last Page 241 of 612