Uwe Stöhr wrote: > Am 08.07.2012 21:11, schrieb Georg Baum: > >> but CJK.lyx cannot be exported. > > I can export it without problems to pdflatex.
Does not work either. It fails to encode 0x6587 in both cases. >> I also don't understand >> the note in CJK.lyx.lyx. The .tex file clearly states that the main >> language is english. > > No, this file is not in English! I wrote it in LyX using "Japanese (CJK)" > as document language. The "english" is only a babel option and only > appears because I used an English paragraph in the file. > > But that is exactly why there is a note - we cannot know the document > language. Please forget about LyX for a moment. As far as LaTeX is concerned, english is the only language that explicitly appears in a LaTeX command (or rather the preamble in this case) in this document. All other languages do not appear explicitly in the document, you rather guess them from the used encodings. Therefore, from a LaTeX point of view, the language is clearly english. >> IMO we should never put such notes into imported files. If there >> is a bug it should be fixed, and if the .tex file does not carry enough >> information to restore the .lyx document it was created from, then we >> should do as best as we can and live with the differences. > > There is no bug. LaTeX simply does not store the document language as we > understand it. For CJK there is no such thing like we understand document > language. We already do the best we can and giving the user the info to > check what he thinks the document language could be is very helpful. I > guess in 99% of the cases he clearly knows this and can set it quickly in > the document settings. I understand that. My point was a bit different: In general, the exported .tex files do not contain all information of the original .lyx files. There are many more cases where information is lost, e.g. branches or stuff in yellow notes. You implemented a special treatment of one of these cases. Should we add notes for the other cases as well, e.g. "tex2lyx does not know if there was a note at this place originally?" Of course this example is nonsense, but what should a user think who imported a true .tex file which did not come from LyX? Your note assumes that roundtrip is the main use case, but this is wrong IMO. The most important use case is true import. Adding meta data is not the way to go either (the in_lyx_preamble bool in Preamble.cpp can already cause data loss). Therefore, the only thing we should do is to use the existing information of the .tex file as best as we can. Any interpretation should be left to the user. >> Question: Is it more convenient to let the test overwrite the reference >> results, so that the differences are automatically seen by git, or should >> the references better be kept in a separate location? I am unsure about >> that. > > I prefer the latter. The best would be to import a file "filename.tex", > the import is saved as "filename-imported.lyx" The file name convention is already set by tex2lyx (it is filename.lyx.lyx and the re-exported file is filename.lyx.tex). The question is only where the result should go: source tree or build tree? I'll wait a bit more, but for now it looks like the majority wants the latter. Georg