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.

I am using pdfpages package and I have a 3 page document of pdf I want to insert into my main document. But the problem is I can't get the subsection heading to show on the top of the page before the pdf file is inserted ONLY ONCE. I used pagecommand but what that does is for everypage it writes out the subsection at the top. Here is the code im using Here is the code I am using

\usepackage{pdfpages}
...
\includepdf[pages=-,pagecommand=\subsection{List of use cases}]{SE2.pdf}

What am i doing wrong?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

You could use a command that inserts a section head then redefines itself to do nothing:

\def\mysect{%
\subsection{List of use cases}%
\gdef\mysect{}}


\includepdf[pages=-,pagecommand=\mysect]{SE2.pdf}
share|improve this answer
add comment

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.