Generalsetting chapters style

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
metal_man
Posts: 2
Joined: Tue Mar 15, 2011 10:07 am

setting chapters style

Post by metal_man »

Hi,
I'm new to LaTeX and I have some questions. I'm writing my thesis and I received some guidelines for document layout:

Code: Select all

b)	fonts:
•	body text - Times New Roman 12pt,
•	headline, level 1 - Times New Roman 16pt, Bold,
•	headline, level 2 - Times New Roman 12pt, Bold,
•	headline, level 3 - Times New Roman 12pt, Italic,
c)	line spacing - 1,5 line,
d)	margins: left – 3,5cm; right, top and bottom 2cm,
Headlines have to be numbered:
level 1 - 1, 2 etc.
level 2 - 1.1, 1.2 etc.
level 3 - 1.1.1, 1.1.2 etc.

I don't know how to achieve point b. Each document class has it's own style and I need to make my own. Also, there is a need to export document into Word format (.doc or. docx) or OpenOffice(.odt). I tried to write some chapters in Word but it's a painful work. I did some papers in LaTeX, but I didn't have change the whole style. So if somebody could help me I would be grateful.

Recommended reading 2024:

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

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

Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

setting chapters style

Post by Frits »

The section numbering is done automatically by LaTeX. Define the different levels of headings as follows:

Code: Select all

level 1: \section{title}
level 2: \subsection{title}
level 3: \subsubsection{title}
Furthermore, the times package is needed for Times New Roman as a font:

Code: Select all

\usepackage{times}
But in the end, I'm not sure if it will be possible to convert a .tex or .pdf file to a MS Word document. And even if it is possible, it will probably not be perfect.
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
metal_man
Posts: 2
Joined: Tue Mar 15, 2011 10:07 am

Re: setting chapters style

Post by metal_man »

But is it possible to define for example: \section{} to be 16pt bold?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

setting chapters style

Post by localghost »

Frits wrote:[…] Furthermore, the times package is needed for Times New Roman as a font:

Code: Select all

\usepackage{times}
As explained in its entry on CTAN, the times package is obsolete [1].
metal_man wrote:[…] I'm writing my thesis and I received some guidelines for document layout:

Code: Select all

b)	fonts:
•	body text - Times New Roman 12pt,
•	headline, level 1 - Times New Roman 16pt, Bold,
•	headline, level 2 - Times New Roman 12pt, Bold,
•	headline, level 3 - Times New Roman 12pt, Italic,
c)	line spacing - 1,5 line,
d)	margins: left – 3,5cm; right, top and bottom 2cm,
Headlines have to be numbered:
level 1 - 1, 2 etc.
level 2 - 1.1, 1.2 etc.
level 3 - 1.1.1, 1.1.2 etc.

I don't know how to achieve point b. Each document class has it's own style and I need to make my own. […]
These are typical demands for a thesis written in W0rd. Simply bad style, not to mention the type area. Nevertheless they can be translated to LaTeX. See the code below for a very basic structure.

Code: Select all

\documentclass[12pt,a4paper,english]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[bindingoffset=1.5cm,includeheadfoot,margin=2cm]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage[pagestyles,raggedright]{titlesec}
\usepackage{txfonts}
\usepackage{blindtext}

\titleformat{\chapter}[display]{\normalfont\fontsize{16}{19}\selectfont\bfseries}{\chaptertitlename\ \thechapter}{1em}{\fontsize{16}{19}\selectfont}
\titleformat{\section}{\normalfont\normalsize\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}{\normalfont\normalsize\itshape}{\thesubsection}{1em}{}

\titlespacing*{\chapter}{0pt}{50pt}{20pt}

\newpagestyle{main}{%
  \headrule
  \sethead[\thepage][][\thechapter\quad\chaptertitle]{\thesection\quad\sectiontitle}{}{\thepage}
}
\pagestyle{main}

\begin{document}
  \Blinddocument
\end{document}
For a thesis you will need a sufficient hierarchy with chapters. Therefore the »report« class has been chosen and the headings have been formatted with the titlesec package. The same package provides the page style. More explanations would go beyond the scope of this post. So I recommend to read the manuals of the involved packages. These manuals can be found on CTAN or via command line on your local machine.

Code: Select all

texdoc ‹packagename›
As the above code is only a basic structure, you might need some more formatting. Feel free to ask further questions. As always, the blindtext package is only for creating dummy text thus not part of the solution. You also couls take a look at the wordlike package, but probably it does not the formatting you need.
metal_man wrote:[…] Also, there is a need to export document into Word format (.doc or. docx) or OpenOffice(.odt). I tried to write some chapters in Word but it's a painful work. I did some papers in LaTeX, but I didn't have change the whole style. So if somebody could help me I would be grateful.
I'm not aware of a direct conversion with satisfactory results. You can try LaTeX2RTF for conversion and then open it in LibreOffice (LO), OpenOffice.org (OOo) or W0rd.

[1] Obsolete packages and document classes — Avoid usage!


Best regards and welcome to the board
Thorsten
Post Reply