LaTeX forum ⇒ LyXInclude pdf, page number without page header

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

Include pdf, page number without page header

Postby schroedingers_lion » Mon Jun 17, 2019 1:17 am

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!

rais
Posts: 220
Joined: Sun Nov 16, 2014 8:51 pm

Postby rais » Mon Jun 17, 2019 12:04 pm

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

Postby schroedingers_lion » Mon Jun 17, 2019 12:41 pm

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: 220
Joined: Sun Nov 16, 2014 8:51 pm

Postby rais » Mon Jun 17, 2019 1:20 pm

ah, there's no such redefinition after all.
Try
  1. pagecommand={\thispagestyle{plain}}

(notice the "this")

KR
Rainer


Return to “LyX”

Who is online

Users browsing this forum: No registered users and 0 guests