LyX"CHAPTER 1" to "CHAPTER ONE"

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
zwitdh
Posts: 4
Joined: Fri Aug 09, 2013 9:13 am

"CHAPTER 1" to "CHAPTER ONE"

Post by zwitdh »

Hi all,

I've new here, and just seriously considering Lyx to write my dissertation. I've downloaded & read several Lyx ebooks & practice it. I don't know much about coding (latex preamble etc), but I'm willing to learn.

Got a problem, thesis template is suppose to be CHAPTER ONE, instead of Chapter 1. I couldn't find the solution. I spent lot of time on this. I even tried to install latex editor like Texnicenter and Textmaker to make it understandable. but still can't.

I found one from this link

http://tex.stackexchange.com/questions/ ... hapter-one

I try to put these code on LATEX preamble and even ERT box, but I didnt get any solution. Please help me, I mean step by step in short on how to put this code, or anybody may have simpler solution.

Please help. Thanks in advance.

Regards,

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

"CHAPTER 1" to "CHAPTER ONE"

Post by cgnieder »

Hi zwitdh,

welcome to the LaTeX community!

Well, the code

Code: Select all

\usepackage{xpatch}% http://ctan.org/pkg/etoolbox
\usepackage{fmtcount}% http://ctan.org/pkg/fmtcount
\renewcommand{\thechapter}{\NUMBERstring{chapter}}%
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}
\makeatletter
\xpatchcmd{\@chapter}% <cmd>
  {\numberline{\thechapter}}% <search>
  {\@chapapp~\thechapter\quad}% <replace>
  {}{}% <success><failure>
\makeatother
should go into the preamble. If that isn't working, we will need to see a Minimal Working Example.

Should you be using a very up to date TeX distribution it may be that you're experiencing the following bug: part number (1, 2, 3) as word (one, deux, trois)?.

In this case try placing the following in the preamble:

Code: Select all

\usepackage{xpatch}% http://ctan.org/pkg/etoolbox
\usepackage{fmtcount}% http://ctan.org/pkg/fmtcount
\renewcommand{\thechapter}{\NUMBERstring{chapter}}%
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}
\makeatletter
\input{fc-british.def}
\xpatchcmd{\@chapter}% <cmd>
  {\numberline{\thechapter}}% <search>
  {\@chapapp~\thechapter\quad}% <replace>
  {}{}% <success><failure>
\makeatother
Regards
site moderator & package author
zwitdh
Posts: 4
Joined: Fri Aug 09, 2013 9:13 am

"CHAPTER 1" to "CHAPTER ONE"

Post by zwitdh »

Hi cgnieder,

Thank you & thanks for your helpful reply. I tried to implement it, but I keep getting error message, well I must admit I need to practice more. I tried to insert the code in your reply and made some adjustment, but unable to get output. Actually the following is my current Latex Preamble :

--------------

Code: Select all

% %====================== 

% this command prints empty date in title page
\date{}

% If you want your text paragraph is left justfied
% you need to uncomment (delete %) the following command
%\raggedright

% this command set the paragraph indentation
% if you want to modify change the value 1.5cm to your preference
\setlength{\parindent}{1.5cm}

%This command will change the default Bibliography to References
\AtBeginDocument{
        \renewcommand{\bibname}{References}
        \renewcommand{\nomname}{List of Symbols}
}

%The following comands center the heading of chapters and
% chapter entries, the default is on the left
\addtokomafont{chapterentry}{\centering}
\addtokomafont{chapter}{\centering}

% The following commands set the page numbers on the top right
% except in the beginning of chapters
% using fancyhdr package (page layout>heading style->fancy)
\lhead{}
\chead{}
\rhead{\thepage}
\lfoot{}
\cfoot{}
\rfoot{}
\renewcommand{\headrulewidth}{0pt}

% The following commands set the vertical space before and after 
% every chapter entry
\renewcommand*{\chapterheadendvskip}{\vspace{2cm}}
\renewcommand*{\chapterheadstartvskip}{\vspace{2.5cm}}

% The following commands set the TOC, LOT, LOF and LOA
% this employs tocloft package
\usepackage{tocloft}
\cftpagenumbersoff{part}
\renewcommand{\cftdot}{}
\renewcommand{\cfttoctitlefont}{\hfill\Large\bfseries\sffamily}
\renewcommand{\cftaftertoctitle}{\hfill}
\renewcommand{\cftaftertoctitleskip}{2.5cm}
\renewcommand{\cftbeforetoctitleskip}{2.5cm}

\renewcommand{\cftloftitlefont}{\hfill\Large\bfseries\sffamily}
\renewcommand{\cftafterloftitle}{\hfill}
\renewcommand{\cftafterloftitleskip}{2.5cm}
\renewcommand{\cftbeforeloftitleskip}{2.5cm}

\renewcommand{\cftlottitlefont}{\hfill\Large\bfseries\sffamily}
\renewcommand{\cftafterlottitle}{\hfill}
\renewcommand{\cftafterlottitleskip}{2.5cm}
\renewcommand{\cftbeforelottitleskip}{2.5cm}

\newlistof{appendices}{loa}{List of Appendices}
\renewcommand{\cftloatitlefont}{\hfill\Large\bfseries\sffamily}
\renewcommand{\cftafterloatitle}{\hfill}
\renewcommand{\cftafterloatitleskip}{2.5cm}
\renewcommand{\cftbeforeloatitleskip}{2.5cm}

\usepackage{minitoc}

% Redefining automatic label of Figure, Table and Eq.
\usepackage{prettyref}
\newrefformat{tab}{Table\,\ref{#1}}
\newrefformat{fig}{Figure\,\ref{#1}}
\newrefformat{eq}{Eq.\,\textup{(\ref{#1})}}

%added in V-05
\setlength{\nomitemsep}{-\parsep}
%\setlength{\nomitemsep}{-2\parsep}   % another alternative 
------------------------------------
& please find the attachment for the lyx file of this template. I used MiKTeX 2.9. This is the first time I need to modify the code, I simply need an example. Could you please let me know where should I insert those xpatch code (within Latex preamble) to get the desired result. Sure, your answer would be very useful for me in future (code modification etc). I try to search any youtube video on LyX to find solution but there're not many LyX video, unlike LaTeX.

The 2nd question, LyX is front end of Latex, I've read several books, but still find that coding is bit uneasy for me, my background is Finance & doing Data Mining research which uses many Math equation, don't have background in coding & stuff but seriously want to learn it. Could you let me know if the video links such these will help me to understand better to work with LyX code modication?

http://goo.gl/J9rK0q
http://goo.gl/SwvJTs

Thanks in advance & I look forward for your reply.

Regards,
Attachments
UTHM-Thesis-Classic-authoryear-V-05.lyx
(32.6 KiB) Downloaded 431 times
Last edited by cgnieder on Sun Aug 11, 2013 9:45 am, edited 1 time in total.
zwitdh
Posts: 4
Joined: Fri Aug 09, 2013 9:13 am

Re: "CHAPTER 1" to "CHAPTER ONE"

Post by zwitdh »

Hello cgnieder,

EUREKA!!! ...just to let you know, I got my desired result after several trial & error - using your assistance (the patch etc). I must admit I have to exercise more & more with Lyx, only then I will know better. Thanks!
Post Reply