# LyX - export with custom document class [Linux]

I have a document written in lyx, which is supposed to be exported to pdf file on Linux. I write it on Windows, but then I commit the .lyx file to repository and it's suposed to be exported to PDF on another machine with Ubuntu.

I'm using the following line to export file:

lyx -batch --export-to pdf2 ./out/MasterThesis.pdf ./Docs/Thesis/src/RestTestingFramework.lyx


In the src directory I have .cls and .sty files with my custom document class and on linux I have a copy of that in ~/.lyx/layouts/. On Windows everything works fine, but on linux I get following errors:

LayoutFile.cpp (332): Existing textclass dcsbook is redefined by /home/travis/build/matjanos/MasterThesis/Docs/Thesis/src/dcsbook.layout
LayoutModuleList.cpp (253): Default module dcs added although it is unavailable and can't check requirements.


Where is the mistake? How can I fix it?

• Can you try removing the -batch option? I don't think it's useful in this case and might actually mess something up. Also, is your Ubuntu installation a headless server or can you run the GUI? If so, can you export from the GUI without problems or do you see the same message? – scottkosty May 11 '16 at 12:50
• Removing -batch doesn't change anything. GUI version gives me some syntax errors, which, as I assume, arise because of incorrect layout configuration. First error: \section{Chapter Name} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), type I' and the correct spelling (e.g., I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined – Kuba Matjanowski May 11 '16 at 13:21
• Can you post a minimal example? for more information, see wiki.lyx.org/FAQ/MinimalExample – scottkosty May 11 '16 at 18:23
• When I was preparing minimal example, I came across the essential problem... Everything works fine when I delete sections from my file. On Linux it seems to be undefined: \begin_layout Section - this line causes the error mentioned in my previous comment. Minimal example pastebin.com/cv652VyE – Kuba Matjanowski May 14 '16 at 10:35
• You need a file dcsbook.layout. You also need the necessary LaTeX files. You can copy them from your Windows computer to your Ubuntu computer or you can get them from here perhaps: github.com/politechnika/put-latex/tree/master/templates/dcs . If you're not sure how to install new LaTeX files, search for how to install LaTeX packages on Ubuntu and also LyX layout file (just need to put it in ~/.lyx/layouts` and then go to Tools > Reconfigure and restart LyX). – scottkosty May 14 '16 at 14:06