Hi, I'm pretty new to ConTeXt, so please bear with me if the following has already been asked (I have not found any answer in the archives, though). My goal is to use an arbitrary text font together with the Euler math font. I am able to use a few combinations in ConTeXt, e.g. Palatino with Euler, without problems. But when I switch to XeConTeXt (to use my system's fonts), some Euler's math accents do not show up properly (\hat) or not at all (\acute, \grave, \bar, \breve, \dot, \ddot, \tilde, \check). I guess the problem is the different encoding (and possibly the use of virtual fonts), but I know that Euler works in XeTeX: is it possible to make it work in XeConTeXt? Below you find my sample code. Nicola %!TEX TS-program = XeConTeXt %!TEX encoding = UTF-8 Unicode \definetypeface[Charis][rm][Xserif][Charis SIL][default][encoding=uc] \definetypeface[Doulos][rm][Xserif][Doulos SIL][default][encoding=uc] \definetypeface[Gentium][rm][Xserif][Gentium][default][encoding=uc] \definetypeface[Charis][mm][math][euler][euler] % encoding??? \definetypeface[Doulos][mm][math][euler][euler] \definetypeface[Gentium][mm][math][euler][euler] \startbuffer Unicode text works fine here, but formulas do not: \startformula \breve x^n + \bar y^n = \hat z^n. \stopformula \stopbuffer \starttext \switchtobodyfont[Charis] \getbuffer \switchtobodyfont[Doulos] \getbuffer \switchtobodyfont[Gentium] \getbuffer \showmathcharacters \stoptext \end
On Sun, 18 Mar 2007, nicola wrote:
Hi, I'm pretty new to ConTeXt, so please bear with me if the following has already been asked (I have not found any answer in the archives, though).
My goal is to use an arbitrary text font together with the Euler math font. I am able to use a few combinations in ConTeXt, e.g. Palatino with Euler, without problems. But when I switch to XeConTeXt (to use my system's fonts), some Euler's math accents do not show up properly (\hat) or not at all (\acute, \grave, \bar, \breve, \dot, \ddot, \tilde, \check).
AFAIU, Euler does not have these accents. They are pulled from the text font. That is a bit tricky because different text encodings have accents at different locations. Right now, there is only suport for ec and texnansi. You can try to add support for uc encoding by telling ConTeXt about location of accents in uc encoding. Look at the code at the end of math-eul.tex Aditya
I guess the problem is the different encoding (and possibly the use of virtual fonts), but I know that Euler works in XeTeX: is it possible to make it work in XeConTeXt? Below you find my sample code.
Nicola
%!TEX TS-program = XeConTeXt %!TEX encoding = UTF-8 Unicode
\definetypeface[Charis][rm][Xserif][Charis SIL][default][encoding=uc] \definetypeface[Doulos][rm][Xserif][Doulos SIL][default][encoding=uc] \definetypeface[Gentium][rm][Xserif][Gentium][default][encoding=uc]
\definetypeface[Charis][mm][math][euler][euler] % encoding??? \definetypeface[Doulos][mm][math][euler][euler] \definetypeface[Gentium][mm][math][euler][euler]
\startbuffer Unicode text works fine here, but formulas do not: \startformula \breve x^n + \bar y^n = \hat z^n. \stopformula \stopbuffer
\starttext \switchtobodyfont[Charis] \getbuffer \switchtobodyfont[Doulos] \getbuffer \switchtobodyfont[Gentium] \getbuffer \showmathcharacters \stoptext \end
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
-- Aditya Mahajan | EECS Systems, University of Michigan http://www.eecs.umich.edu/~adityam | Ph: 734.262.4008
In article
On Sun, 18 Mar 2007, nicola wrote:
My goal is to use an arbitrary text font together with the Euler math font. I am able to use a few combinations in ConTeXt, e.g. Palatino with Euler, without problems. But when I switch to XeConTeXt (to use my system's fonts), some Euler's math accents do not show up properly (\hat) or not at all (\acute, \grave, \bar, \breve, \dot, \ddot, \tilde, \check).
AFAIU, Euler does not have these accents. They are pulled from the text font. That is a bit tricky because different text encodings have accents at different locations. Right now, there is only suport for ec and texnansi. You can try to add support for uc encoding by telling ConTeXt about location of accents in uc encoding. Look at the code at the end of math-eul.tex
Ok, I see. Where is \definemathsymbol documented? The third argument is not very clear to me. Nicola
On Sun, 18 Mar 2007, nicola wrote:
In article
, Aditya Mahajan wrote: On Sun, 18 Mar 2007, nicola wrote:
My goal is to use an arbitrary text font together with the Euler math font. I am able to use a few combinations in ConTeXt, e.g. Palatino with Euler, without problems. But when I switch to XeConTeXt (to use my system's fonts), some Euler's math accents do not show up properly (\hat) or not at all (\acute, \grave, \bar, \breve, \dot, \ddot, \tilde, \check).
AFAIU, Euler does not have these accents. They are pulled from the text font. That is a bit tricky because different text encodings have accents at different locations. Right now, there is only suport for ec and texnansi. You can try to add support for uc encoding by telling ConTeXt about location of accents in uc encoding. Look at the code at the end of math-eul.tex
Ok, I see. Where is \definemathsymbol documented? The third argument is not very clear to me.
\definemathsymbol is defined in math-ini.tex. It has two versions, one with four arguments and one with six arguments. When using four arguments, #1 = name of symbol to be defined #2 = type of math atom (bin, rel, ord, punct, open, close, op, nothing) #3 = font family. Usually, mi = math italic mr = math roman sy = symbol The actual fonts are defined using \definebodyfont (e.g. see type-siz) #4 = hex code of the location of the symbol. In math-eul #3 = tf (text font), so the accent is pulled from the text font. This is usually ugly, but there is no other option since Euler is not a complete math font family. I am not sure when 6 argument version of definemathsymbol is used. Aditya
Hi. I'm been huffing and puffing the last few days trying to do my CV in ConTeXt. My previous version used the LaTeX Curve package and I was pretty happy with that. I'm learning alot by doing this myself but some things have been pretty hard. The hardest: trying to some kind of fancy section headers. I'm pretty sure I should have been able to do this with the available documentation but I've read and read and not been able to find a solution. Here's some of the things that my little brain can't comprehend: 1. I'm thoroughly confused about how fonts work. From various documents I found some that worked, for example: \definetypeface [zapf] [cg] [calligraphy] [chancery] \switchtotypeface [zapf] [12pt,cg] or \setupbodyfont[ber,pos] But I can't seem to find any place that lists the fonts I can use or how this actually works. Is there any standardized way, for example, to change font in headers or definitions of commands to affect only text in those definitions? 2. Fancy header with half of the text in background color (see headers in my former pdf at http://www.vitum.net/gjk/cv.pdf). I tried various things here. Using \framed, MetaFun and \setupbackground. For example: \setupbackground [leftoffset=0.3cm, rightoffset=0.3cm topoffset=-0.5cm, bottomoffset=0.3cm, background=color, backgroundcolor=red] I guess I'm misunderstanding the offset parameters. 3. Framed texts with titles: As explained in the MetaFun manual (Section 4.6, page 236) I tried using the code in that section... \FrameTitle{Zapf (1)} \StartFrame Coming back to the use of typefaces in electronic publishing: many of the new typographers receive their knowledge and information about the rules of typography from books, from computer magazines or the instruction manuals which they get with the purchase of a PC or software. \StopFrame \startuseMPgraphic{FunnyFrame} picture p ; numeric w, h, o ; p := textext.rt(\MPstring{FunnyFrame}) ; w := OverlayWidth ; h := OverlayHeight ; o := BodyFontSize ; p := p shifted (2o,h-ypart center p) ; draw p ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; draw (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner p,h) ; draw boundingbox p ; setbounds currentpicture to unitsquare xyscaled(w,h) ; \stopuseMPgraphic defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] defineframedtext[FunnyText][frame=off,background=FunnyFrame] \def\StartFrame{\startFunnyText} \def\StopFrame {\stopFunnyText } \def\FrameTitle#1% {\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut#1\hss}}} \setMPtext{FunnyFrame}{} % initialize the text variable ...and I have the following problems: - The framing of the text is limited to a too narrow textwidth. I can't seem to find where I change that in the code. - Icelandic letters don't seem to work in titles or the text in the frames. They do work in other places in the document, though. Phew, that's enough for now. If any of you guys/gals have other ideas on how to do nice looking headers I'm open to everything. Btw, I love using ConTeXt and really appreciate all your hard work. P.S. Is there any CV package for ConTeXt out there? If not I could post my work (if people like what I did) to the ConTeXt wiki for others to use. -- Best regards / Kær kveðja, Gudmundur J. Kristjansson / Guðmundur J. Kristjánsson gjk@vitum.net | gvendurjaki@gmail.com | USA Tel. +347-821-9855. Icelandic Tel. +354-893-4444.
On Mon, 19 Mar 2007 03:05:16 -0400
"Gudmundur J. Kristjansson"
Hi.
I'm been huffing and puffing the last few days trying to do my CV in ConTeXt. My previous version used the LaTeX Curve package and I was pretty happy with that.
I'm learning alot by doing this myself but some things have been pretty hard. The hardest: trying to some kind of fancy section headers. I'm pretty sure I should have been able to do this with the available documentation but I've read and read and not been able to find a solution.
Here's some of the things that my little brain can't comprehend:
1. I'm thoroughly confused about how fonts work. From various documents I found some that worked, for example:
\definetypeface [zapf] [cg] [calligraphy] [chancery] \switchtotypeface [zapf] [12pt,cg]
or
\setupbodyfont[ber,pos]
But I can't seem to find any place that lists the fonts I can use or how this actually works. Is there any standardized way, for example, to change font in headers or definitions of commands to affect only text in those definitions?
2. Fancy header with half of the text in background color (see headers in my former pdf at http://www.vitum.net/gjk/cv.pdf).
Hi Gudmundur, below is a very simple solution to your problem. \unprotect \def\cvsection#1#2% {\bgroup \setbox\scratchbox\hbox{#2}% \!!dimena\dimexpr\ht\scratchbox+\dp\scratchbox\relax \lower\dp\scratchbox\hbox\!!to\zeropoint {\startcolor[darkgray] \vrule\c!height.5\!!dimena\c!width\hsize\hss \stopcolor}% \midaligned{\box\scratchbox} \egroup} \protect \setupcolors[state=start] \setuphead [section] [command=\cvsection, textstyle=\ss\bf] \starttext \section{Work experience} \stoptext Wolfgang
I tried various things here. Using \framed, MetaFun and \setupbackground. For example:
\setupbackground [leftoffset=0.3cm, rightoffset=0.3cm topoffset=-0.5cm, bottomoffset=0.3cm, background=color, backgroundcolor=red]
I guess I'm misunderstanding the offset parameters.
3. Framed texts with titles:
As explained in the MetaFun manual (Section 4.6, page 236) I tried using the code in that section...
\FrameTitle{Zapf (1)} \StartFrame Coming back to the use of typefaces in electronic publishing: many of the new typographers receive their knowledge and information about the rules of typography from books, from computer magazines or the instruction manuals which they get with the purchase of a PC or software. \StopFrame
\startuseMPgraphic{FunnyFrame} picture p ; numeric w, h, o ; p := textext.rt(\MPstring{FunnyFrame}) ; w := OverlayWidth ; h := OverlayHeight ; o := BodyFontSize ; p := p shifted (2o,h-ypart center p) ; draw p ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; draw (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner p,h) ; draw boundingbox p ; setbounds currentpicture to unitsquare xyscaled(w,h) ; \stopuseMPgraphic
defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] defineframedtext[FunnyText][frame=off,background=FunnyFrame] \def\StartFrame{\startFunnyText} \def\StopFrame {\stopFunnyText } \def\FrameTitle#1% {\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut#1\hss}}} \setMPtext{FunnyFrame}{} % initialize the text variable
...and I have the following problems: - The framing of the text is limited to a too narrow textwidth. I can't seem to find where I change that in the code. - Icelandic letters don't seem to work in titles or the text in the frames. They do work in other places in the document, though.
Phew, that's enough for now. If any of you guys/gals have other ideas on how to do nice looking headers I'm open to everything.
Btw, I love using ConTeXt and really appreciate all your hard work.
P.S. Is there any CV package for ConTeXt out there? If not I could post my work (if people like what I did) to the ConTeXt wiki for others to use.
-- Best regards / Kær kveðja, Gudmundur J. Kristjansson / Guðmundur J. Kristjánsson gjk@vitum.net | gvendurjaki@gmail.com | USA Tel. +347-821-9855. Icelandic Tel. +354-893-4444.
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
participants (4)
-
Aditya Mahajan
-
Gudmundur J. Kristjansson
-
nicola
-
Wolfgang Schuster