In a thesis package, I must change \ref with \textnormal{\ref{tab8} \vspace{-3mm}} for format restrictions. I try \renewcommand,but i does not work. Below figure explains the problem. Any help will be appreciated. The class files will be found below link under this name Tez Yazım Şablonu(Latex). http://fbe.gsu.edu.tr/tr/belgeler/tez-yazimi An example code can be add to show extra spacing is:

arrows, backgrounds, calc,%
patterns, positioning, shapes.geometric%

% End of Latex Packages
% Any personal Latex definition, declaration, etc.



\newcommand{\FOO}{\textsc{\upcase foo}}
\author{NAZMİ ŞENER}
\title{Stochastic Programming Formulations of Discrete Hub Covering Location Problem}
\trtitle{Kes\.{I}kl\.{I} Ana Dağıtım Üssü Yerleş\.{I}m Kapsama Problemler\.{I}n\.{I}n Stokast\.{I}k Programlama \.{I}le Formülasyonları}
\date{May 2017}
\supervisor[prof]{JOHN DOE}
\departmentofsupervisor{Industrial Engineering Department}
\cosupervisor[assocprof]{JANE DOE}
\committeememberi[assistprof]{JAMES DOE}
\affiliationi{Industrial Engineering Department}
\affiliationii{Industrial Engineering Department}
\committeememberiii[assocprof]{RICK DOE}
\affiliationiii{Computer Engineering Department}
\abstract{In recent years, .}
\oz{Son }

