Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

It aligns the formula to the left-hand-side but I would like to get tabs here-and-there. How can I get tabs inside breqn or is there some package to do it automatically?

$ cat test.tex

% breqn -pkg fixes the long equations
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{verbatim}
\usepackage{breqn}



\begin{document}
% ...

% A long eq which I want better indented, with tabs, so it is easier to read
\begin{breqn}
\forall game\in[2,5]\in\mathbb N
\\
\forall player\in[1,10]\in\mathbb N
\\
% I want 1 pc of TABs HERE 
potentialTiredness[player][game] =
\\
% I WANT 2 pcs of TABs HERE
\left(
\sum_{\text{game2}\in[1,\text{game}-1}x[\text{player}][\text{game2}]/5
\right)
+
\frac{x[\text{player}][\text{game}-1]}{10}
\end{breqn}


\end{document}

and it does work:

$ pdflatex test.tex 
...
Output written on test.pdf (1 page, 64508 bytes).
Transcript written on test.log.
share|improve this question
2  
Can turn your code snippet into a minimal working example (MWE)? –  Torbjørn T. Nov 24 '11 at 20:40
    
Are you looking for a tab as in an alignment tab, or just spacing. If the later you could use \quad and \qquad. –  Peter Grill Nov 24 '11 at 21:44
    
An MWE should be a working document, i.e., we should be able to just compile the code as it is. Your code doesn't contain a documentclass and a document environment which is necessary in that respect. But as the breqn package does not provide an environment called breqn, even with those added it wouldn't work. –  Torbjørn T. Nov 25 '11 at 0:12
    
@TorbjørnT.: now? Seriously, if you really look around, most questions are not MVO like here. I am now not sure what this MVO is really for. –  hhh Nov 25 '11 at 0:21
3  
The question still has the non-existent environment in. –  qubyte Nov 25 '11 at 7:37

1 Answer 1

up vote 5 down vote accepted

Forgive me, I do know that many questions do not contain MWEs. There are several reasons for using them. If there is an error of some kind, producing an MWE may lead to the questioner finding the reason for the error, or at least the smallest combination of packages and commands that causes the problem. Of course, this is not the case here, but another point is actually that it is a courtesy towards those who would help you. I'm not claiming that it is a big job to make a complete document in this case, but everything takes time, and not having to do that saves a little. Also, it's not always obvious (at least for me ...) which packages and/or libraries have been used, and then having an MWE saves having to figure out that.

Now, I don't know which version of breqn you have, but in the one I have, v0.98a from 2009/08/07, the breqn environment is undefined, hence your example does not work for me. Perhaps it existed in older versions, I do not know.

Back to the question at hand, breqn does both line breaks and, when a line break has occurred, indentation of the second line, automatically. None of your lines are so long that they require a line break, though breqn still adds a couple (see below). You could use an align* environment (from amsmath), and as Peter Grill mentioned in a comment add a \qquad or two at the beginning of the line. This didn't work in the environments provided by breqn when I tried, but \hspace*{<dimension>} did. Kind of hackish really, you may well get better solutions from other users.

In the code below I've added three examples: one with align*, one with breqn environments and no \hspace, and the final breqn environments with \hspace. All are unnumbered in this case. Do you want numbering, and in that case one number per line, or a single number for the entire thing?

enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{verbatim}
\usepackage{breqn}

\begin{document}
% ...

% A long eq which I want better indented, with tabs, so it is easier to read
\begin{align*}
&\forall \text{game}\in[2,5]\in\mathbb N \\
&\forall \text{player}\in[1,10]\in\mathbb N \\
% I want 1 pc of TABs HERE 
&\qquad\text{potentialTiredness}[\text{player}][\text{game}]  \\
% I WANT 2 pcs of TABs HERE
&\qquad\qquad=\left(
\sum_{\text{game2}\in[1,\text{game}-1]}x[\text{player}][\text{game2}]/5
\right)
+
\frac{x[\text{player}][\text{game}-1]}{10}
\end{align*}
\vspace{1cm}
\begin{dgroup*}
\begin{dmath*}
\forall \text{game}\in[2,5]\in\mathbb N
\end{dmath*}
\begin{dmath*}
\forall \text{player}\in[1,10]\in\mathbb N
\end{dmath*}
\begin{dmath*}
% I want 1 pc of TABs HERE 
\text{potentialTiredness}[\text{player}][\text{game}]
\end{dmath*}
\begin{dmath*}
=\left(
\sum_{\text{game2}\in[1,\text{game}-1]}x[\text{player}][\text{game2}]/5
\right)
+
\frac{x[\text{player}][\text{game}-1]}{10}
\end{dmath*}
\end{dgroup*}
\vspace{1cm}
\begin{dgroup*}
\begin{dmath*}
\forall \text{game}\in[2,5]\in\mathbb N
\end{dmath*}
\begin{dmath*}
\forall \text{player}\in[1,10]\in\mathbb N
\end{dmath*}
\begin{dmath*}
% I want 1 pc of TABs HERE 
\hspace*{1cm}\text{potentialTiredness}[\text{player}][\text{game}]
\end{dmath*} 
\begin{dmath*}
% I WANT 2 pcs of TABs HERE
\hspace*{2cm}=\left(
\sum_{\text{game2}\in[1,\text{game}-1]}x[\text{player}][\text{game2}]/5
\right)
+
\frac{x[\text{player}][\text{game}-1]}{10}
\end{dmath*}
\end{dgroup*}

\end{document}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.