On Saturday, 11 July 2015 at 06:13:13 am +0200, Jakub Jelinek wrote:
> On Fri, Jul 10, 2015 at 10:29:55PM -0400, Henry So Jr. wrote:
> > The last remaining item on the 4.0 milestone list is #383, TeX macro
> > naming conventions. Is now a good time to release the beta?
>
> I've yesterday noticed a problem with \Vbar, \Rbar and \Abar when used
> in \textit{} contexts looks ugly (the bar character does not have an italic
> version). Is it possible to find out from inside of these macros whether
> it is used in italic context and use more slanted version of the bar
> and/or have separate adjustments for non-italic and italic?
As far as I can tell (given I'm not as TeX-savvy as the other
developers), this is possible in LaTeX by checking "\f@shape" for the
value "it". However, this is very much a LaTeX-ism. In Plain TeX, I
think the "\it" macro simply invokes a font and there's no way to know,
without redefining the "\it" macro to set some sort of flag somewhere
whether you are in that context.
However, this does indicate that the body of the *bar macros should
probably be broken out so that it's possible for someone to create a
more fancy *bar macro that does this sort of detection.
To attempt to explain what I mean by the previous paragraph better, the
current way these macros are defined is thus:
%% Intermediate version or barred glyph definition
%% #1: the csname you want to define
%% #2: the letter you'll typeset (you can use bold, italic, etc.)
%% #3: the symbol corresponding to the glyph in greextra. Must be defined
with \gredefsizedsymbol
%% #4: the size of greextra
%% #5: the kern of the bar from the beggining of the glyph
%% #6: greextra glyph lowering
\def\gredefbarredsymbol#1#2#3#4#5#6{%
\expandafter\gdef\csname #1\endcsname {%
\leavevmode\hbox to 0pt{}\kern #5\lower#6\hbox{\csname
#3\endcsname{#4}}\kern -#5\relax #2%
}%
}
I think we need something like (untested):
\def\grebarredsymbol#1#2#3#4#5{%
\leavevmode\hbox to 0pt{}\kern #4\lower#5%
\hbox{\csname #2\endcsname{#3}}\kern -#4\relax #1%
}%
\def\gredefbarredsymbol#1#2#3#4#5#6{%
\expandafter\gdef\csname #1\endcsname {%
\grebarredsymbol{#2}{#3}{#4}{#5}{#6}%
}%
}%
This way, in LaTeX, someone could define:
\makeatletter%
\def\my@italicvalue{it}%
\def\Abar{%
\ifx\f@size\my@italicvalue %
\grebarredsymbol....%
\else
\grebarredsymbol....%
\fi
}%
\makeatother%
Or perhaps we can even make LaTeX-specific macros in the sty file,
though at face value, this would appear to require at least 10
arguments.
Henry
_______________________________________________
Gregorio-devel mailing list
[email protected]
https://mail.gna.org/listinfo/gregorio-devel