1

I'm trying to place a boxed text at the end of the page, but \vfill sends my box out of the page. There is another command that can do the same but in the way I need it?

This is my code:

\documentclass[12pt,letterpaper]{article}
\usepackage{background}
\usepackage{framed}
\usepackage[latin1]{inputenc}
\usepackage[spanish]{babel}
\usepackage[total={19.5cm,26.5cm},left=0.7cm,top=3cm]{geometry}

\SetBgScale{1.05}
\SetBgAngle{0}
\SetBgContents{\includegraphics{image/bg.eps}}

\begin{document}

\font\grande=cmr10 at 30pt\vphantom{\grande M} %Places text below the top gray line

Random text.
\begin{framed}
Boxed text.
\end{framed}
\end{document}

The image places a 15mm box on the bottom edge as the image shows. enter image description here

2
  • Your image shows something different than what is written in your text. And \vfil does throw the text at the end of page, this is feature of this primitive. I'm wondering why you are wonder.
    – wipet
    Jun 6, 2014 at 19:09
  • I generate the image with this code. That's my problem, because using \vfill the boxed text show only the top line of the box.
    – hkviktor
    Jun 6, 2014 at 20:31

2 Answers 2

1

The question was later edited to so the example showed the problem.

The geometry settings that you have specified result in a negative bottom margin and the warning

Package geometry Warning: `bmargin' results in NEGATIVE (-44.38629pt).
    `height' or `tmargin' should be shortened in length.

so when you use \vfill or just add enough text to fill a page, it will go 44pt off the bottom of the page.

A setting of for example

\usepackage[paperwidth=19.5cm,paperheight=26.5cm,left=0.7cm,top=3cm]{geometry}

avoids the warning and keeps the boxed text on the page, even if preceded by \fill


Original answer

enter image description here

\documentclass[12pt,letterpaper]{article}
\usepackage{framed}
\usepackage[latin1]{inputenc}
\usepackage[spanish]{babel}
\begin{document}
Random text.

\vfill

\begin{framed}
Boxed text.
\end{framed}
\end{document}
3
  • The problem is when I use a background as the code I wrrote here. The boxed text flies away from the bottom if \vfill is placed. \documentclass[12pt,letterpaper]{article} \usepackage{background} \usepackage{framed} \usepackage[latin1]{inputenc} \usepackage[spanish]{babel} \usepackage[total={19.5cm,26.5cm},left=0.7cm,top=3cm]{geometry} \SetBgScale{1.05} \SetBgAngle{0} \SetBgContents{\includegraphics{image/bg.eps}} \begin{document} \font\grande=cmr10 at 30pt\vphantom{\grande M} % Line to place text below the gray line Random text. \begin{framed} Boxed text. \end{framed} \end{document}
    – hkviktor
    Jun 6, 2014 at 15:36
  • @hkviktor it would have helped if the example in the question had been an example of the problem you are asking about (you can still edit your question) preferably an example that does not need an image (you can use \usepackage[demo]{graphicx} so `\includegraphics just makes a rectangle Jun 6, 2014 at 15:41
  • @hkviktor seems strange action of background package, no time now but I'll delete this answer which may encourage others to look at your problem Jun 6, 2014 at 16:30
0

As far as the message "Warning: `bmargin' results in NEGATIVE (-n)" is concerned, I solve it by reducing the height. E.g.

\geometry{a4paper, total={200mm,280mm}, left=1cm, top=1cm}

280 is the max accepted height in my case. It will most probably be different in your case.

4
  • The accepted answer says pretty much exactly the same thing with more information.
    – user30471
    Dec 7, 2017 at 11:04
  • Which is the accepted answer? And where is total={width,height} mentioned? Actually, I don't care so much and you shouldn't care so much either. Let's relax a bit ...
    – Alkis
    Dec 11, 2017 at 18:30
  • Sorry, I didn't mean to offend or criticize. I was just saying that setting total={width, height} is the same as setting paperheight and paperwidth, up to some scale factor.
    – user30471
    Dec 11, 2017 at 18:50
  • OK. No offense taken. And no problem.
    – Alkis
    Dec 13, 2017 at 11:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .