Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare breaking and non-breaking symbols #15

Closed
svenkeidel opened this issue Jul 14, 2016 · 12 comments
Closed

Declare breaking and non-breaking symbols #15

svenkeidel opened this issue Jul 14, 2016 · 12 comments

Comments

@svenkeidel
Copy link

svenkeidel commented Jul 14, 2016

How can I specify that a relation symbol is not available for breaking inside a formula? Furthermore, how can I specify that the punction . can be used as a breaking symbol?

Ideally I would like to write something like this:

\usepackage[breaking={.}, nonbreaking={\in}]{breqn}

Here is a minimal example formula that is indented weirdly:

\documentclass{minimal}

\usepackage{amsmath}
\usepackage{breqn}

\begin{document}
  \begin{dmath*}
     \phi = \exists x \in M. \exists y \in M. \psi
  \end{dmath*}
\end{document}

formula

@wspr
Copy link
Owner

wspr commented Jul 14, 2016

Is this more than one equation? Note that, although I think the syntax is rather verbose, breqn asks for each separate equation to be placed into separate dmath environments. Apologies, but can you supply an “expected” output typeset with amsmath?

@svenkeidel
Copy link
Author

svenkeidel commented Jul 14, 2016

These two alternatives would be fine:

  \begin{align*}
     \phi =& \exists x \in M. \\
           & \exists y \in M. \\
           & \psi
  \end{align*}

  \begin{align*}
     \phi =& \exists x \in M. \\
           & \quad \exists y \in M. \\
           & \qquad \psi
  \end{align*}

screen shot 2016-07-14 at 14 30 42

I simply want to avoid breaking formulas at \in and allow breaking formulas at .

@davidcarlisle
Copy link
Collaborator

davidcarlisle commented Jul 14, 2016

I think here the issue isn't so much to globally stop breaks on \in but rather to mark the subterm with the type judgement as something on which not to break, if you do

\begin{dmath*}
     \phi = \exists {x \in M}. \exists {y \in M}. \psi
\end{dmath*}

Then you get a much better layout from breqn.

@svenkeidel
Copy link
Author

@davidcarlisle, thanks for the advice, but the formula you suggested does allow breaking at all. The problem is that . is now breaking point:

  \begin{dmath*}
     \phi = \exists {x \in M}. \exists {x \in M}. \exists {x \in M}. \exists {x \in M}. \exists {x \in M}. \exists {x \in M}.\exists {x \in M}.\exists {x \in M}.\exists {x \in M}.\exists {x \in M}.\exists {x \in M}.\exists {x \in M}.\exists {x \in M}.\exists {x \in M}.\exists {x \in M}. \psi
  \end{dmath*}

screen shot 2016-07-14 at 15 46 50

@davidcarlisle
Copy link
Collaborator

You can declare a breakable . by making it a binary operator (probably other ways too but \mathbin seems OK for this usage)


\documentclass{minimal}

\usepackage{amsmath}

\usepackage{breqn}


\DeclareFlexSymbol{\mydot}{Bin}{OML}{3A}


\begin{document}

  \begin{dmath*}
     \phi = \exists x \in M\mydot \exists y \in M\mydot \psi
  \end{dmath*}

  \begin{dmath*}
     \phi = \exists {x \in M}\mydot \exists {y \in M}\mydot \psi
  \end{dmath*}

 \begin{dmath*}
     \phi = \exists {x \in M}\mydot \exists {x \in M}\mydot \exists {x \in M}\mydot \exists {x \in M}\mydot \exists {x \in M}\mydot \exists {x \in M}\mydot\exists {x \in M}\mydot\exists {x \in M}\mydot\exists {x \in M}\mydot\exists {x \in M}\mydot\exists {x \in M}\mydot\exists {x \in M}\mydot\exists {x \in M}\mydot\exists {x \in M}\mydot\exists {x \in M}\mydot \psi
  \end{dmath*}
\end{document}


it doesn't really capture the semantic nesting though

@svenkeidel
Copy link
Author

svenkeidel commented Jul 14, 2016

This would work, if the line would break after the . and not before:

screen shot 2016-07-14 at 16 20 58

I.e. something like this:

screen shot 2016-07-14 at 16 36 03

@davidcarlisle
Copy link
Collaborator

yes I was going to comment on that, I'd need to check flexisym to see if
you can specify break-after, but it's a separate issue to the original
request to be able to specify in a dmath argument that "." should break
(I should mention It's Will's repo (but it's rather late in Australia:-) I
have no write access to the sources, just an interested bystander.

On 14 July 2016 at 15:23, Sven Keidel notifications@github.com wrote:

Also the line breaks before the . and not after:

[image: screen shot 2016-07-14 at 16 20 58]
https://cloud.githubusercontent.com/assets/266500/16842808/11449e5a-49df-11e6-9d4a-8f0d4e26fb49.png


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#15 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/ABNcAoJqp1uxab9Jw8Mq_FT41yenuKOTks5qVkZEgaJpZM4JMVHL
.

@svenkeidel
Copy link
Author

Oh, I see, but thanks for the help anyway.

@wspr
Copy link
Owner

wspr commented Jul 15, 2016

On 15 Jul 2016, at 12:08 AM, David Carlisle notifications@github.com wrote:

yes I was going to comment on that, I'd need to check flexisym to see if
you can specify break-after, but it's a separate issue to the original
request to be able to specify in a dmath argument that "." should break
(I should mention It's Will's repo (but it's rather late in Australia:-) I
have no write access to the sources, just an interested bystander.

Would you like write access? :)
Despite Morten’s request that the package revert to his name, I have no evidence he’s looked at the code.

Cheers,
Will

@svenkeidel
Copy link
Author

So, @wspr, @davidcarlisle, how can I declare the dot to be a breaking symbol without appearing at the beginning of the next line?

@davidcarlisle
Copy link
Collaborator

davidcarlisle commented Jul 18, 2016

@svenkeidel possibly like this

\documentclass{minimal}

\usepackage{amsmath}

\usepackage{breqn}



\DeclareFlexCompoundSymbol{\mydotb}{Bin}{} 
\def\mydot{.\mydotb}

\begin{document}

  \begin{dmath*}
     \phi = \exists x \in M\mydot \exists y \in M\mydot \psi
  \end{dmath*}

  \begin{dmath*}
     \phi = \exists {x \in M}\mydot \exists {y \in M}\mydot \psi
  \end{dmath*}

 \begin{dmath*}
     \phi = \exists {x \in M}\mydot \exists {x \in M}\mydot \exists {x \in M}\mydot \exists {x \in M}\mydot \exists {x \in M}\mydot \exists {x \in M}\mydot\exists {x \in M}\mydot\exists {x \in M}\mydot\exists {x \in M}\mydot\exists {x \in M}\mydot\exists {x \in M}\mydot\exists {x \in M}\mydot\exists {x \in M}\mydot\exists {x \in M}\mydot\exists {x \in M}\mydot \psi
  \end{dmath*}
\end{document}

which makes \mydot a dot followed by an empty breakable \mathbin

@svenkeidel
Copy link
Author

Ah, thanks, this works. For the record, here is the result:

screen shot 2016-07-18 at 13 21 35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants