Multiple lines in tab labels

I have a tab control with long labels for the tabs, and I'd like to have the labels split over two lines to save space.  However, while I can use carriage returns or newlines in the commands to make the tab, I will get an error when I try to recreate the experiment, since the \r is being interpreted literally and puts carriage return in the command used to recreate the panel.

Window Panel_One_Backslash() : Panel		//Runs fine, but the created panel will cause errors the next time you open Igor
	PauseUpdate; Silent 1		// building window...
	NewPanel /W=(150,269,623,536)
	TabControl tab0,pos={29.00,21.00},size={424.00,227.00}
	TabControl tab0,tabLabel(0)="Dataset\rheader"
	TabControl tab0,tabLabel(1)="§1 Overview\rquality"
	TabControl tab0,value=0
EndMacro

//Macro when you do Ctrl+Y on the panel.  Note the broken lines for the tab labels.
Window Panel_One_Backslash_Recreation_Macro() : Panel
	PauseUpdate; Silent 1		// building window...
	NewPanel /W=(150,570,623,837)
	TabControl tab0,pos={29.00,21.00},size={424.00,227.00}
	TabControl tab0,tabLabel(0)="Dataset
header",tabLabel(1)="§1 Overview
quality"
	TabControl tab0,value=0
EndMacro

If I use \\r, the label only has one line, but will have 

I was able to hack it by using Igor Tex, but it took a little fiddling to make it look halfway decent.

Window Panel_Igor_Tex() : Panel
	PauseUpdate; Silent 1		// building window...
	NewPanel /W=(150,269,623,536)
	TabControl tab0,pos={29.00,21.00},size={424.00,227.00}
	TabControl tab0,tabLabel(0)="\JC\Z18\$WMTEX$^{\,\Dataset\,}_{\,\header\,}\$/WMTEX$"
	TabControl tab0,tabLabel(1)="\JC\Z18\$WMTEX$^{\,§1\,\Overview\,&\,}_{\,\,\quality\,}\$/WMTEX$"
	TabControl tab0,value=0
EndMacro

Is there another way to accomplish this?  You can have carriage returns in the titles of other controls, like checkboxs, so it would be nice if you can also have carriage returns in the labels for tabs.

Tab labels using Igor Tex and a simple carriage return. (12.09 KB)
Ben Murphy-Baum

This took a bit longer to dial in than I expected, but the fix is in for the next nightly build, which you'll be able to download tomorrow morning. Thanks for the report!

KZarzana

Thanks for the fix for this.  The code needs to work with IP8 and IP9, so I'll leave the Igor Tex for now.  One other question: Do you know if there is a way with Igor Tex to make the text bold?  I tried the usual LaTeX commands, but they didn't seem to work.

jjweimer

I would be surprised if the basic WMTEX includes any capacity to manage font style. You could make the annotation text as a picture and use \$PICT$name=pictName$/PICT$ as the label.

Be aware that getting text to fit into tab controls can be fraught with issues on macOS with IP 9 (and possibly IP 8). See the image for IP9 on macOS 15.8 

Also, the DefaultGUIFont command may be helpful.

Window Panel_One_Backslashc() : Panel
	PauseUpdate; Silent 1		// building window...
	NewPanel /W=(150,269,618,431)
	DefaultGuiFont/W=# all={"_IgorLarge",18,1}
	TabControl tab0,pos={29,21},size={424,100}
	// chickens picture in Misc->Pictures
	TabControl tab0,tabLabel(0)="\$PICT$name=chickens$/PICT$",value=1
	TabControl tab0,tabLabel(1)="something",value=0
	TabControl tab0,tabLabel(2)="\$WMTEX$^{\,\Dataset\,}_{\,\header\,}\$/WMTEX$"
EndMacro
image of panel made by commands (32.49 KB)
JimProuty

I would be surprised if the basic WMTEX includes any capacity to manage font style. You could make the annotation text as a picture and use \$PICT$name=pictName$/PICT$ as the label.

From the DisplayHelpTopic "Fonts Used with Igor TeX" help:


The default Greek and math symbol fonts were chosen based on appearance and support for special characters such as square bracket extensions (used when building a tall square bracket).


You can override these defaults within a given annotation by storing a font name in text info variable 8 for Greek characters and text info variable 9 for math symbols. See Text Info Variables. You can experiment with different fonts using the Igor TeX Demo experiment.


Although you can use a Greek character such as α (alpha) directly, in order to use the specific font chosen for Greek character display, you should still use the \alpha syntax of TeX.


The fonts used in a formula affect not only the visual appearance of characters but also the font embedding situation when exporting to the graphics formats Igor PDF and EPSF. See Font Embedding (Windows). When exporting Igor PDF and EPSF with font embedding for standard fonts turned off, you should examine the output carefuly and use full font embedding if problems are found.
 

KZarzana

I played around a bit in the Igor Tex experiment, and while I can change the fonts, the only change I can make to the style is to make letters italic or not.  The \rm command works for that, and oddly enough, simply prefacing a word with \ makes just that word not italic, e.g. \$WMTEX$ \test \$/WMTEX$.  None of the other LaTeX commands for bold (\bf, \mathbf, \boldmath, \textbf) had an impact, nor did a \f01 tag before or inside the $WMTEX tag.  I ended up "solving" this by using different text from what was in the standards document so the tab labels are shorter and fit on one line.