The url
package provides an interesting extra piece of flexibility, via the construct \Urlmuskip
. This specifies the spacing around the breakable characters. By default it is 0mu
however you can set it some glue specification:
\Urlmuskip=0mu plus 1mu
(Unfortunately the example in the url
manual is wrong. It says \Urlmuskip=0pt plus 1mu
. Being a mathematical skip expression the only units allowed are mu
.)
Anyway in your example this gives:
\documentclass[paper]{ieice}
\usepackage[hyphens]{url}
\usepackage[hidelinks]{hyperref}
\hypersetup{breaklinks=true}
\urlstyle{same}
\usepackage{cite}
\title{Test document}
\begin{document}
this\cite{upnp_spec} is a test\cite{android_javascriptinterface} \cite{Author:Title}
\Urlmuskip=0mu plus 1mu\relax
\bibliographystyle{plain}
\bibliography{refs_min}
\end{document}
with an extra entry in your bib
file.
Other things one might try to help in general include making the bibliography ragged right. The easiest way to this is just to write \raggedright
before your \bibliography
command.
Better ragged right formatting is provided by the ragged2e
package. Unfortunately your class defines the Center
environment that clashes with the ragged2e
, so in this case you would have to load it as follows:
\let\clsCenter\Center\let\clsendCenter\endCenter
\let\Center\undefined\let\endCenter\undefined
\usepackage{ragged2e}
\let\Center\clsCenter
\let\endCenter\clsendCenter
You could then issue \RaggedRight
just before your \bibliography
command. If there is text after the bibliography, you can turn on normal formatting again with the \justifying
command.
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
As the solution --- being explicit about the paper size --- suggests, it is likely there is a disconnect somewhere regarding the actual paper size ('letterpaper' vs 'a4paper'). The package
geometry
usually guesses well, but if it can't figure it out, it defaults to thedvips
driver, which may have different defaults from what you are actually using.Adding the
a4paper
option helps clear up any confusion, but if you want to explore your system defaults, there are a few options.An old classic is to do
and follow the prompts. It will output a document that shows clearly whether your defaults are what you think they are. If I use
a4paper
on my computer, which is set up to useletterpaper
by default, it is quite clear that the typeblock is positioned incorrectly.If you use a TeX Live that includes
tlmgr
(i.e., not one installed from your OS's repositories), then it is easy to check and also change what your paper defaults are.will list the default paper size for all drivers (ConTeXt, dvipdfmx, dvips, pdftex, xdvi). If you don't like what you can see, then you can do
This will change the default for all known drivers to
a4paper
(orletterpaper
). In the unlikely case that you'd like to exercise finer-grained control, you could do something liketo set a specific driver.