[Tex/LaTex] In Lyx, how to change “Part I” with some other text

formattinglyxsectioning

I'm using the article class. When creating a new part, I would like to change "Part 1" to "Experiment 1", "Part 2" to "Experiment 2" and so on, followed by my part title. How can I do that?

I've found this question, but the answers didn't work for me
In Lyx, how to change the "Part" section to "Chapter"?

Thank you! 🙂

Edit:
This is my preamble:

\usepackage[version=3]{mhchem}
\date{}
\usepackage{fancyhdr}
\usepackage{titlesec}
\setlength{\headheight}{15.2pt}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\lhead[]{}
\rhead[]{}
\lhead[]{}
\rhead[]{}
\lfoot[\thepage]{}
\rfoot[]{\thepage}
\renewcommand{\partname}{Experiment}%added later

EDIT:
The \renewcommand{\partname}{Experiment} line works fine with the language set to English, but i need to make this work in other languages, because now if I add the toc it's called "Contents", while I need an italian "Indice".

Edit:
self-answer (for all who may find this helpful): use \renewcommand\contentsname{Indice} to change "Content" to "Indice" or whatever.

Best Answer

LyX just provides an interface (or front end) to LaTeX. So, while you may see

Part I  Some text

as your title inside the editor view, the LaTeX code associated with it

\part{Some text}

will output

Experiment I  Some text

if you add

\renewcommand{\partname}{Experiment}

to your preamble (Document > Settings... > LaTeX Preamble). If you wish to change this in the editor as well (so the visual matches the PDF output), you need to edit the stdsections.inc layout file; specifically the part style:

Style Part
  Category               Section
  Margin                 Dynamic
  LabelString            "Part \thepart"
  LabelType              Counter
  ...

You would have to update LabelString to read "Experiment \thepart" instead.