Inserting overline
alexabelson
Is there a clever way to do this so that it's not offset? I would like to incorporate this into a procedure, but may end up doing it manually by drawing lines, if need be.
Thanks!
Displayhelptopic "Elaborate Annotations".
The help topic about this feature seems too simpe in Igor 7. You can get a detailed description in Igor 6.37 using displayhelptopic "Elaborate Text Info Variables Example" instead.
December 3, 2017 at 02:13 am - Permalink
December 4, 2017 at 09:17 am - Permalink
TextBox/N=overline "12"+U+0305+"3"
The result depends on the font. On my Macintosh, using Helvetica, the overline is in the correct place horizontally, but it seems designed for lower case combining letters.
If I change to Arial on Macintosh, I get something that looks a lot like the original picture; the overline is high enough, but misplaced horizontally.
This gets really close using only Igor's annotation escape codes:
\Z161\[02\[1\y+45\L0600\Y03
In this, the
\Z16
just makes the font bigger. Then there's a "1", then a code to save the current position into variable 0, then a "2", then a code to raise the drawing position to a place over the characters in the line, then a code to draw a 1-point line from the position saved in variable 0 to the current X position, a code to restore the drawing Y position, then a "3". Result is attached- it looks like with Helvetica font on a Macintosh the X position for the 3 isn't quite right...John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
December 4, 2017 at 10:34 am - Permalink
I've attached a procedure I wrote for an XRD customer a while ago that adds an "Add Crystal Annotation..." item to the Graph menu.
Perhaps that'll help.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
December 4, 2017 at 11:13 am - Permalink
Hi Jim,
This is great and exactly what I need. Thanks for sharing.
Thanks everyone who answered!
December 4, 2017 at 12:02 pm - Permalink
In reply to by alexabelson
It seems that the new
\$WMTEX$
option to use Tex in Igor could be useful here.
The \overline{} Tex command puts an horizontal bar above the character:
TextBox/C/N=text0/F=0/A=MC "\\$WMTEX$ \\overline{3} \\$/WMTEX$"
April 20, 2020 at 06:30 pm - Permalink
Yes, this is WAY easier than the Igor version! Unfortunately, the implementation of LaTeX in Igor seems very limited. For example, \dot{x} does not work, even though it does work in the online editor at https://latex.codecogs.com/eqneditor/editor.php, which is what I thought Igor uses.
In recent work, we've had to use awkward (and not very pretty) kluges with dots in graphics mode. Writing a procedure code as above also does not seem attractive.
Any comments as to why \dot{x} does not work in $WMTEX$ ?
April 17, 2022 at 10:56 pm - Permalink
While this does not answer your question, you know that you can just use unicode characters for this right? As the manual states, Igor uses only a subset of commands, which are most useful and otherwise would be tedious to realize. You can also write an email to the support with commands you need to create your annotations and the staff may consider adding it.
April 18, 2022 at 12:29 am - Permalink
Thanks. I am not too familiar with using special unicode characters. Do you know how this would work? (One would want to add the dot -- and occasionally a double-dot -- to a chosen letter, not just 'x'.)
And, yes, I know that Igor only implements a subset of LaTeX. I just thought it was a larger set than it seems to be. But adding various things over or under a letter (dots, tildes, bars, etc.) are just the kind of thing that I often need and for which Igor has been very klugey. It seems to me a fairly basic / standard category that should be better supported.
April 18, 2022 at 12:34 am - Permalink
I can only guess that any additional command needs to be specifically implemented by the Igor team, and they rather want to avoid recreating all this stuff which can be achieved differently in a simple way.
As for unicode support, this is easy: Just copy the character from a unicode table or website or use the character map from within Igor (Character => Character Map). If you happen to know the code for the character you want, you can also enter codes directly by choosing Character => Enter Character and then write the character code in hex. For example, for a dot over the small x the code is 0x1E8B. Copying the character from a document or website is usually easiest. For example, you can have a small file with all characters you usually use listed, so you can quickly copy them in. Here is a list of characters with a dot above:
https://unicode-table.com/en/search/?q=dot+above
Naturally, the font you use needs to support the character. You can, of course, always switch to a different font in-between just for these special characters.
April 18, 2022 at 12:59 am - Permalink
Thanks, chozo! I can't get this to work -- I have to say that WM's manual on how to use UTF-8 characters is confusing at best. I don't see how to get your code as a label on a graph. For example, I did put in (in the Label axis dialog)
but this gives an overdot that is to the left of the W, not on top as I want.
When I try \{0x1E8B} I just get the string '7819' (in smaller font, amusingly), so again not what is hoped for....
Regarding your speculations about why there are so few LaTeX commands implemented, I suppose that is a reasonable explanation. But I would have naively thought there is a way to leverage all that coding to the LaTeX program itself, so that all that would be needed is to make sure the proper package is included. Having to program each character seems a painful way to go.
Maybe WM folks can comment on all this?
April 18, 2022 at 10:03 am - Permalink
You can use a Unicode combining character to get a W with a dot above using this command:
Label bottom "W\\{U+0307}"
U+02D9 is Unicode "dot above", but that's not what you actually want.
Igor doesn't use the LaTeX package itself. All supported LaTeX commands use our own drawing code (some of which might have been adapted from the original LaTeX drawing code).
April 18, 2022 at 10:47 am - Permalink
Thanks, aclight. That will work for now (it's not beautiful for Wdot but is better for Fdot).
I guess this will count as a plea for \dot{x}, \ddot{x}, and \vec{x}. I notice you have \overline{x} and \tilde{x}, so these would be natural "cousins" of those symbols. Using slightly bigger dots (more like "small filled circles") and placing them slightly higher than the unicode would look much nicer.
April 18, 2022 at 11:22 am - Permalink
PS Accommodating italics (math mode) characters is also important. At least for me, this issue is arising in describing the rate of change of a variable. It looks like the unicode does not work with italics. (Or, I couldn't get it to work...)
April 18, 2022 at 11:27 am - Permalink
An alternative option on macOS could be to use LaTeXiT, create a PDF or PNG image for the label text, import the image to the experiment, and add the image as the label.
The best option would be when Igor Pro would have a flag or preference setting to indicate that a LaTeX string should be run through a local LaTeX compiler to create the text.
April 18, 2022 at 12:56 pm - Permalink
In reply to An alternative option on… by jjweimer
I wonder if using LaTeX Pictures would help:
https://www.wavemetrics.com/project/LaTeXPictures
April 20, 2022 at 03:16 pm - Permalink