LyXCannot print old lyx file to pdf (XeTex) on new Lyx :(

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
clemens
Posts: 77
Joined: Fri Jun 26, 2009 11:57 am

Cannot print old lyx file to pdf (XeTex) on new Lyx :(

Post by clemens »

Hello,

in 2008-9, with the kind and patient help of meho_r, I managed to make a Lyx file that could be nicely printed in pdf.
The file, made on a Ubuntu OS, had a lot of Japanese, using XeTex with the Hiragino Mincho Pro W3 odt font, and the Memois class, which covered more than what I needed for.
These days I have been trying to print again the file on the newer version of Lyx, installed in a Windows 7 PC, but unfortunately I could not manage.
The preamble at the time was:

Code: Select all

\usepackage[cm-default]{fontspec} 
\usepackage{xunicode}
\usepackage{xltxtra}
\defaultfontfeatures{Mapping=tex-text}
\fontspec{Times Ext Roman}
\defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text}
\setmainfont{Times Ext Roman} 
%\headstyles{dowding}
\headstyles{default}
\chapterstyle{crosshead}
\frenchspacing
\makeatother
\usepackage{babel}
\usepackage{xeCJK}
%\CJKlanguage{Japanese}
\setCJKmainfont{HiraMinPro-W3}
\usepackage{array}
The errors I got (the log would be way too long, in case it is necessary I will post it), were mainly related to xeCJK and fontspec.
I decided therefore to remove those parts, leaving only:

Code: Select all

\headstyles{default}
\chapterstyle{crosshead}
\frenchspacing
\makeatother
\usepackage{babel}
\usepackage{array}
and I could print the pdf, but strangely, without the Japanese characters.

I tried taking these parts off and I do get the pdf, but with no Japanese, instead the empty rectangles typical of the missing characters.
I believe it probably has some relation to the font settings but cannot figure out what it is. I also tried changing the name of the font Hiragino Mincho Pro W3 since the way it is called in Linux (the OS I was using at the time) HiraMinPro-W3, and the way it is called in Windows (the OS at the moment) is slightly different, but I could not manage and I am not sure I got the names right.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

clemens
Posts: 77
Joined: Fri Jun 26, 2009 11:57 am

Re: Cannot print old lyx file to pdf (XeTex) on new Lyx :(

Post by clemens »

Hello,

I am trying again, but still I cannot manage to get the file printed in pdf with the Japanese characters.
I also tried opening the file with a reinstalled older version of Lyx, but since I have done some editing of the file on the newer 2.0 version, the older Lyx 1.6. (the version that I used originally) tells me that it cannot open it :(
I am almost giving up and probably I will have to copy and paste to MS Word, and stay with that if I cannot find a solution :(
Please someone reply to this desperate cry for help.

Clemens
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Re: Cannot print old lyx file to pdf (XeTex) on new Lyx :(

Post by scottkosty »

I see your preamble but I don't see a minimal example. In questions like these please post a *full* but *minimal* and *working* example.
clemens
Posts: 77
Joined: Fri Jun 26, 2009 11:57 am

Re: Cannot print old lyx file to pdf (XeTex) on new Lyx :(

Post by clemens »

Thank you so much for your reply.
I am sorry I didn't provide a minimal example, I thought that the information present in my initial post was enough, but now I realize that including the file (actually part of it since the original is hundreds of pages long) would have been better.
I hope the "test pages" that I am attaching are good enough.
They have both English and Japanese and various layout details (tables, long lines, etc.).

Thank you in advance for the help,

Clemens


p.s. please let me know if you need the fonts. By the the way, I believe that the two main problems are:

1. the way the Hiragino font is referred to within Windows (although I cannot find the proper name). I deduce this from the fact that the parts of the text where Japanese characters are from default Windows fonts (specifically SimSun, that does not look as good as the Hiragino, but it includes rare characters missing in the other) they are printed properly.

2. the xeCJK settings. I deduce this from the fact that the longer lines with Japanese characters (represented by empty rectangles) are not properly cut.

I am not sure, they are just supposition, but even trying, I couldn't find a solution because my knowledge of Lyx, XeTex and Latex are limited.
Attachments
test pages.lyx
(42 KiB) Downloaded 428 times
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Re: Cannot print old lyx file to pdf (XeTex) on new Lyx :(

Post by scottkosty »

I tried your document and I also get errors. I'm on Ubuntu so I'm not even sure if I were able to get it to compile it would work for you. Also, your minimal example is very large. It sounds like you don't have the time, but I would recommend starting with a very basic example that works and then building it up to your complex example and seeing where things go wrong.

Sorry I can't help further. Best of luck!
clemens
Posts: 77
Joined: Fri Jun 26, 2009 11:57 am

Re: Cannot print old lyx file to pdf (XeTex) on new Lyx :(

Post by clemens »

Thank you so much for having tried.
If I had more time I could try an easier example but that wouldn't solve much since the a basic file would smoothly but would miss all the parts I need and the whole thing would probably be as labor intensive as copying everything to MS Word, without the certainty that things would work at the end.
Actually the problem parts of the file are expressed in the Lyx compilation error log, and they are related to XeCJK and perhaps the font name (there is the "your are in trouble now" warning).
All the best,

Clemens
Last edited by clemens on Sun Aug 24, 2014 1:28 pm, edited 1 time in total.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Cannot print old lyx file to pdf (XeTex) on new Lyx :(

Post by cgnieder »

clemens wrote:Thank you so much for having tried.
If I had more time I could try an easier example
You really should because that could give you hints what goes wrong (and where). And even if it wouldn't help you directly someone here might be able to help then.
clemens wrote:but that wouldn't solve much since the a basic file would smoothly but would miss all the parts I need
To be frank: you cannot know that without having tried. It is not a coincidence that helpers always ask for a Infominimal working example (with stress on “minimal”). They are the only way of finding the source of errors! If you don't provide such a minimal example then what you're effectively doing is asking helpers to take your large example and start minimizing it themselves. It is probably not a big surprise that most helpers are not willing to do that.

Best
site moderator & package author
clemens
Posts: 77
Joined: Fri Jun 26, 2009 11:57 am

Re: Cannot print old lyx file to pdf (XeTex) on new Lyx :(

Post by clemens »

Thank you for the message and sorry for the late reply, but I didn't check after my last post, since I was losing hope that a solution could be found without first reconstructing the entire file, which would have been too labor intensive (there are at least 10 specifications that took me more than a week to set, even with the kind and fundamental help of the people of this forum, without them I certainly would not have been able to make it).
Of course I wasn't asking to all the kind helpers to rebuild it for me, I just was thinking that the error report provided enough information to understand where the problem was.
Please forgive me if I looked as lazy or rude in someway, it wasn't my intention. It was just due to my little knowledge and inexperience, thinking that the error could be identified more easily.
In any case, just as a final desperate attempt, I installed lyx with Miktex on another computer, freshly set up, and somehow it all worked, compiling the pdf properly, just with a fontspec error, that overrode some little settings, but nothing big since it affected only 5 characters.
Looking back at everything I believe the problem had to do with MikTex's repository retrieval system: although I always gave the software full admin access, because I wasn't working directly on the admin account (something I did do on the new computer, with a fresh install just for the purpose), somehow Miktex wasn't able to use the right packages.
In any case, thank you all for your help and support.
Cheers,

Clemens
Post Reply