It appears from the discussion that you do not actually need to follow Australian National University's guidelines. There is therefore no good reason to use this very complicated and low-quality template. The best thing you can do is to get rid of it entirely: remove all the custom preamble (except maybe what you understand and are sure that you really need and is not automatically provided by LyX — given what I see, you should probably remove almost everything). Also reset all document parameters that you do not understand.
Then the question is, how to get again a nice-looking document? Use the following guide to have a good starting point.
Simple document defaults to get started with report writing in LyX
Document class
This is the most important choice. I recommend one of the classes from KOMA-Script. They have sensible defaults, and later, a lot of customization options and a good manual (texdoc scrguien
) to explain the customization options. Use the following guide to choose between the article class, the report class and the book class from KOMA-Script: https://tex.stackexchange.com/a/36989/87201.
Page Layout
Choose your format (A4 or US Letter). Set Two-Sided Document if relevant for you; it sets the margins and other things appropriately for two-sided printing.
Select Page Style > Headings. This prints the Chapter and the Section at the top of the page.
Margins
Trust KOMA-Script to come up with a good choice of margins. You can fine-tune the margin size under Document Class > Class Options > Custom. There, type DIV=n
where n is an integer. It denotes the fraction of the page that must be reserved for margins (more precisely, all the page dimensions are computed so that the text width is (n-2)/n times the page width while remaining harmonious).
Under the Page Margins tab, make sure that Default Margins is selected. (This prevents the geometry
package from loading, which would interfere with KOMA-Script.)
Fonts
If you need special symbols (e.g. if you need mathematical formulae) I recommend choosing one of the recent high-quality fonts that provide everything you need in one package. This includes the Latin Modern fonts (selectable from the interface) and also the STIX fonts (choose Default as Roman font in the interface and add \usepackage{stix}
in the preamble; also choose a suitable sans-serif font).
If you do not need special symbols, you have more freedom in the font choice and the LyX interface provides a good sample.
It is also possible to select system fonts (LyX will automatically switch to XeTeX or LuaTeX). However I do not recommend this for a start especially if math fonts are needed.
Modules
LyX functionality is extended with modules. Under the Modules tab, select what is relevant for your field. For instance if you need theorem environment, select an appropriate Theorems module.
Hyperref support
Activate Hyperref Support under PDF Properties. Select Automatically Fill Header, Break Links Over Lines and No Frames Around Links.
Math Options
Make sure that all packages are set to load automatically.
Tables
I recommend using tables in the booktabs
style also known as the Formal style in LyX (available from the table properties). Looking at the examples in the booktabs manual is recommended (texdoc booktabs
). There is also a small section on it in LyX's Embedded Objects manual.
Bibliography
The standard bibliographic tool used by LyX is bibtex (starting from version 2.3, LyX also supports biblatex). Add your bibtex bibliography from the Insertion menu and choose the style according to the best practices of your field. (amsalpha
is a good one for mathematics.)
Sub-documents
For long document separated into child documents, you only need to select the same document class and modules, and to set up the master document for each child.
If in addition you want to be able to compile child documents independently, you must apply the above settings for each child document. They are ignored when compiling from the master document.
Going further
Many more customizations are possible! For this I recommend going step-by-step and using the LyX manuals and the KOMA-Script manual as your primary source. Introduce in the preamble commands that you find on the Internet only after you understand them and you are sure that LyX or KOMA-Script do not provide simpler alternatives.
After testing the possibilities of adjusting LyX's behaviour using a "portable" approach as given in the other answer, in this case the solution was to simply add a fresh username composed of simple characters.
NOTE a number of users may arrive here who have either accented names or be composed UTF-8 characters or simply have a two-part name with a space. In such cases it is best to consider adding a new user to the system with a single plain ascii moniker.
e.g. c:\users\me\
IF you have already installed TeX and LyX you have likely encountered the issue of LyX complaining it cant find the TeX classes. So as a minimum uninstall LyX for that problem account.
Now using the new account BEFORE you do a fresh LyX install, first check that your TeX is correctly configured. On windows you need to confirm that the two following commands agree EXACTLY.
So to test all is well check that there is only one pdfLaTeX and that it is included in the path variable so from a command prompt run
> where /r \ pdfLaTeX
> where $path:pdflatex
both should agree it will of course vary for each user HOWEVER it should be one IDENTICAL entry for both commands
e.g. c:\ ..tex.. \ .. \some\bin\pdflatex.exe
Using the fresh account next check if installing LyX clears the problem. If you still encounter issues with the underlying TeX (MiKTeX or Tex Live) then you may need to consider re-installing one of those again. But again ensure you pass the where test before starting the new LyX.
When you make significant changes to the underlying programs especially MiKTeX updates, you may need to frequently use the "Reconfigure" option within LyX.
An associated problem can be the choice of PDF viewer since LyX uses background processes such as DDE or Pipes to control the pdf viewing. You may wish to check out alternatives.
Best Answer
I find that
$\mathcal{P} (\mathbb{A})$
gives me the result I want: