Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Here is my situation:

Source code

in preamble:

\usepackage[title,titletoc]{appendix}
\renewcommand{\appendixname}{priedas}

in document:

\begin{appendices}

  \section{Tekstai}
  Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt, ut labore et dolore magnam aliquam quaerat voluptatem.

\end{appendices}

Output document

in toc:

priedas A  Tekstai ......................... 20

in document:

priedas A  Tekstai

Wanted output document

in toc:

A priedas  Tekstai ......................... 20

in document:

A priedas  Tekstai
share|improve this question
2  
Please add to your question a minimal working example reproducing the behaviour mentioned. –  Gonzalo Medina Jun 15 '11 at 21:20
add comment

1 Answer 1

up vote 2 down vote accepted

If you are using the article document class, then you can achieve the desired result with the help of the titlesec and titletoc packages; a little example:

\documentclass{article}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage[title,titletoc]{appendix}
\renewcommand{\appendixname}{priedas}

\begin{document}
\tableofcontents

\section{Test regular section}

\begin{appendices}
\titlecontents{section}
  [1.7em]{}{\contentslabel{1.7em}\appendixname\ }{\hspace*{-1.7em}}
  {\titlerule*[1pc]{}\contentspage}
\titleformat{\section}
  {\normalfont\Large\bfseries}{\thesection\ \appendixname}{1em}{}

  \section{Tekstai}
  Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt, ut labore et dolore magnam aliquam quaerat voluptatem.

\end{appendices}

\end{document}

With minor modifications, this will also work with the scrartcl document class. However, this approach will fail with amsart.

share|improve this answer
    
Good answer. By the way, for my case I altered: for the toc leader dots - titlerule to "...\titlerule*[1.5mm]{.}..."; for a nicer spacing - titlecontents to "...titlecontents{section} [0em]{}{\thecontentslabel\ ...". Also, my documentclass is "article". I thank you again! –  user3038 Jun 16 '11 at 11:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.