On 2015-07-08, Richard Opheim wrote:

> [-- Type: text/plain, Encoding:  --]

> I wanted to continue this topic, but somehow the thread got broken.
> I want to use English and Japanese in the same document. If I specify my
> desired font in the dropdown box in Documents/Settings/Fonts, Japanese
> characters will not appear in the PDF.

At least, if the desired font does not contain glyphs for the Japanese
characters.

Unfortunately, the missing characters are only reported as "warning", not
as an "error". Therefore, LyX will not prominently report this. (You can
see the warnings when opening Document>LaTeX log.) BTW: The development
version of LyX has improved reporting of missing characters (a popup window).

> If I try to use a Japanese font, formatting such as bolding, italics
> disappear as well as the font's design isn't up to professional standards
> for English. 

The most simple method would be to use a font that has both, Latin and
Japanese glyphs in all the desired variants. (But this is hard to find...)

> So what I want to do is to have one font that applies only to
> English and another that applies only to Japanese.

How can we get this:

> In response to Gunter's suggestions, 

I mixed up things in my "off the head" response. The multi-font setup is not
directly done via fontspec but via the polyglossia package.

> I made sure to use an updated
> \usepackage{fontspec} in Settings/Languages/Language package.

"fontspec" is the font selecting package. It is automatically used by LyX if
you check the "use non-TeX fonts" box.

Document>Settings>Languages>Language package is better left to "standard" or
"auto".

> "Times New Roman" is set in the Settings/Fonts/Roman dropdown box. I have
> of course checked non-TeX fonts.

So fontspec is loaded. 

> Referring to the fontspec documentation I didn't find any discussion of
> using more than one font in a multilingual document, but I read somewhere
> about the following command which I inserted into the preamble.

>  \newfontfamily\CJKfont{MS PMincho}

> The result was as before: no Japanese characters appeared in the PDF XeTex
> output. 

The problem is, that polyglossia does not support Japanese! Therefore, LyX
selects babel instead of polyglossia as language package as soon as a part
of the document is in  Japanese language.

What are the options then:

* set the sans-serif or teletype(monospace) font to the Japanese font and
  change the font family for Japanese text parts
  (works only, if you have a "spare" font family).

* use a "dummy" language that is supported by polyglossia.

  In the LaTeX preamble write, e.g.
    
    \newfontfamily\telugufont{MS PMincho}
    
  and in the document mark the Japanese text parts as beeing in the
  language "telugu".
  
  Fails, if you must rely on "babel strings (abstractname etc.) in
  Japanese or other language features.

* Look up the font-changing command in the "fontspec" package documentation 
  (this time really in fontspec, not polyglossia) and use this in an ERT
  (raw LaTeX) box. Don't forget to switch back to the standard font (again
  in ERT).
  
  (Cumbersome but safe.)
  
* Mark the Japanese text parts as Japanese (LyX will use babel), and
  add the font-switching commands to "extrasjapanese". (If you want to go
  this route, I'll try to find out the "magic" commands for the preamble.)


A hint for experimenting: The source panel (View>Source) can show what LyX
will print to the LaTeX file. With "whole document" instead of "current
paragraph", you can also see the generated preamble and find out which
languaga package is used, which font package is used etc (and hence, which
of the commands suggested in the LaTeX documentation you do not need to
print in the "LaTeX preamble".

  
Hope this helps

Günter  

Reply via email to