4
votes
1answer
70 views

Detect actual start of text

I have conditional which is sometimes suppressed, and if it gets typeset needs to be noted. If the conditional text begins with an environment which adds vertical space prior to the actual start of ...
5
votes
1answer
49 views

how to use conditional to define different \begin and \end environment at compile time

I just need little help on the syntax for this. I am using tex4ht, and I get an error when I use empheq for the align environment. I want to build this TeX file both in pdflatex and htlatex. I ...
8
votes
2answers
141 views

Errors when trying to define a custom align environment

I'm currently trying to create a custom environment with its own counter. \documentclass[a4paper,11pt]{report} \usepackage[fleqn]{amsmath} \newcounter{grammarcounter} \newenvironment{grammar}{ ...
6
votes
1answer
87 views

Environment definition gives an error

\documentclass{scrreprt} \usepackage{fontspec} \setmainfont{Linux Libertine O} \usepackage{graphicx} \usepackage{polyglossia} \setdefaultlanguage[babelshorthands=true]{german} % align in enumerate ...
4
votes
3answers
148 views

How to replace \\ with \\& in math mode?

I am having the following isssue: I have to write a mathematical paper/book with many different optimization problems formulated. To be consistent all over I'd like to create an environment to ...
2
votes
1answer
181 views

Custom glossary environment improvement

This is a followup question about the code provided by Nicola Talbot in this question: Automated generation of equation key TL;DR: Defines new environment alignglos which can be used to wrap ...
7
votes
2answers
289 views

What is wrong with defining \bal as \begin{align}?

I'm trying to define two commands \bal and \eal instead of inserting \begin{align} and \end{align} in my document, but in the code below, I'll get some errors. What is wrong with it? ...
4
votes
2answers
163 views

I can't use & tabs in the `align` environment while using it inside a custom environment

I've got a custom environment made for problem sets, and it uses a tabular to align the question number and question body. When I try to use & to group parts of an equation together - like if I ...
4
votes
1answer
2k views

How do I left and right justify text within an align environment

I want to simultaneously have text left and right justified around an align environment. I'm able to do this, but my solution seems like a dreadful hack. I really don't want to prepend every line ...
2
votes
1answer
211 views

Interrupt environment with command

At the moment I'm trying to figure out how I could interrupt an environment. What I did so far... \documentclass{article} \usepackage{amsmath} \newenvironment{envnew} { \begingroup \csname ...
2
votes
1answer
369 views

Left aligned multi line equations and \newenvironment

I'm building a table of integrals, for my own use. I need simple things: equations must be left aligned, sometimes I need alignment on the equal symbol and to save space sometimes I need 2 equations ...
1
vote
1answer
393 views

Align environment

I'd like to ask how in align environment to number only one of the equations. \begin{aligned} \mathsf{E}[W^{i}_{t}-W^{i}_{s}]&=0,\\ ...
3
votes
1answer
178 views

Define an align environment that always aligns to the first equal sign

I noticed that 98% of the times I use align or aligned I place the & just before the first = of each line. Is there a way to define a new environment that automatically aligns equations to the ...
6
votes
3answers
614 views

Optional argument to an environment inside align

I have lots of matrices so I want to define a mat environment. I sometimes need the matrix to have right-aligned columns so I am using mathtools and I want to have an optional argument that is ...
9
votes
3answers
245 views

Remember position of equal sign from one align environment to the next

As you know, the align-environment puts all positions marked with & (normally the equals sign) exactly beneath each other. I now want to save the position LaTeX calculates for & and use it ...
4
votes
3answers
238 views

Why does a defined command appear differently in the align environment?

In the LaTeX document shown below, my definition \comp does not show correctly in the align environment. Why it is this the case? ========== Begin LaTeX scripts ============= ...
9
votes
1answer
2k views

How can I write multi line equations with alignment in inline math mode?

Is there any way to override the fact that certain environments in LaTeX are automatically "displayed"? One such example is the align* environment. I want to keep my aligned equations inline. So ...
10
votes
3answers
3k views

Defining a command for amsmath's align environment

I'd like to define a shorthand command for \begin{align*} and \end{align*}. When I write \newcommand{\ba}{\begin{align*}} it works fine. But when I write \newcommand{\ea}{\end{align*}} ...