Text FormattingAppendix formating, problem with number and period

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
User avatar
Kaspars
Posts: 37
Joined: Mon Feb 14, 2011 11:51 am

Appendix formating, problem with number and period

Post by Kaspars »

Hello,

Here is my LaTeX code:

Code: Select all

\documentclass[12pt,a4paper,fleqn]{article}

\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{polyglossia}
\usepackage{appendix}
\setotherlanguages{english}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{titlesec,titletoc}

\begin{document}

\clearpage% or \cleardoublepage if you want TOC to be on the right page
\tableofcontents
\begin{abstract}
Abstract\ldots
\end{abstract}
\section{first section}
text
\section{second section}
TEXT
\subsection{Subsection}
TEXT

\section*{\large{APPENDIX}}
\addcontentsline{toc}{section}{APPENDIX}
\appendix
\renewcommand{\thesection}{\arabic{section}.}
\begin{flushright}
1.appendix
\end{flushright}
\section[Appendix. Appendix name]{Appendix name}
\end{document}
My problem is with appendix. Like you can see, in TOC everything is fine:

1.Appendix. Appendix name

Bur problem is with appendix page, like you can see there is:
__________________________________1.appendix
1. Appendix name

BUT, I want this name without number and period, so it would look like this:
__________________________________1.appendix
Appendix name

Thanks for help :)
Last edited by Kaspars on Mon May 30, 2011 9:55 am, edited 3 times in total.

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

5gon12eder
Posts: 126
Joined: Sun Feb 13, 2011 8:36 pm

Appendix formating, problem with number and period

Post by 5gon12eder »

You shouldn't mess around with writing "1. appendix" or similar from hand. That's against LaTeX' philosophy. Have a look at the titlesec package. It allows you to format sections as you wanted it.

Best
I'm using pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).
User avatar
Kaspars
Posts: 37
Joined: Mon Feb 14, 2011 11:51 am

Re: Appendix formating, problem with number and period

Post by Kaspars »

I don't know how to format it. Maybe someone can write me latex code for that? :)

Thanks
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: Appendix formating, problem with number and period

Post by Stefan Kottwitz »

Hi Kaspars,

the titlesec documentation tells how to format it. There's a very useful appendix to this documentation, which shows how standard headings can be formatted using titlesec, which is a good start. Just follow the link 5gon12eder has provided, to find the documentation.

Stefan
LaTeX.org admin
User avatar
Kaspars
Posts: 37
Joined: Mon Feb 14, 2011 11:51 am

Re: Appendix formating, problem with number and period

Post by Kaspars »

For now I haven't time to read, maybe some one, who know how to do that, can tell me, please? :)

I read, a little, but exact example like I need weren't there. I just need to take off numer before appendix name.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Appendix formating, problem with number and period

Post by Stefan Kottwitz »

Just use the starred version to get an unnumbered heading:

Code: Select all

\section*{Appendix name}
If required, use \addcontentsline to get a TOC entry for it.

Stefan
LaTeX.org admin
User avatar
Kaspars
Posts: 37
Joined: Mon Feb 14, 2011 11:51 am

Appendix formating, problem with number and period

Post by Kaspars »

Stefan_K wrote:Just use the starred version to get an unnumbered heading:

Code: Select all

\section*{Appendix name}
If required, use \addcontentsline to get a TOC entry for it.

Stefan
Thanks Stefan for answer.

It works, but there is problem in TOC, I want that the section looks like this:

Code: Select all

\section[Appendix. AS electrical circuit]{AS electrical circuit}
So in TOC, I could see:
1. Appendix. AS electrical circuit

But in document I could see:

AS electrical circuit

Thanks for help :)
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Appendix formating, problem with number and period

Post by Stefan Kottwitz »

Where's the problem?

Code: Select all

\section*{AS electrical circuit}
\addcontentsline{toc}{section}{1. Appendix. AS electrical circuit}
Stefan
LaTeX.org admin
User avatar
Kaspars
Posts: 37
Joined: Mon Feb 14, 2011 11:51 am

Appendix formating, problem with number and period

Post by Kaspars »

Stefan_K wrote:Where's the problem?

Code: Select all

\section*{AS electrical circuit}
\addcontentsline{toc}{section}{1. Appendix. AS electrical circuit}
Stefan
It works, thanks :) :) :)
User avatar
Kaspars
Posts: 37
Joined: Mon Feb 14, 2011 11:51 am

Appendix formating, problem with number and period

Post by Kaspars »

Oh no, it works in appendix and in TOC, but it won't work at text. When I add label, it looks like this:

Code: Select all

\section*{AS electrical circuit}
\addcontentsline{toc}{section}{1. Appendix. AS electrical circuit}
\label{AS}
Then, in text I see something like this:

AS electrical circuit (4.8. Appendix) is a circuit for....

But I want, that it look like this:

AS electrical circuit (1. Appendix) is a circuit for....

why it is so? and What I must do to fix it?

Thanks for help :)
Post Reply