LaTeX forum ⇒ GeneralMisalignment of \vrule Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
abikutn
Posts: 18
Joined: Sat May 12, 2012 8:44 pm

Misalignment of \vrule

Postby abikutn » Mon Nov 26, 2012 11:24 pm

Hello, I have been writing my thesis and there is this one problem that I cant seem to figure out why it happens :
The following is a segment of the code from my thesis style sheet. This defines the first reader and second reader for my signature page.
And I have also attached a output snap of my pdf of the problem.
Can someone please tell me why this occurs ?

  1. % Signature page
  2. \def\signaturepage{%
  3. \newpage
  4. \thispagestyle{empty} % KS 2009
  5. \begin{center}
  6. \Large\uppercase\expandafter{\@title}
  7. \end{center}
  8. \vspace{.4in}
  9. \centerline{\shortstack[c]{\vrule width 2in height 0.4pt\\
  10. \@author}}
  11. \vfill
  12. % \vspace{0.15in}
  13. % \hspace{0in} \rm APPROVED:
  14. \leftline{ Approved:} % KS 2009
  15. \vspace{0.15in}
  16. \rightline{\shortstack[l]{\vrule width 3in height 0.4pt\\ \@adviser}}
  17. % \vspace{0.15in}
  18. \vfill
  19.  
  20. \leftline{Committee Members:} % KS 2009
  21. % \vspace{0.375in}
  22. \vspace{0.15in}
  23. \rightline{\shortstack[l]{\vrule width 3in height 0.4pt\\ \@firstreader}}
  24. % \vspace{.375in}
  25. \vfill
  26.  
  27. \rightline{\shortstack[l]{\vrule width 3in height 0.4pt\\ \@secondreader}}
  28. % \vspace{.375in}
  29. \vfill

signpage800.png
Please see the mis-alignment in the first reader and second reader.
signpage800.png (67.74 KiB) Viewed 1251 times
Last edited by cgnieder on Mon Nov 26, 2012 11:45 pm, edited 1 time in total.
Reason: scaled images so they can also be viewed on small screens

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
cgnieder
Site Moderator
Posts: 1948
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:

Postby cgnieder » Tue Nov 27, 2012 9:06 pm

Could you make that code fragment into a Infominimal working example? I tried but cannot get the behaviour your picture shows:

  1. \documentclass{article}
  2.  
  3. \makeatletter
  4. \def\adviser#1{\gdef\@adviser{#1}}
  5. \def\firstreader#1{\gdef\@firstreader{#1}}
  6. \def\secondreader#1{\gdef\@secondreader{#1}}
  7. % Signature page
  8. \def\signaturepage{%
  9. \newpage
  10. \thispagestyle{empty} % KS 2009
  11. \begin{center}
  12. \Large\uppercase\expandafter{\@title}
  13. \end{center}
  14. \vspace{.4in}
  15. \centerline{\shortstack[c]{\vrule width 2in height 0.4pt\\
  16. \@author}}
  17. \vfill
  18. % \vspace{0.15in}
  19. % \hspace{0in} \rm APPROVED:
  20. \leftline{ Approved:} % KS 2009
  21. \vspace{0.15in}
  22. \rightline{\shortstack[l]{\vrule width 3in height 0.4pt\\ \@adviser}}
  23. % \vspace{0.15in}
  24. \vfill
  25.  
  26. \leftline{Committee Members:} % KS 2009
  27. %\vspace{0.375in}
  28. \vspace{0.15in}
  29. \rightline{\shortstack[l]{\vrule width 3in height 0.4pt\\ \@firstreader}}
  30. %\vspace{.375in}
  31. \vfill
  32.  
  33. \rightline{\shortstack[l]{\vrule width 3in height 0.4pt\\ \@secondreader}}
  34. %\vspace{.375in}
  35. }
  36. \makeatother
  37.  
  38. \author{Author}
  39. \title{Title}
  40. \adviser{Advisor\\Sample University}
  41. \firstreader{Firstreader\\Sample University}
  42. \secondreader{Secondreader\\Sample University}
  43.  
  44. \begin{document}
  45.  
  46. \signaturepage
  47.  
  48. \end{document}


Regards

PS: For reference and information for potential helpers: this question has also been asked on TeX.sx. Our board rules require that a direct link is given for cross posts.
Clemens
------------------------------
New German Q&A site about TeX: http://texwelt.de/wissen

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7801
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Tue Nov 27, 2012 9:28 pm

I support Clemens' remark: also I would test your code if you would post a compilable example, with your thesis style as attachment to the post. Just click the "Upload attachment" link when editing.
Once we can test code, we would be able to fix it. ;-)

Stefan
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

abikutn
Posts: 18
Joined: Sat May 12, 2012 8:44 pm

Postby abikutn » Tue Nov 27, 2012 10:03 pm

Oh ok. I can upload the style package and the master file.
Select AS_Thesis_Dev1.tex as master file to compile and view
Attachments
latex community.rar
UNRAR THIS and Select AS_Thesis_Dev1.tex to build and view.
(11.01 KiB) Downloaded 68 times

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7801
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Tue Nov 27, 2012 10:36 pm

The \vrule of 3in is too short. The wider text below pushes it to the left. Redefine \signature to make it wider. One could simply patch, such as

  1. \usepackage{etoolbox}
  2. \newcommand*{\patch}[1]{%
  3. \patchcmd{\signaturepage}{\vrule width 3in}{\vrule width 3.5in}{#1}{}}
  4. \patch{\patch{\patch{}}}


Perhaps in your case it's easier to shorten the departments or to introduce a line break for the wider texts, such as

  1. \firstreader{E. Joe Charlson, Professor\\ Dept. of Electrical and\\ Computer Engineering}


Stefan
Site admin

Link:
BBcode: Topic is solved[/url]" title="Click to select post's link in BBcode format" onclick="this.focus();this.select();" />
HTML: Topic is solved</a>" title="Click to select post's link in HTML format" onclick="this.focus();this.select();" />
Hide post links
Show post links

abikutn
Posts: 18
Joined: Sat May 12, 2012 8:44 pm

Postby abikutn » Wed Nov 28, 2012 12:28 am

Thank you cgnieder and sthephen. Great help and also I shall remem to post link to outside posts apart from this ...

Best,
Abhi=

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “General”

Who is online

Users browsing this forum: Bing [Bot] and 11 guests