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.

How can create appendices "numbered" A, B, C within three different sections of a Lyx article document. In other words, I would like Appendix A to be at the the end of my first section, Appendix B to be at the end of my second Section, etc. I tried to use the Document ------> Start Appendix Here, but then I can't continue with the sections.

share|improve this question
    
You should used an unnumbered section if you want that (\section*{Appendix A}). No more numerated stuff is expected after \appendix –  Mario S. E. May 6 '13 at 20:05
    
Oh, and Welcome to TeX.sx! :) –  Mario S. E. May 6 '13 at 20:06
2  
Usually, appendices are common \chapters placed after the \appendix command in your input file, and you can't have a chapter inside a section. You have to respect the hierarchy of sectioning commands. Mario S. E.'s advice is sound, but perhaps you want to use \subsection*{Appendix A} if the "appendix" in question must be inside a section. –  Jubobs May 6 '13 at 20:06
    
Silly question, not very Lyx versed... would that make them not appear in the ToC? I think I need them to appear... –  CMM May 6 '13 at 20:13
1  
You can use \subsection*{Appendix A} \addcontentsline{toc}{subsection}{Appendix A}. The second command will add the unnumbered subsection in your ToC. You should get familiar with the sectioning commands. Follow the link in my ealier comment. –  Jubobs May 6 '13 at 20:15

1 Answer 1

Usually, appendices are common \chapters placed after the \appendix command in your input file, and you can't have a chapter inside a section; you have to respect the hierarchy of sectioning commands. Follow this link to get more familiar with the sectioning commands.

In order to get headings such as "Appendix A", "Appendix B", etc. within a section, you could use the next level of depth of sectioning commands, i.e. subsections. Use the starred version to get an unnumbered subsection:

\subsection*{Appendix A}

However, in most classes--notable exceptions include amsart; see Ryan Reich's comment below--this will not produce any entry in your ToC, even if you have set the depth of your ToC to subsection level, using \setcounter{tocdepth}{2} (or higher). You must add the entry for that unnumbered subsection "manually", using

\addcontentsline{toc}{subsection}{Appendix A}

In summary:

\documentclass{article}

\usepackage{lipsum}     % dummy text
\setcounter{tocdepth}{2}

\begin{document}

\tableofcontents

\section{Foo}

\lipsum[1]

\subsection*{Appendix A}
\addcontentsline{toc}{subsection}{Appendix A}
\lipsum[2]

\subsection*{Appendix B}
\addcontentsline{toc}{subsection}{Appendix B}
\lipsum[3]

\end{document}

enter image description here

share|improve this answer
    
Cool. Let’s if it will be closed anyhow. –  Speravir May 6 '13 at 21:19
    
@Speravir Having appendices in a section seems outlandish but, who knows? Maybe my answer will help others... –  Jubobs May 6 '13 at 21:21
    
Yes, I think the same. –  Speravir May 6 '13 at 21:22
    
Note that some classes do include unnumbered \subsection*'s, most notably (to me) the amsart class. For that one you should not use \addcontentsline; to remove an unwanted one, see barbara beeton's answer. –  Ryan Reich May 6 '13 at 22:16
    
@RyanReich Thanks I didn't know. I've never used such classes. I'll edit my answer. –  Jubobs May 6 '13 at 22:18

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.