[XeTeX] Using --, ---, , '' and ' with CM

J. P. Blevins jpb39 at cam.ac.uk
Wed Jul 21 19:44:13 CEST 2004

FWIW, I had the same problem with these ligatures. I started with a
document that I had been processing with LaTeX, and introduced OpenType
text fonts via:

...

\renewcommand*{\encodingdefault}{U}

(Oddly, these declarations only work consistently in the preamble; when
they are loaded via a style file the entire document sometimes defaults to
CM Roman).

When these fonts are loaded, the CM math fonts are unaffected. But the text
font declarations seem to disable text dashes, quotes, accents (which place
umlauts far above vowels), etc.

A simple solution for dashes is to assign a unicode glyph to the verbose
command names, like:

\def\textemdash{—}

Using the ifthen package, once can introduce a block of these
redefinitions, along with the various accent redefinitions posted by
Steffen Prohaska, and have them evaluated only when:

\newcommand{\opentype}{true}

The quotation marks all have command names too, and can accommodated in the
same way, but the resulting portability comes at the cost of making the
source text much more verbose and command-laden.

-Jim

\DeclareUnicodeCharacter, which could also be useful for XeTeX
conditionalization, but I have not managed to get this to work in XeTeX
yet.

On Jul 21 2004, Jonathan Kew wrote:

> On 20 Jul 2004, at 11:37 pm, Atip Asvanund wrote:
>
> > There are times when I would like to use Computer Modern along with OTF
> > fonts. Since, the preferred method for entering these punctuations is
> > via
> > Unicode, they only work with the fonts that XeTeX loads in. However, I
> > cannot get those punctuations to show up in Computer Modern at all,
> > whether I enter them them using unicode or with the --, ---, , ''
> > and '.
>
> I don't understand why this would be a problem; the CM fonts should
> work just like in any standard TeX. Are any warning messages shown in
> the console window when you run XeTeX? Do the CM fonts work fine for
> the rest of the text? How are you specifying the fonts in your
> document?
>
> It should work to do something like this, for example (in Plain TeX):
>
> 	\font\cm=cmr10 \cm
> 	This is Computer Modern Roman''---using TeX legacy conventions.
>
> 	\font\lg="Lucida Grande" at 10pt \lg
> 	This is “Lucida Grande”—using Unicode characters directly.
>
> 	\bye
>
> Both fonts appear fine when I run this. What happens for you?
>
> Jonathan
>
> _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex
>
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9367762804031372, "perplexity": 7765.718173075452}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-14/segments/1427131298660.78/warc/CC-MAIN-20150323172138-00244-ip-10-168-14-71.ec2.internal.warc.gz"}