\acknowledgments{ Write your personal acknowledgements here.
%%% !!! This two should be last lines before \begin{document}, do no move them !!!
% Preliminaries

\newenvironment{prf}{\noindent{\bf Proof}}{$\hfill \Box$ \vspace{10pt}}

 summarizes the model without taking care of inter-hub discount factor. It is obvious that 
when the coverage radius becomes smaller, the performance measure also decreases. Another insight acquired from the table is there is no strong evidence to explain the relationship between hub opening cost and performance measure. On the other hand Table \ref{tab9} when standard deviation increases, the meaningfulness of stochastic modeling is also increasing. Solution times are generally higher when the radius is big.  Same way, when the standard deviation increases, solution times is also significantly increased. This relationship also occurs between hub opening costs and the solution times. \\

\caption{Comparison of the Mean Performance of the Model for Log-N Distribution with Different Levels of Variance and Mean Solution Times (sec.) (Inter-hub Discount Factor=1)}

\parbox[t]{2mm}{\multirow{2}{*}{\rotatebox[]{90}{HOC}}}& \multirow{2}{*}{$R$} &\multicolumn{2}{c|}{Log-N($\sigma=0.5c(i,k))$}&\multicolumn{2}{c|}{Log-N($\sigma=c(i,k))$}&\multicolumn{2}{c|}{Log-N($\sigma=2c(i,k))$}\\
  &         &   {\small \% VSS/EEV} &   Time    &   {\small \% VSS/EEV} &   Time    & {\small \% VSS/EEV}   &   Time        \\
\parbox[t]{2mm}{\multirow{5}{*}{\rotatebox[]{90}{10,000}}}  &   0.7 $\Delta$    &   5.273   &   12154.3 &   13.967  &   26614.2 &   18.899  &   62474.8 \\  
    &   0.6 $\Delta$    &   5.178   &   9648.4  &   12.034  &   31224.9 &   15.988  &   58075.4 \\  
    &   0.5 $\Delta$    &   5.223   &   6802.9  &   10.176  &   16327.2 &   12.279  &   48422.3 \\  
    &   0.4 $\Delta$    &   3.865   &   5007.8  &   10.905  &   12250.5 &   13.025  &   39201.2 \\  
    &   0.3 $\Delta$    &   3.403   &   2404.2  &   7.107   &   6617.9  &   13.009  &   17396.5 \\  \hline
\parbox[t]{2mm}{\multirow{5}{*}{\rotatebox[]{90}{20,000}}}  &   0.7 $\Delta$    &   6.647   &   5561.3  &   13.689  &   16166.6 &   18.584  &   26126.5 \\  
    &   0.6 $\Delta$    &   6.004   &   4569.7  &   11.363  &   17305.8 &   15.363  &   31249.1 \\  
    &   0.5 $\Delta$    &   5.731   &   3721.2  &   12.065  &   12084.9 &   13.452  &   24147.5 \\  
    &   0.4 $\Delta$    &   5.129   &   2805.6  &   9.424   &   7313.3  &   11.441  &   19086.6 \\  
    &   0.3 $\Delta$    &   2.532   &   1938.1  &   4.933   &   4965.2  &   10.328  &   7444.4  \\  \hline



enter image description here

  • 6
    no why would you do that?? \ref just makes a word that is part of a sentence why would you make the line following the line that has the reference 3mm higher so over-printing the current line if there are any large letters? May 10, 2017 at 20:29
  • 3
    no, \ref adds no space. \ref will make text such as 1.2 why on earth do you want to add 3mm of negative vertical!! space on the line after whichever line of a paragraph has ... see section 1.2 ... ??? May 10, 2017 at 20:33
  • 3
    whatever made that space in your image is not \ref unless you have really broken ref. please show a small (complete) example that does that. May 10, 2017 at 20:37
  • 2
    What's the difference to tex.stackexchange.com/questions/369008/…? May 10, 2017 at 20:42
  • 2
    the image shows you have a problem but we can not begin to guess what is the cause of the problem unless you show some code that does that. Clearly you have some incorrect definition, but redefining \ref to add vertical space would completely break any normal use of \ref in the document and is not the solution. May 10, 2017 at 20:47

2 Answers 2


The class file and the example document in the zip file show multiple mis-use of \vspace. the extra space shown in the image is from one of those, not from \ref.

Without an example posted, it's hard to guess exactly what produces the image but this shows a similar effect, using a definition in the thesis.tex example file.

enter image description here

\newenvironment{prf}{\noindent{\bf Proof}}{$\hfill \Box$ \vspace{10pt}}

  One two three four five six seven eight nine ten.
  One two three four five six seven eight nine ten.
  One two three four five six seven eight nine ten.
  One two three four five six seven eight nine ten.
  One two three four five six seven eight nine ten.
  One two three four five six seven eight nine ten.
  One two three four five six seven eight nine ten.
  One two three four five six seven eight nine ten.

Note that the 10pt vertical space does not come immediately after the \Box but after the first line of the following paragraph. The extra space shown in your image is similarly after the first line of a paragraph, it will not be related to \ref.

With the example since added to the question, as posted it produces the error

! LaTeX Error: There's no line here to end.

as a quick emergency fix for that I changed \\ to \mbox{}\\ in the class file

then it produces

! Undefined control sequence.
\showresume ...ndhalfspacing \fi \fi \@resumetext 

so I added


to the top of the class file

It then ran without error but warned

Underfull \hbox (badness 10000) in paragraph at lines 106--108

which is from the misuse of \\ on that line in the document

so I changed

nd the solution times. \\


nd the solution times.

Then as egreg commented you get a big space mid-paragraph due to the spurious space in \thechapter

so change

\if@rmnchp \def\thechapter{\Roman{chapter}}
  \else \def\thechapter{\vspace*{10pt} \arabic{chapter}} \fi


\if@rmnchp \def\thechapter{\Roman{chapter}}
  \else \def\thechapter{\arabic{chapter}} \fi

Then the page looks like

enter image description here

That fixes the space

But you still get other serious warnings


(\end occurred inside a group at level 1)

### simple group (level 1) entered at line 1061 ({)
### bottom level
(\end occurred when \iftrue on line 96 was incomplete)

which means that the class really shouldn't be used for any actual document in its current state.

  • I tried to change position of the '\ref' to another line, after that spacing also changes. I add another photo of this issue above. Thank you very much for your help and time.
    – nsener
    May 10, 2017 at 21:15
  • 1
    @nsener yes in your case but not really because of \ref. as egreg shows your reference expands in this case to \thechapter which has a faulty definition and adds the space you show. May 10, 2017 at 21:24
  • The \end occurred inside a group at level 1 warning is due to algorithm2e.
    – egreg
    May 10, 2017 at 21:48
  • @egreg whatever, I wouldn't print a document with such errors:-) May 10, 2017 at 21:51

The class has

\if@rmnchp \def\thechapter{\Roman{chapter}}
  \else \def\thechapter{\vspace*{10pt} \arabic{chapter}} \fi

This means that every time \thechapter is used, it will add a vertical space of 10pt after the line where the chapter number appears, in addition to a spurious horizontal space. Such usages are implicit in \ref{<label>} when the number to be referenced is based on \thechapter, for example a figure number.

Better code:


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .