Math & Scienceloading breqn package before biblatex gives warning

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Aardbei
Posts: 13
Joined: Sun Mar 31, 2013 11:05 pm

loading breqn package before biblatex gives warning

Post by Aardbei »

When I load the breqn package before the biblatex package it gives the following warning:

Package etoolbox Warning: Patching '\end' failed!
(etoolbox) '\AfterEndEnvironment' will not work.


This is using an updated MikTeX 1.9 and the driver used doesn't matter. Here's a small example:

Code: Select all

\documentclass{article}
\usepackage{breqn}
\usepackage[backend=biber]{biblatex}

\begin{document}
...
\end{document}
When loading the packages in reversed order the warning disappears. I thought this was so strange, since breqn seems unrelated to biblatex. So I had to make a forum post for it; maybe someone here knows what's going on...?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Aardbei
Posts: 13
Joined: Sun Mar 31, 2013 11:05 pm

loading breqn package before biblatex gives warning

Post by Aardbei »

While shifting things around in my preamble I discovered something funny. When you load the package etoolbox first then the warning disappears again:

Code: Select all

\documentclass{article}
\usepackage{etoolbox}
\usepackage{breqn}
\usepackage[backend=biber]{biblatex}

\begin{document}
...
\end{document}
I guess without looking deep into the source, there's really no way to figure out where the warning comes from. Oh well, at least it's gone now... I hope this benefits someone else who finds this topic.
Aardbei
Posts: 13
Joined: Sun Mar 31, 2013 11:05 pm

loading breqn package before biblatex gives warning

Post by Aardbei »

So I discovered yet another incompatibility with breqn: LuaTeX. My document doesn't compile with it, while it does with XeTeX. I don't know what's the reason this time. Maybe I'll hunt it down later. For now, this whole exercise in trying to automatically break equations has cost me more time than it gave me, so I'll stop using it and use the multline environment. Breqn first needs to solve its problems. ;)
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

loading breqn package before biblatex gives warning

Post by Johannes_B »

The above MWE compiles fine on my machine with LuaLaTeX, well, except for the warning you already mentioned.

Code: Select all

This is LuaTeX, Version beta-0.76.0-2013070317 (rev 4627)  (format=lualatex 2013.7.1)  23 OCT 2013 15:08
Are there any other warnings or errors?

Btw: I sent an email to the maintainers.

Best regards
Johannes
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Aardbei
Posts: 13
Joined: Sun Mar 31, 2013 11:05 pm

loading breqn package before biblatex gives warning

Post by Aardbei »

Okay, since you seem interested in solving this, I tracked it down. ;)

It's a combination of LuaTeX compilation with the breqn, mathtools and unicode-math packages, and the minipage environment. These give an error:

Undefined control sequence \end{minipage}

See the following example:

Code: Select all

\documentclass{article}
\usepackage{mathtools}
\usepackage{breqn}
\usepackage{unicode-math}

\begin{document}
\begin{minipage}{0.4\textwidth}
some text on a mini page
\end{minipage}
\end{document}
Compilation with Lua(La)TeX fails on my system, until one of the packages is removed, or the minipage is removed.
Go figure...

:)
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

loading breqn package before biblatex gives warning

Post by Johannes_B »

Try out this one:

Code: Select all

\documentclass{article}
\usepackage{mathtools}
\usepackage{unicode-math}
\usepackage{breqn}

\begin{document}
\begin{minipage}{0.4\textwidth}
	some text on a mini page
\end{minipage}
\end{document}
This gives

Code: Select all

Runaway argument?
 \RequirePackage {graphics}\@ifundefined {if_num:w}{\MH_let:NwN \if_num:w \ETC.
 ! File ended while scanning use of \next.
 <inserted text> 
 \par 
 l.51 }
     ^M
 ? 
breqn fiddles with catcodes and also uses the latex3-syntax, which is still officially experimental (though it is considered inofficially as stable).
I am not experienced with LaTeX3 or catcodes.

If the maintainers do not answer, maybe someone else can provide a fix hack.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

loading breqn package before biblatex gives warning

Post by cgnieder »

Do you need both breqn and unicode-math? Regarding the latter (quote Enrico Gregorio):
With unicode-math one can basically use only specially tailored OpenType math fonts such as Latin Modern Math, TeX Gyre Termes Math, TeX Gyre Pagella Math, XITS Math, Asana Math (among the free ones) or Cambria Math and Lucida Bright Math (not free).
Regarding your first post: this works:

Code: Select all

