1

I am trying to add a horizontal line in an align environment using the macro provided in this questiion and Package amsmath . The horziontal line looks okay with the equation but the contents below the line are right aligned .

\documentclass{sig-alternate-05-2015}
\usepackage{float}
\usepackage{amsmath}
\newcommand*{\tline}{%
  \ifmeasuring@
    % first measuring run
  \else
    % second run
    % \typeout{\meaning\maxcolumn@widths}% debug info
    \ifodd\column@
      \expandafter\rlap
    \else
      \expandafter\llap
    \fi
    {% 
      \vrule height-1ex depth \dimexpr1ex+.4pt\relax width
      \ifcase\numexpr\column@+1\expandafter\relax
      \maxcolumn@widths
      \fi
    }%
  \fi
}
\makeatother
\begin{document}
\begin{alignat*}{1}
 \tau_{P1}.P1 \overset {\overline{pts_{p_1}}}\longrightarrow P1'  \tau_{SC1}SC_1 \overset {{stp_{p_1}}.\overline{stp_{p_1}}}\longrightarrow SC1' 
\tline\tline \\
P1|SC1|P2 \longrightarrow P1
\end{alignat*}
\end{document}

Below is how the final PDF looks like so : How can i make the beow 2 changes : 1) notations below the horizontal line to be center aligned with the line and 2) add a tab space before SC1 in the below diagram

enter image description here

After the comment to add \underline: enter image description here

  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Holene Mar 14 '16 at 12:07
  • Please ignore the space before SC1 part, i was being dumb , i added the \quad and it seems to look okay – anil keshav Mar 14 '16 at 12:11
  • @Holene , Apologies for that, have changed the code now , should be compatible now – anil keshav Mar 14 '16 at 12:18
  • 1
    Could using \underline{} in a gather environment instead solve your problem? – Holene Mar 14 '16 at 12:57
  • @Holene, tried the \underline but it reduces the space between the content and line :( . Added the image as an edit in the above question – anil keshav Mar 14 '16 at 13:36
  • What exactly are you using the alignment for? Couldn't you just write this using \frac or \dfrac? – daleif Mar 14 '16 at 14:16

1 Answers1

0

Looking your code, I'm not sure, what you like to achieve ... but from your image seems that you actually looking for fraction:

enter image description here

The code for above picture is very, very simple :-) :

\documentclass{article}
\usepackage{mathtools}

\begin{document}
    \begin{gather*}
\frac{\ \tau_{P1}\cdot P1 \xrightarrow{\overline{pts_{p_1}}} P1'\tau_{SC1}
      \qquad   SC_1 \xrightarrow{stp_{p_1}\cdot stp_{p_1}} SC1'
      \ }
     {P1|SC1|P2 \longrightarrow P1}
    \end{gather*}
\end{document}
Zarko
  • 296,517
  • Thanks @Zarko i was trying to achieve something like this , was complicating it with the horizontal align and macro. have accepted this answer – anil keshav Mar 15 '16 at 08:55