Re: cross-references sometimes spill past column boundary

2012-06-21 Thread Guenter Milde
On 2012-06-21, Justin Wood wrote:

 [-- Type: text/plain, Encoding: quoted-printable --]

 Hi all. I have a small problem when using the LyX 2 inbuilt thesis
 templates (KOMA-Script scrbook): in some instances, text lines that happen
 to finish with cross-references when paginated (justified text) are
 spilling past the normal column boundary. I've fiddled around with
 \renewcommand used to override the *autorefname, including reverting to
 default, but can't seem to resolve it. Offending cross-references are
 default \ref style, and I have not checked the Document Settings box to use
 refstyle over prettyref. Output is in XeTeX, although it was happening with
 LaTeX and inbuilt fonts as well (I think). Attached is a PDF extract
 showing the problem (second last paragraph).

It is standard TeX behaviour to let unbreakable words stick into the margin.
The LaTeX log shows warnings for every such line (often just tiny incursions
that can be ignored).

To find out whether it is a wrapping problem or a problem of the command,
you might experiment with giving the output of the \cite command directly in
place of it and see if this wraps well.

 Is this something of a known trap? Any suggestions much appreciated. I
 realise a sample .lyx file may also help, but these are pretty large and
 linked to a number of custom modules, plus a parent document, so I haven't
 attached one (yet). I'm hoping it's more of a general issue...

Try creating a minimal working example from the file, i.e. a test document
that has everyting that is not needed to reproduce the bug removed. Often
creating this example already helps towards a solution. In other cases it
allows interested people to experiment.

Günter



Re: cross-references sometimes spill past column boundary

2012-06-21 Thread Justin Wood
Justin Wood upasaka at gmail.com writes:


 At the moment I'm using:
  \renewcommand{\figureautorefname}{Figure~\negthinspace}
 
 I've tried replacing '~' with a simple space, with '\,' and '\ ' but it still
 doesn't break between 'Figure' and the ref label. Shouldn't that be possible?
 

Ahh, found the source of the problem. The thesis template includes
\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1

And \mbox prevents line breaks within the reference itself. Removing that
resolves the problem, and even hyphenates 'Figure'. Of course it was no doubt
added for good reason so I'll have to see what other consequences there are...





Re: cross-references sometimes spill past column boundary

2012-06-21 Thread Guenter Milde
On 2012-06-21, Justin Wood wrote:

 [-- Type: text/plain, Encoding: quoted-printable --]

 Hi all. I have a small problem when using the LyX 2 inbuilt thesis
 templates (KOMA-Script scrbook): in some instances, text lines that happen
 to finish with cross-references when paginated (justified text) are
 spilling past the normal column boundary. I've fiddled around with
 \renewcommand used to override the *autorefname, including reverting to
 default, but can't seem to resolve it. Offending cross-references are
 default \ref style, and I have not checked the Document Settings box to use
 refstyle over prettyref. Output is in XeTeX, although it was happening with
 LaTeX and inbuilt fonts as well (I think). Attached is a PDF extract
 showing the problem (second last paragraph).

It is standard TeX behaviour to let unbreakable words stick into the margin.
The LaTeX log shows warnings for every such line (often just tiny incursions
that can be ignored).

To find out whether it is a wrapping problem or a problem of the command,
you might experiment with giving the output of the \cite command directly in
place of it and see if this wraps well.

 Is this something of a known trap? Any suggestions much appreciated. I
 realise a sample .lyx file may also help, but these are pretty large and
 linked to a number of custom modules, plus a parent document, so I haven't
 attached one (yet). I'm hoping it's more of a general issue...

Try creating a minimal working example from the file, i.e. a test document
that has everyting that is not needed to reproduce the bug removed. Often
creating this example already helps towards a solution. In other cases it
allows interested people to experiment.

Günter



Re: cross-references sometimes spill past column boundary

2012-06-21 Thread Justin Wood
Justin Wood upasaka at gmail.com writes:


 At the moment I'm using:
  \renewcommand{\figureautorefname}{Figure~\negthinspace}
 
 I've tried replacing '~' with a simple space, with '\,' and '\ ' but it still
 doesn't break between 'Figure' and the ref label. Shouldn't that be possible?
 

Ahh, found the source of the problem. The thesis template includes
\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1

And \mbox prevents line breaks within the reference itself. Removing that
resolves the problem, and even hyphenates 'Figure'. Of course it was no doubt
added for good reason so I'll have to see what other consequences there are...





Re: cross-references sometimes spill past column boundary

2012-06-21 Thread Guenter Milde
On 2012-06-21, Justin Wood wrote:

> [-- Type: text/plain, Encoding: quoted-printable --]

> Hi all. I have a small problem when using the LyX 2 inbuilt thesis
> templates (KOMA-Script scrbook): in some instances, text lines that happen
> to finish with cross-references when paginated (justified text) are
> spilling past the normal column boundary. I've fiddled around with
> \renewcommand used to override the *autorefname, including reverting to
> default, but can't seem to resolve it. Offending cross-references are
> default \ref style, and I have not checked the Document Settings box to use
> refstyle over prettyref. Output is in XeTeX, although it was happening with
> LaTeX and inbuilt fonts as well (I think). Attached is a PDF extract
> showing the problem (second last paragraph).

It is standard TeX behaviour to let unbreakable words stick into the margin.
The LaTeX log shows warnings for every such line (often just tiny incursions
that can be ignored).

To find out whether it is a wrapping problem or a problem of the command,
you might experiment with giving the output of the \cite command directly in
place of it and see if this wraps well.

> Is this something of a known trap? Any suggestions much appreciated. I
> realise a sample .lyx file may also help, but these are pretty large and
> linked to a number of custom modules, plus a parent document, so I haven't
> attached one (yet). I'm hoping it's more of a general issue...

Try creating a "minimal working example" from the file, i.e. a test document
that has everyting that is not needed to reproduce the bug removed. Often
creating this example already helps towards a solution. In other cases it
allows interested people to experiment.

Günter



Re: cross-references sometimes spill past column boundary

2012-06-21 Thread Justin Wood
Justin Wood  gmail.com> writes:


> At the moment I'm using:
>  \renewcommand{\figureautorefname}{Figure~\negthinspace}
> 
> I've tried replacing '~' with a simple space, with '\,' and '\ ' but it still
> doesn't break between 'Figure' and the ref label. Shouldn't that be possible?
> 

Ahh, found the source of the problem. The thesis template includes
\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1

And \mbox prevents line breaks within the reference itself. Removing that
resolves the problem, and even hyphenates 'Figure'. Of course it was no doubt
added for good reason so I'll have to see what other consequences there are...