Answers to the question linked in domwass's comment mention the package url
. This package is already loaded by biblatex
. It is configured with the command \biburlsetup
defined in biblatex.def
.
URLs are broken at the set of characters specified in \UrlBreaks
, \UrlBigBreaks
and \UrlSpecials
. \UrlBigBreaks
will prevent breaks from occurring between repeating characters (e.g. --
and ::
in the code below). \UrlSpecials
handles breaks at characters that may not be present in the document font.
Upgrading to the latest version of biblatex
should solve your problem as \biburlsetup
was expanded in version 1.4c
to permit breakpoints at many different characters. For reference here is the definition for \biburlsetup
from version 1.7
:
\newcounter{biburlnumpenalty}
\newcounter{biburlucpenalty}
\newcounter{biburllcpenalty}
\newcommand*{\biburlsetup}{%
\Urlmuskip=0mu plus 3mu\relax
\mathchardef\UrlBigBreakPenalty=100\relax
\mathchardef\UrlBreakPenalty=200\relax
\def\UrlBigBreaks{\do\:\do\-}%
\def\UrlBreaks{%
\do\.\do\@\do\/\do\\\do\!\do\_\do\|\do\;\do\>\do\]\do\)\do\}%
\do\,\do\?\do\'\do\+\do\=\do\#\do\$\do\&\do\*\do\^\do\"}%
\ifnumgreater{\value{biburlnumpenalty}}{0}
{\def\do##1{\appto\UrlSpecials{\do##1{\mathchar`##1 \penalty\value{biburlnumpenalty}}}}%
\do\1\do\2\do\3\do\4\do\5\do\6\do\7\do\8\do\9\do\0}
{}%
\ifnumgreater{\value{biburlucpenalty}}{0}
{\def\do##1{\appto\UrlSpecials{\do##1{\mathchar`##1 \penalty\value{biburlucpenalty}}}}%
\do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J
\do\K\do\L\do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T
\do\U\do\V\do\W\do\X\do\Y\do\Z}
{}%
\ifnumgreater{\value{biburllcpenalty}}{0}
{\def\do##1{\appto\UrlSpecials{\do##1{\mathchar`##1 \penalty\value{biburllcpenalty}}}}%
\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j
\do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t
\do\u\do\v\do\w\do\x\do\y\do\z}
{}%
\let\do=\noexpand}
Unlike versions 1.4c
to 1.6
, this new definition no longer allows breakpoints at numbers, uppercase letters and lowercase letters by default. Breaks at these characters can be permitted by setting the penalty counters to a value between 0
and 10000
, exclusive. For example:
\setcounter{biburlnumpenalty}{100}
\setcounter{biburlucpenalty}{100}
\setcounter{biburllcpenalty}{100}
The penalties can be reset locally using the command \defcounter
from the etoolbox
package (also loaded by biblatex
). For example:
\defcounter{biburlnumpenalty}{3000}
\defcounter{biburlucpenalty}{6000}
\defcounter{biburllcpenalty}{9000}
To use this new setup with an older version of biblatex
, just put the code defining \biburlsetup
and its penalty counters in your preamble and replace \newcommand
with \renewcommand
.
you've already separated the different elements, providing spaces between the distinct equations comprising each language and separately coding these equations as math (even
though the space between the first two is, probably inadvertently, omitted).
unfortunately, these spaces don't fall in a place that is optimal for tex to break the line.
the ultimate goal is for what is presented to be understood.
there are two parts to this recommendation.
first, the words "milk, curry, rice" are, as you say, constants, and as such should be
in a text font, preferably not italic in this context, even though they're part of the
math expression. as coded in your original, they are typeset as strings of variables
multiplied together. these could be coded as \mathrm{<word>}
, but that doesn't help
with line breaking. it also wouldn't leave spaces after the commas, although in this
situation, whether spaces are visible there or not wouldn't be misunderstood by a reader.
another way to approach these is to recognize them as text, and input them as, for example,
$\mathcal{C}_o=\{\text{milk, curry, rice}\}$
but this doesn't help with line breaking either, since in this context, the only
"allowable" break is after the equals sign.
so, second part of suggestion, take advantage of the fact that a reader isn't likely
to misunderstand what is meant if a line is broken within that string of constants,
and (temporarily) terminate the math after the opening brace, and reinstate it for the
ending brace:
$\mathcal{C}_o=\{$milk, curry, rice$\}$
to illustrate, using a forced line break for the "all math" instance, compare these
two lines:
here's the input that produced the image:
\begin{itemize}
\item The language of enquiry $\mathcal{L}$ is given by
$\mathcal{C}_o=\{milk, curry, rice\}$,\\
$\mathcal{R}_o=\{TastesHot, IsWhite, ContainsSpice, ContainsSugar\}$,
$\mathcal{F}_o=\{\}$.
\item The language of enquiry $\mathcal{L}$ is given by
$\mathcal{C}_o=\{$milk, curry, rice$\}$,
$\mathcal{R}_o=\{$TastesHot, IsWhite, ContainsSpice, ContainsSugar$\}$,
$\mathcal{F}_o=\{\}$.
\end{itemize}
(by the way, that's hardly a minimal example.)
Best Answer
I'm not sure what is causing the problem in the first place, but
pdflatex
gives the desired output without any fuss whatsoever. The issue seems to be reproducible only with alatex dvipdf
orlatex dvips ps2pdf
build pattern. The DVI produced bylatex
exhibits this issue (viewed underxdvi
), so it is no wonder that the trailing build processes fail.A better solution must yet exist, but using
pdflatex
in the first place circumvents the issue for the most part. (The hyphenation patterns leave much to be desired.)latex
output: (DVI screenshot viewed underxvdi
; the red line is the page edge)pdflatex
output: