% TERNLABEL label ternary phase diagram
%   TERNLABEL('ALABEL', 'BLABEL', 'CLABEL') labels a ternary phase diagram created using TERNPLOT
%   
%   H = TERNLABEL('ALABEL', 'BLABEL', 'CLABEL') returns handles to the text objects created.
%   with the labels provided.  TeX escape codes are accepted.
%
%   See also TERNPLOT

% Author: Carl Sandrock 20020827

% To Do

% Modifications

% Modifiers

function h = ternlabel(A, B, C, FontSize, FontWeight, varargin)


% FontWeight = 'normal'; ,'Interpreter','latex'
% FontWeight = 'bold';

[varargin, Interpreter] = extractpositional(varargin, 'Interpreter', 'tex');

r(1) = text(0.5, -0.07, A, 'horizontalalignment', 'center', 'FontSize', FontSize, 'FontWeight', FontWeight, 'Interpreter', Interpreter);
r(2) = text(1-0.47*sin(deg2rad(30))+0.07, 0.47, B, 'rotation', -60, 'horizontalalignment', 'center', 'FontSize', FontSize, 'FontWeight', FontWeight, 'Interpreter', Interpreter);
r(3) = text(0.47*sin(deg2rad(30))-0.07, 0.47, C, 'rotation', 60, 'horizontalalignment', 'center', 'FontSize', FontSize, 'FontWeight', FontWeight, 'Interpreter', Interpreter);



if nargout > 0
    h = r;
end;