help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I get an angstrom symbol in Octave?


From: Brett Green
Subject: Re: How can I get an angstrom symbol in Octave?
Date: Sun, 22 Sep 2019 12:36:15 -0400

Ah, I see - that will be helpful for simplifying my code in the future. So far, I'd just been using \\ when I wanted the character \ in a string. I tried this:

__mfile_encoding__ ("iso-8859-1");
clear functions
title('\AA',"interpreter","tex")

and had the same result as before. Doug was able to find a solution in another thread, though. Thank you!

- Brett Green


On Sun, Sep 22, 2019 at 5:57 AM "Markus Mützel" <address@hidden> wrote:
On Sat, 21 Sep 2019 22:06:59 Brett Green wrote:
> Using single quotes (without $) was all I needed to change to get the
> degree symbol to appear. Thank you!
>
> Now I'm wondering why using single vs. double quotes makes a difference...
> what's important, though, is that it works.
>
Single quoted strings take the string passed "as is". Double quoted strings
process backslash sequences. E.g. "\n" is a line feed, but '\n' is the two
characters '\' and 'n'.

> ...Actually, I may have written that prematurely. Although I can get the
> degree symbol, I still can't get the angstrom symbol. \AA and \r{A} were
> suggested but neither worked. Any ideas why not?
>
Octave 5.1 sometimes has issues "remembering" the character encoding. It
should be working if you specify the character encoding for .m files
explicitly. E.g.:
__mfile_encoding__ ("iso-8859-1");
clear functions

This has already been fixed for the next major release Octave 6.

Markus

reply via email to

[Prev in Thread] Current Thread [Next in Thread]