bugGNU Octave - Bugs: bug #52287, degree sign (\circ) not as...

 
 

bug #52287: degree sign (\circ) not as superscript

Submitted by:  Muhali <muhali>
Submitted on:  Thu 26 Oct 2017 11:47:29 AM UTC  
 
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 4.2.1Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Tue 31 Oct 2017 10:14:14 PM UTC, comment #14:

See Mike Miller's comment #3. It appears that U+00BA is a typo.

Rik <rik5>
Project Administrator
Tue 31 Oct 2017 09:32:43 PM UTC, comment #13:

The following was posted to the mailing list:

R> There is a list, from Matlab, of what each Tex symbol should create. See
R> http://www.mathworks.com/help/matlab/ref/text.html#inputarg_Interpreter.

That page claims that matlab maps \circ to U+00BA MASCULINE ORDINAL INDICATOR.

Which of course may just mean that whoever wrote it doesn't know how to type ?.

-JimC

John W. Eaton <jwe>
Project Administrator
Sun 29 Oct 2017 01:08:24 AM UTC, comment #12:

I made the change to the documentation (http://hg.savannah.gnu.org/hgweb/octave/rev/5e3d45f108d9). I also grafted the change back on to the stable branch, although I'm not sure there will be a 4.2.2 release.

Rik <rik5>
Project Administrator
Sun 29 Oct 2017 12:08:00 AM UTC, comment #11:

Rik: Seems to do the job, and close the report.

Michael Godfrey <godfrey>
Project Member
Sat 28 Oct 2017 07:19:38 PM UTC, comment #10:

I've made a small patch for the documentation that explains the difference between \circ and \deg. Is this a good enough way out of this bug report?

(file #42285)

Rik <rik5>
Project Administrator
Fri 27 Oct 2017 11:28:06 AM UTC, comment #9:

Ok, so I understand now and this looks like a sensible choice from Octave's part.

>> So we could mention the syntax 'x^\circ' as a Matlab compatible and TeX compatible way of rendering something that looks like a degree sign.


I would add that the only way to obtain a consistent degree symbol on screen and on printout is to use "\\deg": since the Symbol font only has the degree symbol, we have mapped "\\circ" to the same glyph as "\\deg" and consequently in printout the "^\\circ" will appear as if it was "^\\deg", that is much too hight above the baseline. See

Note also that it also means that we currently have no way to reprent the actual non superscripted "\\circ" in printout.

Pantxo Diribarne <pantxo>
Project Member
Thu 26 Oct 2017 08:26:23 PM UTC, comment #8:

This might be useful:

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 26 Oct 2017 08:21:59 PM UTC, comment #7:

It's not clear to me that it is different. I think it might be worth asking someone for clarity, with a very large font. But I've seen some posts suggesting that the proper way to get something that looks like a degree sign in Matlab is with the superscript operator, which agrees with the TeX site.

So we could mention the syntax 'x^\circ' as a Matlab compatible and TeX compatible way of rendering something that looks like a degree sign.

Mike Miller <mtmiller>
Project Administrator
Thu 26 Oct 2017 08:06:01 PM UTC, comment #6:

This is all starting to come back to me, slowly. I think we decided to implement \circ according to TeX, and then have \deg to access the degree symbol.

There is table 15.1 in the manual that documents what output one should expect for each TeX input.

Beyond that, do we want to have a special mention in the documentation about the different interpretation of \circ? Maybe we should put an asterisk and a footnote.

Rik <rik5>
Project Administrator
Thu 26 Oct 2017 07:04:09 PM UTC, comment #5:

Rik is right as far as I know having done this work a
long time ago. I used TeX definitions. It seems to me
that this is simplest and best. Matlab makes some other choices.

Michael Godfrey <godfrey>
Project Member
Thu 26 Oct 2017 06:45:15 PM UTC, comment #4:

I see some answers on Matlab Central recommending using "^\circ" or "^{\circ}" for a proper degree symbol.

Mike Miller <mtmiller>
Project Administrator
Thu 26 Oct 2017 06:41:56 PM UTC, comment #3:

Weirdly, it looks to me like the Matlab table of TeX characters is showing º (U+00BA MASCULINE ORDINAL INDICATOR) for \circ. But I guess they intended that to be ° (U+00B0 DEGREE SIGN)?

By the way, on https://www.johndcook.com/blog/math_symbols/ it's easy to miss but it looks like he is saying that "^\circ" is mapped to °, notice the superscript carat for that one case.

Running "\circ" through plain tex, I get a non-superscripted ∘ (U+2218 RING OPERATOR).

Mike Miller <mtmiller>
Project Administrator
Thu 26 Oct 2017 03:49:04 PM UTC, comment #2:

There is a list, from Matlab, of what each Tex symbol should create. See http://www.mathworks.com/help/matlab/ref/text.html#inputarg_Interpreter. If you can tell that \circ is mapping to unicode 0x2218 from this table then we maybe could make the change for compatibility.

I think there was discussion a long time back about wanting to stay true to TeX, and I believe that TeX maps circ to 0x00BO. This is certainly what this website says: https://www.johndcook.com/blog/math_symbols/

Also, see comment #3 at https://savannah.gnu.org/bugs/?func=detailitem&item_id=33155.

There is an argument for why '\circ' should produce the circle, rather than degree, symbol.

Rik <rik5>
Project Administrator
Thu 26 Oct 2017 12:22:55 PM UTC, comment #1:

In octave we have the additional '\deg' tex symbol (not matlab compatible) that is mapped to the superscript "°" symbol (unicode 0x00B0). For some reason the '\circ' has been mapped to unicode 0x2218 which is a non superscript version.

The attached patch maps both '\deg' and '\circ' to the same unicode character. Those tex symbols are already mapped to the same character in Windows symbol codes system and in Symbol font.

The workaround to display degree onscreen is to use thus '\deg'.

(file #42268)

Pantxo Diribarne <pantxo>
Project Member
Thu 26 Oct 2017 11:47:29 AM UTC, original submission:

The command

text(0.5, 0.5, '{\circ}')

does not seem to create a superscript in the plot window (see attached foo.png). It does so in the corresponding print.

Muhali <muhali>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #42285:  degree.cset added by rik5 (1KiB - application/octet-stream)
file #42268:  circ.patch added by pantxo (867B - text/x-patch)
file #42267:  foo.png added by muhali (18KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by dasergatskov (Posted a comment)
  • -unavailable- added by godfrey (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by pantxo (Updated the item)
  • -unavailable- added by muhali (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 29 Oct 2017 01:08:24 AM UTCrik5StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Sat 28 Oct 2017 07:19:38 PM UTCrik5Attached File-=>Added degree.cset, #42285
      StatusConfirmed=>Patch Submitted
    Thu 26 Oct 2017 12:22:55 PM UTCpantxoAttached File-=>Added circ.patch, #42268
      StatusNone=>Confirmed
    Thu 26 Oct 2017 11:47:29 AM UTCmuhaliAttached File-=>Added foo.png, #42267

    Back to the top


    Powered by Savane 3.1-cleanup1