Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

My system generates LaTex letters and templates; however, my client has to fill out pre-built forms that they have no control over. I'd like to fill out these forms by measuring the coordinates in mm and then placing text using those coordinates in mm as the starting point. I can then print directly on top of the existing paper forms.

Ideally I'd like the LaTeX to function something like below:

\command{x coordinate}{y coordinate}{text1}\\
\command{x coordinate}{y coordinate}{text2}\\
\command{x coordinate}{y coordinate}{text3}\\
\command{x coordinate}{y coordinate}{text4}\\
\command{x coordinate}{y coordinate}{text5}\\
\command{x coordinate}{y coordinate}{text6}\\

In the event the customer form changes I can just change the coordinates. Is this approach possible?

share|improve this question
    
Welcome to TeX.SX! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). –  Adam Liter Mar 28 at 0:39
1  
2  
May be useful/duplicate: Using LaTeX for pre-printed paper –  Harish Kumar Mar 28 at 0:44
    
Have you considered textpos? –  Sean Allred Mar 28 at 0:51
    
Same question, other answer: Using LaTeX for pre-printed paper –  Speravir Mar 28 at 0:55

2 Answers 2

up vote 20 down vote accepted

One option using TikZ. All distances are measured from the upper left corner of the paper (this can be easily modified to choose another origin point):

\documentclass{article}
\usepackage{tikz}

\newcommand\PlaceText[3]{%
\begin{tikzpicture}[remember picture,overlay]
\node[outer sep=0pt,inner sep=0pt,anchor=south west] 
  at ([xshift=#1,yshift=-#2]current page.north west) {#3};
\end{tikzpicture}%
}

\begin{document}

\PlaceText{20mm}{30mm}{First text}
\PlaceText{50mm}{30mm}{Second text}
\PlaceText{60mm}{70mm}{Third text}

\end{document}

enter image description here

share|improve this answer

With textpos:

\documentclass[a4paper]{article}
\usepackage[overlay,absolute]{textpos}
\newcommand\PlaceText[3]{%
\begin{textblock*}{10in}(#1,#2)  %% change width of box from 10in as you wish
#3
\end{textblock*}
}%
\textblockorigin{-5mm}{0mm}   %% Default origin top left corner and it can be changed in this line
\begin{document}
\PlaceText{0mm}{0mm}{Origin}
\PlaceText{20mm}{30mm}{First text}
\PlaceText{50mm}{30mm}{Second text}
\PlaceText{60mm}{70mm}{Third text}

\end{document}

enter image description here

share|improve this answer
    
Thanks so much for the two answers I received. It is very helpful. –  Jim Apr 1 at 18:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.