there seems to be no way to put a full-width float at the top of the first page; various mechanisms are used to prevent it, and i haven't found a workaround. (this is most likely also true for the first page of a new chapter in a book or report. maybe frank mittelbach or david carlisle knows a way to do it.)
however, the question states that
At some point, the text ends in the beginning of the first column of a
new page.
if it is acceptable to place the float on some page after the first, this is possible, by moving the input for the figure far enough earlier that it is read in (and then delayed) before the page is finished that will be the page preceding the one on which the figure is wanted.
the following example will do this. it's ugly, but it works; it's used in tugboat all the time. (tugboat almost never has the requirement to put such a float at the top of the first page, and if there is such a requirement, we revert to plain tex.) i've added a [t]
to request that the float be positioned at the top; it's probably redundant, but it does have the desired effect with some document classes (amsart
for one, but apparently not article
) if the float ends up as the only thing on the page.
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\twocolumn
\paragraph{}
\lipsum[1-4]
%% this table should appear *before* the paragraph indicated below.
%% it is placed here in the input to force its position at the top of the next page.
\begin{table*}[t]
\centering
\begin{tabular}{|c|c|c|c|}
\hline
Column 1 & Column 2 & Column 3 & Column 4 \\
\hline
Column 1 & Column 2 & Column 3 & Column 4 \\
\hline
\end{tabular}
\end{table*}
\lipsum[5-6]
%% the table coded above should appear at the top of the page on which
%% this paragraph appears.
\paragraph{I want the figure above this text}
\lipsum[1]
\end{document}
EDIT:
the example below will place the figure at the bottom of the page, across both columns, at the cost of an overfull box message. (i'm trying to figure out how to get rid of that, but haven't yet succeeded.)
the approach is to launch a single-column float somewhere in the first column, above where it will start. in the single-column float is embedded a minipage
that is the full page width. after the first run, determine by how much the column was shortened, and, somewhere in the second column, issue a negative \enlargethispage
command that will leave the bottom part of the page blank, allowing the full-width figure to overflow into the empty area.
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\twocolumn
%% avoid overfull boxes from the lipsum test.
\sloppy
\paragraph{}
\lipsum[1]
%% this table should appear at the bottom of the page.
%% it must be placed in the input somewhere near the top of the
%% first column so that it will actually appear in the first column.
\begin{table}[b]
\begin{minipage}{\textwidth}
\centering
\begin{tabular}{|c|c|c|c|}
\hline
Column 1 & Column 2 & Column 3 & Column 4 \\
\hline
Column 1 & Column 2 & Column 3 & Column 4 \\
\hline
\end{tabular}
\end{minipage}
\end{table}
%% the table coded above should appear at the bottom of the page on which
%% this paragraph appears.
\textbf{I want the figure at the bottom of the page}
\lipsum[1]
\lipsum[2]
%% somewhere in the second column, reduce the page (column) length
%% by the amount needed to clear the figure.
\enlargethispage{-4\baselineskip}
\lipsum[3-6]
\end{document}
yes, it's ugly. don't say you weren't warned.
additional caveat -- the vertical spacing can be fouled up by section headings that have stretch built in. that makes this an iterative process. try to avoid applying this approach until your text is final, and even then, it might be wise to try to "fix" a page break at the top of the page on which the table is to appear.
EDIT 2:
the kludge described here became a tugboat article, "placing a full-width
insert at the bottom of two columns", tugboat 35:3 (2014), p.255.
(like all tugboat articles in electronic form, this article has a one-year
"embargo" during which it is available only to tug members; it will become
available to everyone sometime in late fall, 2015.)
one important point mentioned in the article is that the stfloats
package,
mentioned in Put a table* at the bottom of a page?
works only for pages after the first page.
Adding vertical skips will only make a difference if you can enter a paragraph break, which isn't permitted here. However, if you use a \parbox
, you can determine a height greater than that of the text.
Droppint the \makebox
and just using \dotfill
avoids the need to specify the width.
Note that \bf
and friends ought not be used in any LaTeX code written in the last couple of decades, since the release of 2e rendered those commands obsolete for this format.
\documentclass[11pt,paper=a4,answers, addpoints]{exam}
\usepackage{graphicx,lastpage}
\usepackage{upgreek}
\usepackage{censor}
\censorruledepth=-.2ex
\censorruleheight=.1ex
\hyphenpenalty 10000
\usepackage[paperheight=10.5in,paperwidth=8.27in,bindingoffset=0in,left=0.8in,right=1in, top=0.7in,bottom=1in,headsep=.5\baselineskip]{geometry}
\flushbottom
\usepackage[normalem]{ulem}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\renewcommand\ULthickness{2pt} %%---> For changing thickness of underline
\setlength\ULdepth{1.5ex}%\maxdimen ---> For changing depth of underline
\renewcommand{\baselinestretch}{1}
\pagestyle{empty}
\pagestyle{headandfoot}
\headrule
\newcommand{\continuedmessage}{%
\ifcontinuation{\footnotesize Question \ContinuedQuestion\ continues\ldots}{}%
}
\runningheader{\footnotesize Dipartimento of Economics}
{\footnotesize Name of the course -- Code}
{\footnotesize Page \thepage\ of \numpages}
\footrule
\footer{\footnotesize Student's name:}
{}
{\ifincomplete{\footnotesize Question \IncompleteQuestion\ continues on the next page\ldots}
{\iflastpage{\footnotesize End of exam}{\footnotesize Please go on to the next page\ldots}}}
\usepackage{cleveref}
\crefname{figure}{figure}{figures}
\crefname{question}{question}{questions}
\renewcommand\thequestion{\arabic{question}}
\renewcommand{\questionlabel}{\thequestion)}
\renewcommand{\questionshook}{%
\setlength{\leftmargin}{0pt}%
\setlength{\labelwidth}{-\labelsep}%
}
\nopointsinmargin
\pointpoints{Punto}{Punti}
\marginpointname{\points}
\pointformat{\boldmath\themarginpoints}
\bracketedpoints
\begin{document}
\thispagestyle{empty}
\noindent
\begin{minipage}[t]{\textwidth}%
\centering
\includegraphics[width=1.5cm]{tiger} \par
\textit{\textbf{University of XXXX}}\par
\textit{\textbf{Dipartiment of XXXX}} \par
\textit{\textbf{Summer Session}}
\end{minipage}
\par
\bigskip\bigskip
\begin{minipage}[t]{.5\textwidth}%
{\bfseries Corso di Studio}: Whatever\par
\vspace{1ex}
{\bfseries BA course code}: LM77\par
\vspace{1ex}
{\bfseries Subject}: Name of the course\par
\vspace{1ex}
{\bfseries Data}: 23 Maggio 2016 \par
\vspace{1ex}
{\bfseries Docente}: My Name
\end{minipage}%
\hfill
\begin{minipage}[t]{.4\textwidth}%
{\bfseries Nome}: \makebox[.4\textwidth]{\hrulefill} \par
\vspace{1ex}
{\bfseries Matricola}: \makebox[.4\textwidth]{\hrulefill} \par
\vspace{1ex}
{\bfseries Documento}: \makebox[.4\textwidth]{\hrulefill} \par
\vspace{1ex}
{\bfseries Durata}: 1.5 h + 10 minuti di lettura\par
\vspace{1ex}
{\bfseries Firma}:\makebox[.4\textwidth]{\hrulefill}
\end{minipage}
\par
\bigskip
\begin{center}
\rule{\textwidth}{1pt}
\end{center}
\bigskip
\qformat{%
\parbox[t][3.5ex]{\linewidth}{%
\textbf{Domanda \thequestion:} \thequestiontitle \dotfill
\emph{\totalpoints~punti}
}%
}
\begin{questions}
\titledquestion{\textit{\textbf{Istituzioni e crescita economica}}}
For a surface $\vec{r}= \vec{r} (u \cos v, u \sin v, f(u))$. Write down the first fundamental form of the surface. Show that the parametric curves are orthogonal.
\begin{parts}
\part[10]
Explain what happens
\part[10]
Say if you agree
\end{parts}
\end{questions}
\begin{center}
\rule{\textwidth}{1pt}
\end{center}
\end{document}
EDIT
Responding to the follow-up in comments, do you want something like this?
If so, again, don't set the width of the \hrulefill
but just let it fill the space available.
\begin{minipage}[t]{.4\textwidth}%
{\bfseries Nome}: \hrulefill \par
\vspace{1ex}
{\bfseries Matricola}: \hrulefill \par
\vspace{1ex}
{\bfseries Documento}: \hrulefill \par
\vspace{1ex}
{\bfseries Durata}: 1.5 h + 10 minuti di lettura\par
\vspace{1ex}
{\bfseries Firma}: \hrulefill
\end{minipage}
Best Answer
This is MWV, you can improve it
To include this on every page use the
everypage
package