Texmaker and TeXstudiopage numbering when using includegraphicsfullpage

Information and discussion about Texmaker, an integrated LaTeX environment for several platforms, and the related TeXstudio
Post Reply
DirkT
Posts: 12
Joined: Tue Jul 08, 2014 11:00 am

page numbering when using includegraphicsfullpage

Post by DirkT »

I have a document with page numbering. When I insert graphics with includegraphicsfullpage, the page before such a graphic does not get a page number. The pages with a graphic get the right page number.
What can I do to get the page numbers on the pages before a graphic?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

page numbering when using includegraphicsfullpage

Post by Johannes_B »

Can you provide a minimal working example? What is includegraphicsfullpage, where is it defined?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
DirkT
Posts: 12
Joined: Tue Jul 08, 2014 11:00 am

page numbering when using includegraphicsfullpage

Post by DirkT »

I put in the directory of the .tex file a file fullpagegraphic.sty which looks as follows:

Code: Select all

\newcommand{\includegraphicsfullpage}[1]{%
  \newpage
  \bgroup
  \thispagestyle{empty}%
  \hoffset=-1in
  \voffset=-1in
  \topmargin=0pt
  \headheight=0pt
  \headsep=0pt
  \hsize=\paperwidth
  \@colht\paperheight
  \evensidemargin=0pt
  \oddsidemargin=0pt
  \parskip=0pt
  \parindent=0pt
  \hspace{6mm}\includegraphics[width=0.65\paperwidth,height=0.65\paperheight]{#1}
  \newpage
  \egroup}
The .tex file contains in the declaration part the line

Code: Select all

\usepackage{fullpagegraphic}
The numbering is defined by

Code: Select all

\pagenumbering{arabic}
The pictures are inserted with

Code: Select all

\begin{figure}
 \includegraphicsfullpage{picture.jpg}
\end{figure}
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

page numbering when using includegraphicsfullpage

Post by Johannes_B »

You are using a figure environment, where you clearly don't want one.

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\usepackage{blindtext}
\makeatletter
\newcommand{\includegraphicsfullpage}[1]{%
	\newpage
	\bgroup
	\thispagestyle{empty}%
	\hoffset=-1in
	\voffset=-1in
	\topmargin=0pt
	\headheight=0pt
	\headsep=0pt
	\hsize=\paperwidth
	\@colht\paperheight
	\evensidemargin=0pt
	\oddsidemargin=0pt
	\parskip=0pt
	\parindent=0pt
	\hspace{6mm}\includegraphics[width=0.65\paperwidth,height=0.65\paperheight]{#1}
	\newpage
\egroup}
\makeatother
\begin{document}
\blindtext
\includegraphicsfullpage{example-image-a}
\end{document}
May i ask the reason for using this code? It does really crazy stuff.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
DirkT
Posts: 12
Joined: Tue Jul 08, 2014 11:00 am

page numbering when using includegraphicsfullpage

Post by DirkT »

The figure environment is not the reason. I followed
http://stackoverflow.com/questions/1673 ... whole-page
and inserted in the declaration part the line

Code: Select all

\usepackage{floatpag}
and changed in the fullpagegraphic.sty file
the line

Code: Select all

\thispagestyle{empty}
to

Code: Select all

\floatpagestyle{empty}
Now, the page before the picture gets a page number - but the page with
the picture does not get a page number. How can I get a page numbering on the picture page?
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

page numbering when using includegraphicsfullpage

Post by Johannes_B »

Please post minimal working examples to avoid guesswork from my side.

I don't even know what you are trying to achieve.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
lockywolf
Posts: 6
Joined: Tue Aug 27, 2019 4:18 am

Re: page numbering when using includegraphicsfullpage

Post by lockywolf »

I have the same issue.

MWE:

Code: Select all

\documentclass[a4paper]{book}
\usepackage{graphicx}
\pagenumbering{roman}
\begin{document}
\pagenumbering{roman}
hello, world
\newpage
\includegraphics[height=0.5\paperheight,keepaspectratio]{page1.png} \newline
\includegraphics[height=0.5\paperheight,keepaspectratio]{page2.png} \newline
\end{document}
The page with "hello, world" is getting the page numbe "i", as expected, but the pages with page1.png and page2.png are all getting arabic numbers.
lockywolf
Posts: 6
Joined: Tue Aug 27, 2019 4:18 am

Re: page numbering when using includegraphicsfullpage

Post by lockywolf »

For those who find this thread after me.

Code: Select all

\newline
is not enough for switching enumeration. LaTeX adds the page automatically, but there is some confusion with counter.
Replacing

Code: Select all

 \newline 
with

Code: Select all

 \newpage 
works as expected.
Post Reply