Quantcast
Channel: Active questions tagged starred-version - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 63

Alignment tab character inside a starred command within align

$
0
0

Here is a minimal example of what I want to do.

\documentclass{article}\usepackage{amsmath}\makeatletter\newcommand{\mylinebreak}{\@ifstar\@mylinebreak\@@mylinebreak}\newcommand{\@mylinebreak}{&\\}\newcommand{\@@mylinebreak}{&&\\}%\let\mylinebreak\@@mylinebreak\makeatother\begin{document}\begin{align*} a&=b\mylinebreak&=c.\end{align*}\end{document}

This gives the error message

! Misplaced alignment tab character &.\@@mylinebreak ->&&\\l.16 \end{align*}

What is wrong? How can I get this to work?

Curiously, I get no error message if I remove the % or if I use \mylinebreak* instead.

I am guessing that the problem can be solved using the tricks involving master/balance counters, but I could not make this work.


Viewing all articles
Browse latest Browse all 63

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>