5

I need a non-breaking version/redefinition of \noalign to use it at the end of an environment (in this case align). So far I searched for the standard definition of \noalign to write a redefinition based on it, but I didn't find anything so far.

It would be great, if somebody could provide a definition for \noalign without creating a newline automatically (instead done by \noalign{}\\).

More clearly: If you define a \noalign-row within an align-environment and close the environment immediately after it without any lines filled with content (math), some space/skip will result in the document. I don't want this space at all and would be glad for a workaround. ;)

Minimal:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\section{minimal}
lipsum
\begin{align*}
\eta_D &= \eta_0 \cdot \eta_R \cdot \eta_H
\end{align*}
normal spacing above
new round
\begin{align*}
\noalign{\centering $\eta_D = \eta_0 \cdot \eta_R \cdot \eta_H$}
\end{align*}
extended spacing below the align-env.
\end{document}
13
  • 2
    Welcome to TeX.SX! Would you please state more clearly what you want to achieve?
    – egreg
    Nov 9, 2012 at 22:07
  • 5
    I think you need to rephrase your question to say what you are trying to create. \noalign does not force a line break it inserts tokens between the rows of an \halign so it is executed after one row has finished and before the next starts. There is no linebreaking involved in such a situation. Nov 9, 2012 at 22:08
  • Well, I assumed there is a linebreak defined in \noalign. In the case of my use within an align-environment, the \noalign-command preduces some extra space (line?) if no content is been inserted after it.
    – triton
    Nov 9, 2012 at 22:15
  • 3
    Please edit the question to include a complete small document that shows the problem that you face including all code from \documentclass to \end{document}. \noalign is a very specialised TeX primitive and not designed as a document level latex command at all. In what way are you using it? Nov 9, 2012 at 22:20
  • \noalign is not a supported command to use within an AMS alignment, perhaps you should be using \intertext{...} it is impossible to say without seeing an example full document. Nov 9, 2012 at 22:23

2 Answers 2

5

\noalign is not a companion for the align environment.

It is a TeX primitive that has some affects but none of them planned in this case. As @egreg already suggested in this case why not simply put the text after the alignment?

If you really want to do this then you can do

\noalign{\hbox{some content}\kern-\baselineskip}

But I wouldn't recommend it.

7
  • Yes, it works but it's a quite dirty hack for massive use. I really would prefer if I could just suppress the line breaking part of \noalign in the align-environment.
    – triton
    Nov 9, 2012 at 23:24
  • 2
    \nolign is a TeX primitive and not designed for use in a document. It does not have a definition in the sense that the align environment or \\ have definitions it is not defined as a TeX macro it is defined in the code for the TeX engine itself. The hack is that you are mis-using the command, the code I posted just tries to compensate for the mis-use. Nov 9, 2012 at 23:27
  • Is there any other method for centering lines in the align-environment? Maybe this gets the fundamental question then.
    – triton
    Nov 9, 2012 at 23:34
  • \intertext{\centering....} would make more sense but it also needs some correction if you put it at the end of the environment where to get centered lines it is better to put them outside. Note you are not getting a linebreak or extra vertical space you are getting a blank horizontal box consiting of an empty row in the alignment. Nov 10, 2012 at 0:04
  • And there is no similiar/better environment as align, which allows me to center specific lines while having the ability to align other lines content to eachother (&)? (tabular is to strict, cause of the running row/col-design; tabbing either; ...)
    – triton
    Nov 10, 2012 at 7:38
2

as already pointed out, \noalign is not appropriate for use within a latex structure defined by amsmath. perhaps this is what you are looking for?

output of sample code

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\section{minimal}
lipsum
\begin{align*}
\eta_D &= \eta_0 \cdot \eta_R \cdot \eta_H
\end{align*}
normal spacing above
new round
\begin{align*}
 \eta_D &= \eta_0 \cdot \eta_R \cdot \eta_H\\
 \shortintertext{some random text}
 \theta_D &= \theta_0 \cdot \theta_R \cdot \theta_H
\end{align*}
extended spacing below the align-env.
\end{document}

actually, it's not recommended to use the align environment for single lines, whether numbered or unnumbered. for unnumbered lines, \[ ... \] or \begin{equation*} ... \end{equation*} are recommended, and for numbered lines, the unstarred equation environment. complaints or "bug reports" about bad formatting of the amsmath multiline environments when used for single-line displays will be rejected.

1
  • @Casimir -- oops! i know that! just forgot to remove that line. done. Sep 8, 2017 at 13:11

You must log in to answer this question.

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