I have a custom layout file that is attached to my document and used by Lyx. The file is in ~/.lyx/layouts.

This question tells how to add a line to the preamble via the menu:


I'd like to keep all of my formatting in the layout file if possible and avoid setting things in the Lyx menus.

So I added that line to the Preamble section of my layout file, and also tried


but it does not work. After re-configuring, restarting and re-rendering the PDF, the parts are still called "part".

Is there a way to make this change ("part" to "act") work from the layout file?

And is there a way to make the editor reflect this change from within the layout file, without changing the default definition of the book class (which my layout file extends).

My Lyx version is 2.2.3 on Linux.

Update: Maybe \renewcommand{\partname}{Act} is the wrong command, as it doesn't work if you put it in the LATEX preamble section in Lyx document settings either.

Update two: here's a striped down layout file:

#  \DeclareLaTeXClass[book]{book (My Book Style)}

# Input general definitions
Input stdclass.inc

MaxCounter              Counter_Section
SecNumDepth             3


% Tell the TOC not to include any levels below "chapter"

% Change "Part" to "Act"
  • Maybe try \AtBeginDocument{\renewcommand{\partname}{Experiment}}? – Bernard Mar 2 at 21:26
  • @Bernard: that didn't work. – Nick Mar 2 at 21:39
  • @Nick I would separate the problem to figure out whether the problem is with the LyX layout definition or with the LaTeX. Thus, first I would try to make a minimal LaTeX example and make sure it does what you want. Then the question is how to get the layout to produce that LaTeX. – scottkosty Mar 2 at 21:41
  • Hi @scottkosty: I just tried placing the line in LATEX preamble section of "document settings" via the Lyx menu and it did not work there either. – Nick Mar 2 at 21:43
  • 1
    Could you post a minimal code that reproduces the problem? – Bernard Mar 2 at 21:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.