Text Formattingtitlestyle of chapter

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
allevo
Posts: 49
Joined: Sat Apr 11, 2009 12:09 pm

titlestyle of chapter

Post by allevo »

hello!!!
my problem is simple: i want change the style of the title of chapter
i want that the style is custom

how can I this?!?! how can i create a new style?!?!

I'm not inglese user.
I apologize for my English

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

titlestyle of chapter

Post by Stefan Kottwitz »

Hi Allevo,

welcome to the board!
The titlesec package would be useful for you, see its documentation.

Here's an complex example using titlesec and TikZ: Fancy chapter headings with TikZ. But try the documentation and examples of titlesec first, that packages provides many good features.

Stefan
LaTeX.org admin
allevo
Posts: 49
Joined: Sat Apr 11, 2009 12:09 pm

Re: titlestyle of chapter

Post by allevo »

for create new style of chapter'heading i use \titleformat. is correct?!?!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: titlestyle of chapter

Post by Stefan Kottwitz »

Yes, that's correct. At the end of the documentation there are examples how the standard chapter/section styles could be created, that would be a good start.

Stefan
LaTeX.org admin
allevo
Posts: 49
Joined: Sat Apr 11, 2009 12:09 pm

Re: titlestyle of chapter

Post by allevo »

thanks!!!!
but the format, what is it?!?!
in the shape i can write \large etc... but in format?!?! and sep?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

titlestyle of chapter

Post by Stefan Kottwitz »

That's described on page 3 and 4 of the documentation.

sep is a length, like 20pt. format contains formatting commands like \normalfont\huge\bfseries. shape ist a general option like hang, display or frame. The documentation contains more explanation and examples.

Stefan
LaTeX.org admin
allevo
Posts: 49
Joined: Sat Apr 11, 2009 12:09 pm

titlestyle of chapter

Post by allevo »

thank ;)

why this code create an error?!?!

Code: Select all

\titleformat{\chapter}{}
{frame}
this is the error:

Code: Select all

Runaway argument?
! Paragraph ended before \ttl@format@ii was complete.
<to be read again> 
                   \par 
l.40 
     
? ^C! Interruption.
l.40 
     
the line 40 is the line that follow "{frame}" and is empty
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

titlestyle of chapter

Post by Stefan Kottwitz »

\titleformat has more parameters, you have provided only 3 parameters. Here's a complete working example:

Code: Select all

\documentclass[a4paper,10pt]{book}
\usepackage{titlesec}
\titleformat{\chapter}[frame]{\normalfont\huge\bfseries}
{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\begin{document}
\chapter{This is just a test chapter}
\end{document}
Stefan
LaTeX.org admin
allevo
Posts: 49
Joined: Sat Apr 11, 2009 12:09 pm

Re: titlestyle of chapter

Post by allevo »

ops excuse me...
i didn't see [] ;)

and how can i put a image?!?! for example a rectangle
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

titlestyle of chapter

Post by Stefan Kottwitz »

allevo wrote: and how can i put a image?
Like at other places, you could use the command \includegraphics of the graphicx package. Or do you mean a symbol or a LaTeX-drawing instead of an external image?

Stefan
LaTeX.org admin
Post Reply