0

How can I, in tex code or directly in the Lyx GUI, put the part title in the center.

e.g. instead of this:

Part I

Introduction and Background theory

this:

              Part I

   Introduction and Background theory

MWE:

% Preview source code

%% LyX 2.1.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\begin{document}
\begin{center}


\part{Test abcabc}

body text

\end{center}
\end{document}
1

Did you check the option to create a centered environment? E.g. \begin{center}Part I ...\end{center} or the switch \centering? That would be for how to center things in TeX. Whether the LyX GUI offers that option I don't know, but I would assume so. Sent from my phone. If needed a more detailed explanation with examples could be provided.

I see now. You could use

 % Preview source code

%% LyX 2.1.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage{sectsty}
\partfont{\centering}
\begin{document}
\part{Test abcabc}
body text
\end{document}
  • This has no effect – Tim Jun 3 '15 at 7:28
  • Would you be so kind and give us a MWE example of your code? I don't use LyX but from what I know I don't see why that shouldn't work. – idkfa Jun 3 '15 at 7:30
  • Done. See updated post. – Tim Jun 3 '15 at 7:32
  • 1
    @Tim I updated my answer accordingly – idkfa Jun 3 '15 at 7:49

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.