Featured Book

LaTeX Beginners Guide

Who is online

In total there are 7 users online :: 1 registered, 0 hidden and 6 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: Google [Bot] and 6 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

Misalignment of \vrule Topic is solved

Add tags LaTeX specific issues not fitting into one of the other forums of this category.

Misalignment of \vrule

Postby abikutn on Mon Nov 26th, 2012

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 ?

Code: Select all  •  Open in writeLaTeX
% Signature page
\def\signaturepage{%
      \newpage
      \thispagestyle{empty} % KS 2009
      \begin{center}
        \Large\uppercase\expandafter{\@title}
      \end{center}
      \vspace{.4in}
      \centerline{\shortstack[c]{\vrule width 2in height 0.4pt\\
           \@author}
}
      \vfill
%      \vspace{0.15in}
%      \hspace{0in} \rm APPROVED:
      \leftline{ Approved:} % KS 2009
      \vspace{0.15in}
      \rightline{\shortstack[l]{\vrule width 3in height 0.4pt\\ \@adviser}
}
 %     \vspace{0.15in}
       \vfill
 
      \leftline{Committee Members:} % KS 2009
 %    \vspace{0.375in}
     \vspace{0.15in}
      \rightline{\shortstack[l]{\vrule width 3in height 0.4pt\\ \@firstreader}
}
  %    \vspace{.375in}
      \vfill

      \rightline{\shortstack[l]{\vrule width 3in height 0.4pt\\ \@secondreader}}
  %    \vspace{.375in}
      \vfill

signpage800.png
Please see the mis-alignment in the first reader and second reader.
signpage800.png (67.74 KiB) Viewed 747 times
Last edited by cgnieder on Mon Nov 26th, 2012, edited 1 time in total.
Reason: scaled images so they can also be viewed on small screens
abikutn
 
Posts: 18
Joined: Sat May 12th, 2012

Re: Misalignment of \vrule

Postby cgnieder on Tue Nov 27th, 2012

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

Code: Select all  •  Open in writeLaTeX
\documentclass{article}

\makeatletter
\def\adviser#1{\gdef\@adviser{#1}}
\def\firstreader#1{\gdef\@firstreader{#1}}
\def\secondreader#1{\gdef\@secondreader{#1}
}
% Signature page
\def\signaturepage{%
  \newpage
  \thispagestyle{empty} % KS 2009
  \begin{center}
    \Large\uppercase\expandafter{\@title}
  \end{center}
  \vspace{.4in}
  \centerline{\shortstack[c]{\vrule width 2in height 0.4pt\\
   \@author}
}
  \vfill
%  \vspace{0.15in}
%  \hspace{0in} \rm APPROVED:
  \leftline{ Approved:} % KS 2009
  \vspace{0.15in}
  \rightline{\shortstack[l]{\vrule width 3in height 0.4pt\\ \@adviser}
}
 % \vspace{0.15in}
   \vfill
 
  \leftline{Committee Members:} % KS 2009
 %\vspace{0.375in}
 \vspace{0.15in}
  \rightline{\shortstack[l]{\vrule width 3in height 0.4pt\\ \@firstreader}
}
  %\vspace{.375in}
  \vfill

  \rightline{\shortstack[l]{\vrule width 3in height 0.4pt\\ \@secondreader}}
  %\vspace{.375in}
}
\makeatother

\author{Author}
\title{Title}
\adviser{Advisor\\Sample University}
\firstreader{Firstreader\\Sample University}
\secondreader{Secondreader\\Sample University}

\begin{document}

\signaturepage

\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
System: TeXlive 2013, OpenSUSE 12.3
User avatar
cgnieder
Site Moderator
 
Posts: 1696
Joined: Sat Apr 16th, 2011
Location: Germany

Re: Misalignment of \vrule

Postby Stefan_K on Tue Nov 27th, 2012

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
LaTeX Community Administrator
User avatar
Stefan_K
Site Admin
 
Posts: 6413
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

Re: Misalignment of \vrule

Postby abikutn on Tue Nov 27th, 2012

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 45 times
abikutn
 
Posts: 18
Joined: Sat May 12th, 2012

Re: Misalignment of \vrule  Topic is solved

Postby Stefan_K on Tue Nov 27th, 2012

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

Code: Select all  •  Open in writeLaTeX
\usepackage{etoolbox}
\newcommand*{\patch
}[1]{%
  \patchcmd{\signaturepage}{\vrule width 3in}{\vrule width 3.5in}{#1}{}}
\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

Code: Select all  •  Open in writeLaTeX
\firstreader{E. Joe Charlson, Professor\\ Dept. of Electrical and\\ Computer Engineering}


Stefan
LaTeX Community Administrator
User avatar
Stefan_K
Site Admin
 
Posts: 6413
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

Re: Misalignment of \vrule

Postby abikutn on Wed Nov 28th, 2012

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

Best,
Abhi=
abikutn
 
Posts: 18
Joined: Sat May 12th, 2012


Return to General

Who is online

Users browsing this forum: Google [Bot] and 6 guests