\documentclass{article}
\usepackage{biblatex}
\usepackage{breqn}
\begin{document}
foo
\end{document}
Regards
site moderator & package author
Aardbei
Posts: 13
Joined: Sun Mar 31, 2013 11:05 pm

loading breqn package before biblatex gives warning

Post by Aardbei »

Johannes_B wrote: breqn fiddles with catcodes and also uses the latex3-syntax, which is still officially experimental (though it is considered inofficially as stable).
I am not experienced with LaTeX3 or catcodes.

If the maintainers do not answer, maybe someone else can provide a fix hack.
It seems eigher breqn uses things that are a little too advanced for plain LaTeX2e, or something is just badly programmed. In any case, the package needs to get its act together to not cause all these random errors or warnings when otherwise perfectly normal constructs are used.

So I hope the maintainers respond, breqn has some nice features, not found elsewhere.
cgnieder wrote:Do you need both breqn and unicode-math?
I don't know, unicode-math doesn't provide much beyond being able to set Unicode fonts and their styles, right? If called without options, is there any benefit to the package, BTW?
cgnieder wrote: Regarding your first post: this works (...)
Yes I know, like I said in my post: "When loading the packages in reversed order the warning disappears." The errors I get in my fourth post using LuaLaTeX are actually much worse than that warning!
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

loading breqn package before biblatex gives warning

Post by cgnieder »

Aardbei wrote:It seems eigher breqn uses things that are a little too advanced for plain LaTeX2e,
Exactly. There are many warnings that breqn is incompatible with a lot of other packages on other forums like TeX.sx.
Aardbei wrote:or something is just badly programmed.
I wouldn't think so: two of the maintainers, Will Robertson and Joseph Wright, are part of the LaTeX3 development team so they surely are qualified LaTeX programmers. Michael J. Downes (RIP) has been a very versatile TeX programmer and both Morten Høgholm and Lars Mad­sen also are well known in the TeX community.
Aardbei wrote:
cgnieder wrote:Do you need both breqn and unicode-math?
I don't know, unicode-math doesn't provide much beyond being able to set Unicode fonts and their styles, right?
As I quoted in my earlier response: »With unicode-math one can basically use only specially tailored OpenType math fonts«. If you don't use such a font you won't need the package.

One rule I always follow is: I only load packages where I know exactly what they're for.
Aardbei wrote:
cgnieder wrote: Regarding your first post: this works (...)
Yes I know, like I said in my post: "When loading the packages in reversed order the warning disappears."
This is a very common thing for many LaTeX packages. There simply are too many for a package maintainer to foresee every account. Some packages are especially required to be loaded after others (thinking of hyperref, glossaries or cleveref...). This is especially true for packages that change some standard LaTeX behaviour like breqn does: incompatibilities are bound to happen...

Best
site moderator & package author
Aardbei
Posts: 13
Joined: Sun Mar 31, 2013 11:05 pm

loading breqn package before biblatex gives warning

Post by Aardbei »

cgnieder wrote: Exactly. There are many warnings that breqn is incompatible with a lot of other packages on other forums like TeX.sx.
I wonder if the minipage error was found ;)
cgnieder wrote: I wouldn't think so: two of the maintainers, Will Robertson and Joseph Wright, are part of the LaTeX3 development team so they surely are qualified LaTeX programmers. Michael J. Downes (RIP) has been a very versatile TeX programmer and both Morten Høgholm and Lars Mad­sen also are well known in the TeX community.
That's reassuring. :) I'm glad that this is probably caused by them looking ahead and using the newest code concepts etc.
cgnieder wrote: As I quoted in my earlier response: »With unicode-math one can basically use only specially tailored OpenType math fonts«. If you don't use such a font you won't need the package.

One rule I always follow is: I only load packages where I know exactly what they're for.
I have one reason now. I use the math-style=ISO option for ISO style (math bold face style for example)!
cgnieder wrote: This is a very common thing for many LaTeX packages. There simply are too many for a package maintainer to foresee every account. Some packages are especially required to be loaded after others (thinking of hyperref, glossaries or cleveref...). This is especially true for packages that change some standard LaTeX behaviour like breqn does: incompatibilities are bound to happen...

Best
Yes, I know that sometimes packages need to be loaded in a certain order, e.g. all things to do with internal links (the packages you mention). But in this case, the biblatex package seems unrelated to the breqn package, so I thought it's strange that the warning pops up.

In addition, that warning is not even what I'm concerned about anymore: it's the various kind of errors the breqn package apparently causes, using perfectly normal Latex constructs.
Last edited by Aardbei on Mon Oct 28, 2013 1:16 pm, edited 1 time in total.
Post Reply