Graphics, Figures & TablesTurning off Page Numbering for a large Algorithm

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
sw3quant
Posts: 76
Joined: Tue Nov 02, 2010 11:40 pm

Turning off Page Numbering for a large Algorithm

Post by sw3quant »

This post is very closely related to this earlier post by me.

I have a large algorithm, takes up all of one page of A4. I want to turn the page numbering off, however, when I do so, as LaTeX moves the algorithm to a new page (as it's so large) the page with the numbering turned off is then the wrong page. I have already shrunk the font as much as possible.

Code: Select all

\documentclass[final,authoryear,3p,times,twocolumn]{elsarticle}

\begin{document}

\begin{algorithm*}
%\algsetup{linenosize=\tiny}
\scriptsize 
\scalebox{0.87}{
\thispagestyle{empty}
    \caption{My Algorithm }}
    \begin{algorithmic}[1]
	\STATE \COMMENT{Many many of these statements}
    \end{algorithmic}    }
\end{algorithm*}
\normalsize

\end{document}
I would like to try and use \scalebox, but don't seem able to. Does anyone know if the algorithm package supports \scalebox?

My MWE (which doesn't work) is below.

thank you.
Last edited by sw3quant on Tue Feb 05, 2013 9:11 pm, edited 1 time in total.

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

svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Turning off Page Numbering for a large Algorithm

Post by svend_tveskaeg »

sw3quant wrote:My MWE (which doesnt work) is below.
This is far from a MWE; most of the loaded packages are superfluous.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Turning off Page Numbering for a large Algorithm

Post by cgnieder »

Can you make the example into one that actually compiles? Currently it gives me

Code: Select all

!LaTeX Error: Environment algorithm* undefined.
and also has unbalanced braces and other undefined commands.

Here is an example that works (watch the page numbers):

Code: Select all

\documentclass{article}

\begin{document}

first page

\newpage

second page
\begin{table}
  \thispagestyle{empty}
  \caption{My Algorithm }
\end{table}

\newpage

third page

\end{document}
Regards
site moderator & package author
sw3quant
Posts: 76
Joined: Tue Nov 02, 2010 11:40 pm

Turning off Page Numbering for a large Algorithm

Post by sw3quant »

this replicates the problem. You see in the PDF the page numbering is turned off on page 2 and the algo is shown on page 3.

Code: Select all

\documentclass[final,authoryear,3p,times,twocolumn]{elsarticle}
\usepackage{nicefrac}
\usepackage{mathdots}
\usepackage{amsfonts}
\usepackage{bm}
\usepackage{mathtools}
\usepackage{amsmath,amssymb}
\usepackage{amsfonts}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{float}
\usepackage{xspace}
\usepackage{verbatim}
\usepackage[T1]{fontenc}
\usepackage{prettyref}
\usepackage{url}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{array}
\usepackage{pifont}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{capt-of}
\usepackage{enumitem}
\usepackage{rotating}
\usepackage{color}
\usepackage{array}
\usepackage{longtable}
\usepackage{calc}
\usepackage{multirow}
\usepackage{hhline}
\usepackage{ifthen}
\usepackage{lscape}
\usepackage{cite}
\usepackage{lettrine}
\usepackage[active]{srcltx}
\usepackage{xparse}
\usepackage{hyperref} 
\begin{document}

Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements
Many many of these statements


\begin{algorithm*}
\caption{Here is my algo} 
\thispagestyle{empty}
    \begin{algorithmic}[1]
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
\STATE \COMMENT{Many many of these statements}
    \end{algorithmic}
\end{algorithm*}



\clearpage

third page

\end{document}

User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Turning off Page Numbering for a large Algorithm

Post by Stefan Kottwitz »

You could write a \clearpage before the algorithm, so the page 2 would not be affected by the empty page style.

Btw. please don't load such a lot of unrelated packages when showing a code example, this makes helping unnecessarily hard. I had installation issues with this code!
And using lipsum or blindtext would be better than copying and pasting a hundred text lines, which again makes it harder.

Stefan
LaTeX.org admin
sw3quant
Posts: 76
Joined: Tue Nov 02, 2010 11:40 pm

Re: Turning off Page Numbering for a large Algorithm

Post by sw3quant »

Im my limited experince sometimes packages interact, and as I dont know which ones do and don't I included them all in my second example.

I dont know what lipsum is but will read up about it.

I dont know what could hard about reading "Many many of these statements".

Putting \clearpage before the algorithm does not work. It just causes the algorithm to be pushed forward by a few pages. This was the first thing I tried in fact.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Turning off Page Numbering for a large Algorithm

Post by Stefan Kottwitz »

The comments were just meant constructively, not badly. ;)

I can explain:
sw3quant wrote:Im my limited experince sometimes packages interact, and as I dont know which ones do and don't I included them all in my second example.
Take a few minutes and try what happens if you remove some packages. Just test. If the problem persists, great, the example gets smaller. If it would go away, you would have found a possible cause - this package - or keep it included. Step by step you would get a clean short example, such as Clemens posted above.

You expect other users to spend time at the problem? Invest some minutes to make it easier for them.
sw3quant wrote:I dont know what lipsum is but will read up about it.
It's for producing large amounts of text for testing. The same reason: to keep test examples short.
sw3quant wrote:I dont know what could hard about reading "Many many of these statements".
Scrolling a lot down and up and down when reading? Copying & pasting much? It looks boring? If helping isn't kind of pleasant, people might not do it much.
sw3quant wrote:Putting \clearpage before the algorithm does not work. It just causes the algorithm to be pushed forward by a few pages.
It worked for me. I just don't repost 370 lines to prove that. ;-) I inserted it before the algorithm, and the algorithm began at the third page.

Stefan
LaTeX.org admin
Post Reply