Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Absolute positioning of \hrule (and \vrule) in pdflatex

1,853 views
Skip to first unread message

KG

unread,
Aug 1, 2006, 6:28:38 AM8/1/06
to
Hi all,

I'm a newbie to TeX/LaTeX (read the The Not So Short Introduction to
LATEX2e few days back). I'm trying some small experiments as I learn
LaTeX

Currently what I'm trying to do is to make a small calender booklet
that in its final form will measure 2.5in X 3.5in (small enough to fit
in a wallet). There will be one page for each day to jot down
notes/appointments etc, so the book will have 30/31 + few blank pages.

I plan to do this booklet by printing rectangles (one for two days)
measuring 5in X 3.5in (size of an unfolded page in the booklet). These
rectangles will have the dates written on top of them. I want to print
these on an A4 sheet (11in X 8.5in in landscape mode), and so will fit
four such rectangles in each page. After doing all this, if I print the
A4 sheets back to back, I can then cut along the rectangles and bind my
booklet.

An illustration on what goes into one A4 sheet (view in a monospaced
font):

<------------ 10 in ------------------->
^----------------------------------------
||xx | xx |xx | xx |
|| | | | |
|| | | | |
| | | | |
7| | | | |
i----------------------------------------
n|xx | xx |xx | xx |
| | | | |
|| | | | |
|| | | | |
|| | | | |
v----------------------------------------

The "xx" will be replaced by the date for that sheet. Ofcourse, I need
to arrange the dates carefully for the final booklet to have these in
order.

I have searched this group to solve some issues I have faced and now
have:
a. The textpos package for positioning text precisely
b. The \setlength variables for changing margins, paragraph indents and
landscape printing

I'm still not able to solve one issue: being able to position the
\hrule and \vrule precisely. What I need is something like:

\hrule(x0, y0, length)
\vrule(x0, y0, length)
where (x0, y0) are the co-ordinates of the "start" of the line

If I try (after zeroing all margins)
\hskip 0.5in
\hrule width 10in height 1pt
\vrule width 1pt height 3.5in
\hskip 2.5in
\vrule width 1pt height 3.5in
\hskip 2.5in
\vrule width 1pt height 3.5in
\hskip 2.5in
\vrule width 1pt height 3.5in
\hskip 2.5in
\vrule width 1pt height 3.5in
\vskip 3.5in
\hrule width 10in height 0pt

then the display is totally off. I guessed that \hskip can't be used on
\hrule to shift it right.

I also tried the picture environment with \put(x,y){\line...}, but I
can't position the picture itself precisely.

Thanks for any advice/leads!

Regards,
Karthick

Rolf Niepraschk

unread,
Aug 1, 2006, 7:05:47 AM8/1/06
to
KG schrieb:

> Hi all,
>
> I'm a newbie to TeX/LaTeX (read the The Not So Short Introduction to
> LATEX2e few days back). I'm trying some small experiments as I learn
> LaTeX
>
> Currently what I'm trying to do is to make a small calender booklet
> that in its final form will measure 2.5in X 3.5in (small enough to fit
> in a wallet). There will be one page for each day to jot down
> notes/appointments etc, so the book will have 30/31 + few blank pages.
>

Look at the LaTeX packages "textpos" or "eso-pic".

...Rolf

Robin Fairbairns

unread,
Aug 1, 2006, 9:15:05 AM8/1/06
to
Rolf Niepraschk <Rolf.Ni...@gmx.de> writes:
>KG schrieb:

>> I'm a newbie to TeX/LaTeX (read the The Not So Short Introduction to
>> LATEX2e few days back). I'm trying some small experiments as I learn
>> LaTeX

this is what i would call "jumping in at the deep end" (a metaphor
relating to learning swimmers...).

>> Currently what I'm trying to do is to make a small calender booklet
>> that in its final form will measure 2.5in X 3.5in (small enough to fit
>> in a wallet). There will be one page for each day to jot down
>> notes/appointments etc, so the book will have 30/31 + few blank pages.
>
>Look at the LaTeX packages "textpos" or "eso-pic".

he says he's already using textpos.

kg -- can you not position your rules absolutely using textpos?

(frankly, i wouldn't have said that latex is particularly well suited
to this job, though there are one or two packages available that come
close to what you're doing.)
--
Robin Fairbairns, Cambridge

KG

unread,
Aug 2, 2006, 3:12:11 AM8/2/06
to

My mistake. textpos is sufficient. When I read the documentation and
examples, I assumed that only "text" can be positioned - even the
command was named \begin{textblock} :)


But the following code works fine now:

\documentclass[letterpaper,10pt,landscape,openany]{report}
\usepackage[absolute]{textpos}

\setlength{\pdfpagewidth}{11in}
\setlength{\pdfpageheight}{8.5in}

\setlength{\hoffset}{-1in}
\setlength{\oddsidemargin}{0pt}
\setlength{\evensidemargin}{0pt}

\setlength{\voffset}{-1in}
\setlength{\topmargin}{0pt}
\setlength{\headheight}{0pt}
\setlength{\headsep}{0pt}

\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}

\setlength{\TPHorizModule}{0.1in}
\setlength{\TPVertModule}{\TPHorizModule}
\textblockorigin{1.5in}{1.75in}

\begin{document}

\begin{textblock}{1}(0,0)


\hrule width 10in height 1pt

\end{textblock}
\begin{textblock}{1}(0,35)


\hrule width 10in height 1pt

\end{textblock}
\begin{textblock}{1}(0,70)


\hrule width 10in height 1pt

\end{textblock}

\begin{textblock}{1}(0,0)
\vrule width 1pt height 7in
\end{textblock}
\begin{textblock}{1}(25,0)
\vrule width 1pt height 7in
\end{textblock}
\begin{textblock}{1}(50,0)
\vrule width 1pt height 7in
\end{textblock}
\begin{textblock}{1}(75,0)
\vrule width 1pt height 7in
\end{textblock}
\begin{textblock}{1}(100,0)
\vrule width 1pt height 7in
\end{textblock}

\begin{textblock}{1}(1,1)
\tiny{xxx}
\end{textblock}
\begin{textblock}{1}(45,1)
\tiny{xxx}
\end{textblock}
\begin{textblock}{1}(51,1)
\tiny{xxx}
\end{textblock}
\begin{textblock}{1}(95,1)
\tiny{xxx}
\end{textblock}

\end{document}

I also had a look at the eso-pic package as suggested by Rolf
Niepraschk. It is not useful for my purpose currently, but atleast I
know what the package does..

Thanks for the help!

Regards,
Karthick

0 new messages