LyXInclude pdf, page number without page header

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
schroedingers_lion
Posts: 8
Joined: Sun May 19, 2019 5:31 pm

Include pdf, page number without page header

Post by schroedingers_lion »

Good evening,

can anyone tell me how to insert page numbers on my included pdf document without the page headers?
I am in document class KOMA-script Book. On every page, I have a header that consists of a horizontal line with the name of the current chapter. However, in my included pdf, this runs right through the first text line.

In the dialog for including pdfs, I have chosen the options "pages=-" which gives me only the pdf, without header or number.
If I also add "pagecommand={\pagestyle{plain}}" or "pagecommand={\pagestyle{empty}}" I do get numbers, but also with a header. Shouldn't "plain" do what I want? Is this a Lyx bug?


Best regards!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Include pdf, page number without page header

Post by rais »

doubtful, but then, I don't use Lyx.
From your description you've already changed the standard behavior of scrbook (pages starting a chapter don't usually contain a header, and you claim to have it on all pages).
And by the sound of it you've redefined plain, even empty page style.

To see how, please export your LyX file to LaTeX, then you can post the resulting .tex file here.

KR
Rainer
schroedingers_lion
Posts: 8
Joined: Sun May 19, 2019 5:31 pm

Include pdf, page number without page header

Post by schroedingers_lion »

Hi, thank you for the response.

So I do not have the header at chapter-pages - sorry for being inaccurate.
Since it is a large document and the content is not meant for the public, I would have to delete all the content passages in the .tex document.

Maybe the preamble is enough? In the document itself, there does not seem to be any adjustment of pagestyles or documentclasses.

%% LyX 2.3.0 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[oneside,british]{scrbook}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[latin9]{luainputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{color}
\usepackage{float}
\usepackage{textcomp}
\usepackage{mathtools}
\usepackage{url}
\usepackage{pdfpages}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\newcommand{\noun}[1]{\textsc{#1}}
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}
%% A simple dot to overcome graphicx limitations
\newcommand{\lyxdot}{.}

\floatstyle{ruled}
\newfloat{algorithm}{tbp}{loa}[chapter]
\providecommand{\algorithmname}{Algorithm}
\floatname{algorithm}{\protect\algorithmname}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\usepackage{sidecap} % added by sidecap.module
\let\SCfigurename\figurename

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage[inner=3.5cm,outer=2.5cm,top=2.5cm,bottom=2.5cm]{geometry}
\usepackage{scrpage2}
\usepackage{mathtools}
\usepackage{tocbibind}
\usepackage[arrowdel]{physics}
\usepackage{algorithm,algpseudocode}
\usepackage{bm}
\pagestyle{scrheadings}
\clearscrheadfoot
\ohead{\headmark}
\setheadsepline{0.5pt}
\renewcommand*\arraystretch{1.5}
\ofoot[\pagemark]{\pagemark}

\makeatletter\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else \hbox{} \thispagestyle{plain} \newpage \if@twocolumn\hbox{}\newpage\fi\fi\fi}\makeatother \clearpage{\pagestyle{plain}\cleardoublepage}

\makeatother

\usepackage{babel}
\begin{document}
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Include pdf, page number without page header

Post by rais »

ah, there's no such redefinition after all.
Try

Code: Select all

pagecommand={\thispagestyle{plain}}
(notice the "this")

KR
Rainer
Post Reply