# How to make and install a LyX Document Class, based on a journal’s LaTeX template files

I would like to submit an article to a journal. The journal suggests using template files that one can find at https://www.mdpi.com/authors/latex . I have used (on a Windows 10 computer) the following to draft the article: LyX (which I know how to use, assuming that the relevant document class is already installed), MiKTeX (which I do not know how to use directly), and JabRef (which I know how to use). The text of the article is close to ready, based on using the following LyX selections.

Document > Settings > Document Class: Article (Standard Class)

Document > Settings > Bibliography items set as ... Style format: Basic (BibTeX); Bibliography Style > Default BibTeX style: plain; Bibliography Generation > Processor: Default

I would like to install and use a document class based on the journal’s template. The current link (on the page cited above) for the template is MDPI_template.zip - contains the template, logo, class and bibliography style files - [last updated 2020/01/20] - https://www.mdpi.com/data/MDPI_template.zip?v=20200120 .

I know very little about TeX, LaTeX, MiKTeX, etc. I do not know how to install new 'packages' for use by LyX (but should be able to follow complete, adequately detailed directions).

The following information may be helpful (depending on the breadth of applicability of the template). I want to submit to the journal “Physics.” I want the submission to be an “article.” The journal wants bibliographic items to have author names in the form “last-name, initials.” The journal wants the bibliography ordered by the order in which citations first appear in the article. (As yet, I have been unable to satisfy – regarding the draft – the last two sentences. I hope that the “template plus installation” will allow me to have or easily select appropriate settings.) The article includes all the tables I anticipate that it will have. I do not anticipate having figures.

I hope that someone will provide a straightforward installation process that I can use.

(Possibly, the process will prove useful for other people, even if they want to submit to other journals that post templates.)

Lyx > Help > Customization > 5 Installing New Document Classes ...

Said that, you will notice that make LyX layouts is not trivial. My suggestion: You will finish munch earlier your article if you learn to edit LaTeX directly.

(1) Lyx export to a clean LaTeX code. You can use this to learn, comparing what you type in LyX and what you get in LaTeX. Warning: do that with LaTeX exports of other programs could burn your brain.

(2) In View > Source Pane you can see that what you will get in LaTeX in real time, but be sure of check always the "Complete Source". A code chunk of the current paragraph will never work alone. Note that in this site the answers usually have "minimal working examples", i.e., small code examples but always of complete sources, while question of novices often show useless snippets of code because they do not understand the importance of the surrounding code.

(3) LaTeX code is just plain text as .txt but with the .tex extension, so you can edit that it with any plain text editor.

(4) The LaTeX files (.tex) should be processed by a compiler as "pdflatex" (e.g., pdflatex myfile.txt will output myfile.pdf). A complex file will need be processed also by auxiliary programs to create some parts (index, references, etc.) and then rerun the compiler twice to integrate all parts in a final PDF. This can be done manually at the system prompt c:\>, or automatically with any program able to launch another programs.

(5) LaTeX editors are plain text editors with some features to make your file easier, as run these programs in some way without open the system console.

(6) TeXworks is one among many of these LaTeX editors. Maybe not the best, but it works and is installed with MikTeX, so it is already in your computer.

(7) TeXworks have templates of standard document in the File menu, so you can open article.tex (for instance) and test it without starting editing from the scratch (just select "pdfLaTeX" in top left dropdown menu, then press the green button). This is good to understand the compilation process a bit more than in LyX, but remember, to learn the structures of LaTeX code, start with a simple "Hello, word":

\documentclass{article}
\begin{document}
hello, word
\end{document}

Then try make "hello" in bold, then try to add a small table, and so on. There are countless free tutorials in Internet to do the basics structures.

(8) There are the myth of the steep learning curve of LaTeX, and while this is very true to become some kind of expert (able to make sentences in spiral, photorealistic 3D images and so on, moreover typing that in Emacs, or vim ...), this is a dirty lie with respect to learn the basic LaTeX structures practicing with some simple editor like TeXworks. It is not so hard guess what will LaTeX do with \maketitle, \tableofcontents, \section{whatever} or \end{document}. With these and one handful of basic commands more (well, a few dozens more, really ...) you will be able to write presentable documents, so\relax if you heard this black legend. :)

• Thanks. Based on your answer, I plan to ask the journal to do the seemingly only thing that I cannot do - that is, convert {regarding the bibliography} author names from "given family" to "family, initials". Based on your answer, an answer to tex.stackexchange.com/questions/532718/…, and correspondence with the journal, this seems like a possible path forward. Again, appreciated. – TJB Mar 18 '20 at 0:21
• You only have to choose % References, variant A: external bibliography that is, change the line 315 to some like \bibliography{foo} (without the % symbol !!) if you have references in a file named foo.bib, or .... go with "variant B" and then make the references manually, just following the examples. Variant A follow the "BibTeX approach" of this introduction to references, but \bibliographystyle is already fixed elsewhere, so you should not use that command. – Fran Mar 18 '20 at 5:16