Can anybody help me out?
See documentation page 3:
pagecommand Declares LaTeX commands, which are executed on each sheet
of paper. (Default: pagecommand= \thispagestyle{empty})
--
Ulrike Fischer
Thank you. But how can I add a chapter title that is just below the
top of the page? I can't seem to change the place in which the title
is put. I want a chapter title place on top of my inserted PDFpage.
Please help me
>>> I would like to add a header to my PDF page in a LaTex document. I use
>>> the package pdfpages which works, fine, except, it doesn't put the
>>> title of the section on top of the PDF. It just puts the inserted PDF
>>> on a blank page. I've checked the PDFpages reference manual, but that
>>> doesn't give me a solution.
>>
>>> Can anybody help me out?
>>
>> See documentation page 3:
>>
>> pagecommand Declares LaTeX commands, which are executed on each sheet
>> of paper. (Default: pagecommand= \thispagestyle{empty})
>>
>> --
>> Ulrike Fischer
>
> Thank you. But how can I add a chapter title that is just below the
> top of the page? I can't seem to change the place in which the title
> is put. I want a chapter title place on top of my inserted PDFpage.
You mean a real \chapter command? You shouldn't move this around. It
will look silly if the title is at another place than in normal
chapters. I also doubt a bit that you should use includepdf. Why don't
you include the pdf page with includegraphics under a normal \chapter?
--
Ulrike Fischer
Because the PDF is really large. Actually, it is on A3 format. I want
to add "Appendix A: Awesome model" to the picture and add it to the
TOC.
Thank you for your help so far, very much appreciated!
>> Why don't you include the pdf page with includegraphics under a
>> normal \chapter?
> Because the PDF is really large. Actually, it is on A3 format. I want
> to add "Appendix A: Awesome model" to the picture and add it to the
> TOC.
> Thank you for your help so far, very much appreciated!
You could use something like this. (How you can move a chapter up
depends on the class):
\documentclass[a4paper]{scrbook}
\usepackage{eso-pic,graphicx}
\begin{document}
\tableofcontents
\chapter{A}
\appendix
\renewcommand*{\chapterheadstartvskip}{%
\vspace*{0cm}%
}%
\chapter{Awesome model}
\AddToShipoutPicture*{\AtPageLowerLeft{\includegraphics[width=\paperwidth]{test2}}}
\end{document}
--
Ulrike Fischer
Hmm. I have tried your like this:
\newpage\null\newpage
\includepdf [offset= 0 -30, pagecommand={%
\renewcommand*{\chapterheadstartvskip}{\vspace*{0cm}}
\chapter{Awesome model}\label{cha:Results-Input/output-data}
}] {D:/awesomemodel.pdf}
But the chapter does not go up in this way.
Another way that I've tried is by:
\newpage\null\newpage
\includepdf [offset= 0 -30, pagecommand={
\thispagestyle{fancy}
\fancyhead[L]{Appendix D: Variables similarity}
\addcontentsline{toc}{chapter}{Variables similarity}
}] {D:/awesomemodel.pdf}
But, in this way, the heading is correct (since it is put high enough
on the paper), but in the TOC only "Variables similarity" appears
instead of "A. Variables similarity".
I've spent so much time on this problem now, that I'm satisfied with
just 1 working solution. The first one has my first choice, however ;)
Thank you again for your help!
Anybody? Please?
> Anybody? Please?
What? My solution worked. If it doesn't work for you you will have to
make a complete example that demonstrates the problem.
--
Ulrike Fischer
I have tried your solutions, Ulrike, but I can't get it to work. I'm
using Lyx as the text editor. I know how to insert Tex Code, and I'm
using the book (KOMA-script) class.
When I put \renewcommand*{\chapterheadstartvskip}{\vspace*{0cm}}
right before the \chapter statement, the chapter title doesn't move in
the output file.
The other option I've been trying is to use the fancyheading (which
works fine, except \addcontentsline{toc}{chapter}{Nice chapter}
doesn't add a chapter number into the TOC. Instead, it just puts "Nice
chapter" in the TOC, while other chapther appear such as "3. Another
nice chapter".
I hope my explanation is understable, you are really helping me
forward!
>>> Anybody? Please?
>>
>> What? My solution worked. If it doesn't work for you you will have to
>> make a complete example that demonstrates the problem.
> I have tried your solutions, Ulrike, but I can't get it to work. I'm
> using Lyx as the text editor. I know how to insert Tex Code, and I'm
> using the book (KOMA-script) class.
> When I put \renewcommand*{\chapterheadstartvskip}{\vspace*{0cm}}
> right before the \chapter statement, the chapter title doesn't move in
> the output file.
No idea about this. I don't use Lyx. It works for me in the example. Try
my example and look if it moves the \chapter title. If not you have
perhaps an older version of the class.
>
> The other option I've been trying is to use the fancyheading (which
Use fancyhdr
> works fine, except \addcontentsline{toc}{chapter}{Nice chapter}
> doesn't add a chapter number into the TOC.
\documentclass{scrbook}
\begin{document}
\tableofcontents
\chapter{A}
\refstepcounter{chapter}
\addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}Nice
chapter}
(I also want to understand what that line of code does: Am I correct
when I say that \numberline has the value of the pagenumber, so that
it can correctly be entered in the TOC)
However, the obvious side effect of this solution is that the headers
on the other following pages do not change appropriately. Since these
tricks are needed for use is the Appendices, the headers do not count
accordingly.
In other words: I now MANUALLY put \fancyhead[L]{Appendix C: AEM} on
the page. Since each appendix starts on the right page, the blank
pages' headers still remain numbered as "Appendix B".
How to solve this?
> Thanks again, Ulrike!
> I'm one big step further! Your wonderful line of code now makes it
> correctly appear in the TOC.
>
> (I also want to understand what that line of code does: Am I correct
> when I say that \numberline has the value of the pagenumber, so that
> it can correctly be entered in the TOC)
>
> However, the obvious side effect of this solution is that the headers
> on the other following pages do not change appropriately.
To change the headers you need a marking command. Probably
\chaptermark{A nice chapter} will work. (But as you still didn't provide
a complete example I can't be sure).
--
Ulrike Fischer
First, I didn't know how to extract all Tex code from Lyx, but here is
an example:
\makeatletter
\def\input@path{{D:/rujurgen/Documents/Capgemini/Afstuderen//}}
\makeatother
\documentclass[a4paper,english,chapterprefix,liststotoc]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{array}
\usepackage{longtable}
\usepackage{varioref}
\usepackage{float}
\usepackage{calc}
\usepackage{makeidx}
\makeindex
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{esint}
\usepackage[authoryear]{natbib}
\usepackage{nomencl}
% the following is useful when we have the old nomencl.sty package
\providecommand{\printnomenclature}{\printglossary}
\providecommand{\makenomenclature}{\makeglossary}
\makenomenclature
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Bold symbol macro for standard LaTeX users
\providecommand{\boldsymbol}[1]{\mbox{\boldmath $#1$}}
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage[bookmarks,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=2 ,colorlinks=false,citecolor=blue]
{hyperref}
\renewcommand{\nomname}{Glossary}
\usepackage{pdfpages}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{babel}
\makeatother
\begin{document}
\chapter*{Added value of Enterprise Architecture}
\appendix
\newpage\null\newpage
\refstepcounter{chapter}
\addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}AEM}
\includepdf [fitpaper=true, offset= 0 0, pagecommand={
\thispagestyle{fancy}
\fancyhead[L]{Appendix D: AEM}
}] {D:/document.pdf}
\chaptermark{AEM}
\newpage\null\newpage
\end{document}
I hope this clarifies it all for you, Ulrike. And, even better, if you
know a nicer solution, I'd love to hear! A big thanks!
> Yes, that worked indeed! However, the last thing I need to do is
> removing the page numbers! They appear right through the inserted
> PDF"s!
Then change it in the pagestyle fancy. \fancyfoot{} or something like
this.
>
> First, I didn't know how to extract all Tex code from Lyx, but here is
> an example:
It's an example, but not really a minimal one.
--
Ulrike Fischer