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.

I tried to make the following form but I couldn't. Also When the address is too much, the table is broken. I apologize. Maybe my question is awkward. thanks.

\documentclass{article}‎ 
‎‎\usepackage{fancybox}‎
‎\usepackage{enumerate}‎
\usepackage{multirow}‎
\usepackage{tabulary}
‎‎\begin{document}‎‎‎‎
‎\newsavebox\mybox‎
‎\newenvironment{myfbox}{%‎
‎\begin{lrbox}{\mybox}%‎
‎\begin{minipage}{\dimexpr(\textwidth-2\fboxsep-2\fboxrule)}‎
}{%
‎\end{minipage}‎
‎\end{lrbox}%‎
‎\vskip10pt‎
‎\noindent‎
‎\fbox{\usebox\mybox}%‎
‎\vskip10pt‎
}
‎\newenvironment{myshadowbox}{%‎
‎\begin{lrbox}{\mybox}%‎
‎\begin{minipage}{\dimexpr(\textwidth-2\fboxsep-2\fboxrule-\shadowsize)}‎
}{%
‎\end{minipage}‎
‎\end{lrbox}%‎
‎\vskip10pt‎
‎\noindent‎
‎\shadowbox{\usebox\mybox}%‎
‎\vskip10pt‎
}‎

‎\begin{enumerate}‎
‎\item[] \fbox{\bf{1-Student information‎:}}‎
‎\vspace{-2mm}‎
‎\begin{myshadowbox}‎
‎\begin{tabular}{r‎‎‎‎lrlrl}‎
‎&&&&&\\ 
‎\vspace{2mm}‎‎‎
Name and Family: 
&
\multicolumn{2}{ l}‎{‎
‎\textbf‎{‎
‎John
}
}‎
& &
 {\small ‎Student No‎‎:}
  &
 {‎\textbf‎{  901901431} }\\‎
 ‎{\small ‎Faculty‎‎:} ‎
& &‎Science‎
‎‎& {\small‎ Field‎:}‎
 Pure ‎mathematics ‎‎
 ‎‎& {\small‎ tendency‎:}‎
 &  {‎\textbf‎ ‎analysis‎}\\
‎\vspace{2mm}‎‎
‎{\small ‎Year‎‎:}‎
&‎
 {‎\textbf‎{2012}}‎
&‎
 {\small‎ Type ‎:}‎
&‎ Scholarships‎
 ‎&&\\‎
‎\vspace{2mm}‎
‎{\small ‎Address‎‎:}‎
 &‎
\multicolumn{3}{ l}{9 Royal Worcester Drive }
‎& {\small ‎phone‎‎:}‎
&‎
{\small 011 44 1234 567890}\\‎
‎\vspace{2mm}‎‎
E-mail:&‎‎
‎\multicolumn{5}{l}{sssssssss@ggggggg.edu}‎
‎\end{tabular}‎‎‎

‎‎\end{myshadowbox}‎‎‎
‎\end{enumerate}‎
‎‎\end{document}

http://www.uploadtak.com/images/b6189_test.zip

enter image description here

share|improve this question
1  
Welcome to TeX.SX. Please always post compilable code, i.e. add a short preamble and a document environment around the content. You might also want to reformat the source code a little to make it more readable to others. To understand your correctly, you want to create the shown form but have issues with it, especially on how to make the address wrap over several lines, right? –  Martin Scharrer Jan 3 '13 at 11:07
2  
Apparently your code contains invisible unicode characters which make impossible for me to copy&paste it into a file to test it. For example, I get the following error: l.1 â €Ž\documentclass{article}‎ ? Missing character: There is no â in font null and a lot more like this one –  JLDiaz Jan 3 '13 at 11:19
1  
Note that the myfbox and myshadowbox environments can be easily done using the adjustbox package. –  Martin Scharrer Jan 3 '13 at 11:28

1 Answer 1

up vote 1 down vote accepted

As far as I can see it you misplaced some &s. For the address you should use a p{<width>} column, probably together with \raggedright to avoid hyphenation. I don't think there is a way to use tabularx to automatically calculate the width for a \multicolumn{..}{p{..}}{..} cell, so you should try to use fixed widths, maybe even for all cells.

Note that a tabular cell forms a group by itself so you don't need to wrap the content into { .. } if you like to change the font size etc. Also, you can us the optional argument of \\ to add additional vertical space. Don't use \vspace.

\documentclass{article}
\usepackage{array}

\begin{document}

\noindent
\fbox{%
\begin{tabular}{rlrlrl}
    Name and Family: & \multicolumn{3}{l}{\textbf{John Doe Smith Stepherson}} & \small Student No:     & \bfseries 901901431\\[2mm]
    \small Faculty:  & Science & {\small Field:} & Pure mathematics & \small tendency: & \bfseries analysis \\[2mm]
        \small Year: & {\textbf{2012}} & \small Type of school: & Scholarships & & \\[2mm]
    \small Address:  & \multicolumn{3}{p{7cm}}{\raggedright 9 Royal Worcester Drive Somewhere in the wide wide world} & \small phone: & \small 011 44 1234 567890\\[2mm]
             E-mail: & \multicolumn{5}{l}{sssssssss@ggggggg.edu}\\
\end{tabular}}

\end{document}
share|improve this answer

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.