Conflict between \hline and arydshln in aligned environment?

I'm using the following code:

\documentclass{article}
\usepackage{tikz}
\usepackage{amsmath}
% \usepackage{arydshln} %code doesn't compile anymore with this package

\begin{document}
\begin{tikzpicture}
\node at (0,0){\begin{aligned} & A \to B\\ & A \\\hline & B \end{aligned}};
\end{tikzpicture}
\end{document}


to produce this (the actual formula is a bit longer but I don't think that does matter):

Problem is that in other parts of the document I need to use the \hdashline macro from the arydshln package and it seems that the package conflicts with the \hline macro when placed inside the aligned environment.

I tried replacing \hline with \cline and \hhline but both produce something like this:

with too much whitespace around the horizontal line.

Is there a way to have an horizontal line like\hline in an aligned environment while the arydshln is loaded? It would be ok also to change the environment to something else, assuming it works inside a TikZ node.

• What about \begin{array}{@{}l@{}} instead of aligned? – egreg Apr 28 '13 at 16:23 • @egreg works! thanks. Is it also possible to move up the horizontal line a bit? As it is it almost touches the "B." – Old Nick Apr 28 '13 at 16:38 • \extrarowheight of the array package might help. – egreg Apr 28 '13 at 16:39 • @egreg, sorry, nevermind, it works just fine as it is, the line I was seeing was another one I was drawing with TikZ for test purpose :) – Old Nick Apr 28 '13 at 16:42 1 Answer The aligned environment is not based on tabular or array, so \hline and similar commands are not guaranteed to work; this is definitely true, it seems, for the extended lines provided by arydshln. Use array: \documentclass{article} \usepackage{tikz} \usepackage{amsmath} \usepackage{arydshln} \begin{document} \begin{tikzpicture} \node at (0,0) {\begin{array}{@{}l@{}}
A \to B\\
A \\
\hdashline
B
\end{array}\$
};
\end{tikzpicture}
\end{document}