ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Line break after unit or \cite command
@ 2005-03-10 15:11 Michael Fuchs
  2005-03-10 15:16 ` Adam Lindsay
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Fuchs @ 2005-03-10 15:11 UTC (permalink / raw)


Hi!

I have some problems using units or cite commands in combination
with line breaks.

Using:

	... energies up to 3 \EVolt were measured ....

will produce no whitespace between "eV" and "were"

	... energies up to 3 eVwere measured .....


In order to get the space correct between the unit and 
the following word I inserted a "~" to ensure the space.
But this will not force the line break between the unit
and the following word when it is necessary. In that case
hypphenation will be used after the first syllable.

I encountered the same effect using the \cite command to 
reference bib-items but not to reference tables or pictures
with the \in command.

How can I create a space after the unit and have correct
line breaking at the same time?

Thanks

Michael

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Line break after unit or \cite command
  2005-03-10 15:11 Line break after unit or \cite command Michael Fuchs
@ 2005-03-10 15:16 ` Adam Lindsay
  2005-03-10 15:36   ` AW: " Michael Fuchs
  0 siblings, 1 reply; 15+ messages in thread
From: Adam Lindsay @ 2005-03-10 15:16 UTC (permalink / raw)


Michael Fuchs said this at Thu, 10 Mar 2005 16:11:10 +0100:

>How can I create a space after the unit and have correct
>line breaking at the same time?

Hallo, Michael.

This is a standard TeX thing. Follow the macro with "\ ".
(backslash-space). So:

	... energies up to 3 \EVolt\ were measured ....

The TeXBook (look in your local library) gives a pretty lucid description
of how this works...
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept.     atl@comp.lancs.ac.uk
 Lancaster University, InfoLab21        +44(0)1524/510.514
 Lancaster, LA1 4WA, UK             Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

^ permalink raw reply	[flat|nested] 15+ messages in thread

* AW: Line break after unit or \cite command
  2005-03-10 15:16 ` Adam Lindsay
@ 2005-03-10 15:36   ` Michael Fuchs
  2005-03-10 17:10     ` Patrick Gundlach
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Fuchs @ 2005-03-10 15:36 UTC (permalink / raw)


Hi Adam!

Thank you for your quick answer. But somehow the combination 
of backslash and space "\ " doesn't work for me at the moment.
I already tried that before with no effect and tried again
after your mail. I also tried \cMeter to check if it is 
dependent on the unit itself. Maybe it is helpfull to show you
the full sentence I use:

Im Energiebereich bis XXXX~\EVolt\ wurden die Ergebnisse der 
Kollaboration bestätigt.

ConTeXt breaks "wurden" in "wur"-"den".

Michael

> -----Ursprüngliche Nachricht-----
> Von: ntg-context-bounces@ntg.nl 
> [mailto:ntg-context-bounces@ntg.nl] Im Auftrag von Adam Lindsay
> Gesendet: Donnerstag, 10. März 2005 16:17
> An: mailing list for ConTeXt users
> Betreff: Re: [NTG-context] Line break after unit or \cite command
> 
> Michael Fuchs said this at Thu, 10 Mar 2005 16:11:10 +0100:
> 
> >How can I create a space after the unit and have correct
> >line breaking at the same time?
> 
> Hallo, Michael.
> 
> This is a standard TeX thing. Follow the macro with "\ ".
> (backslash-space). So:
> 
> 	... energies up to 3 \EVolt\ were measured ....
> 
> The TeXBook (look in your local library) gives a pretty lucid 
> description
> of how this works...
> -- 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>  Adam T. Lindsay, Computing Dept.     atl@comp.lancs.ac.uk
>  Lancaster University, InfoLab21        +44(0)1524/510.514
>  Lancaster, LA1 4WA, UK             Fax:+44(0)1524/510.492
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Line break after unit or \cite command
  2005-03-10 15:36   ` AW: " Michael Fuchs
@ 2005-03-10 17:10     ` Patrick Gundlach
  2005-03-10 17:47       ` AW: " Michael Fuchs
  0 siblings, 1 reply; 15+ messages in thread
From: Patrick Gundlach @ 2005-03-10 17:10 UTC (permalink / raw)


Hello Michael,


[...]

> Im Energiebereich bis XXXX~\EVolt\ wurden die Ergebnisse der 
> Kollaboration bestätigt.
>
> ConTeXt breaks "wurden" in "wur"-"den".

But then TeX thinks that there is feasible breakpoint between EVolt
and wurden. I'd write this 3\,\EVolt\ wurden. 

Patrick
-- 
ConTeXt wiki: http://contextgarden.net

^ permalink raw reply	[flat|nested] 15+ messages in thread

* AW: Re: Line break after unit or \cite command
  2005-03-10 17:10     ` Patrick Gundlach
@ 2005-03-10 17:47       ` Michael Fuchs
  2005-03-10 19:42         ` Peter Münster
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Fuchs @ 2005-03-10 17:47 UTC (permalink / raw)


Hi Patrick!

I want ConTeXt to produce the line break after the \EVolt 
command. The unit and following word together are extending 
the textwidth. Put TeX doesn't do the linebreak after the 
unit. Even using this "\ " macro doesn't have an effect on 
this behaviour!

Michael


> -----Ursprüngliche Nachricht-----
> Von: ntg-context-bounces@ntg.nl 
> [mailto:ntg-context-bounces@ntg.nl] Im Auftrag von Patrick Gundlach
> Gesendet: Donnerstag, 10. März 2005 18:10
> An: ntg-context@ntg.nl
> Betreff: [NTG-context] Re: Line break after unit or \cite command
> 
> Hello Michael,
> 
> 
> [...]
> 
> > Im Energiebereich bis XXXX~\EVolt\ wurden die Ergebnisse der 
> > Kollaboration bestätigt.
> >
> > ConTeXt breaks "wurden" in "wur"-"den".
> 
> But then TeX thinks that there is feasible breakpoint between EVolt
> and wurden. I'd write this 3\,\EVolt\ wurden. 
> 
> Patrick
> -- 
> ConTeXt wiki: http://contextgarden.net
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: AW: Re: Line break after unit or \cite command
  2005-03-10 17:47       ` AW: " Michael Fuchs
@ 2005-03-10 19:42         ` Peter Münster
  2005-03-10 22:15           ` AW: " Michael Fuchs
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Münster @ 2005-03-10 19:42 UTC (permalink / raw)


On Thu, 10 Mar 2005, Michael Fuchs wrote:

> I want ConTeXt to produce the line break after the \EVolt 
> command. The unit and following word together are extending 
> the textwidth. Put TeX doesn't do the linebreak after the 
> unit. Even using this "\ " macro doesn't have an effect on 
> this behaviour!
> > 
> > > Im Energiebereich bis XXXX~\EVolt\ wurden die Ergebnisse der 
> > > Kollaboration bestätigt.
> > >
> > > ConTeXt breaks "wurden" in "wur"-"den".

Hi Michael,
your "XXXX" must be just a little bit longer:

\def\EVolt{\,eV}
\starttext
\de
Im Energiebereich bis
33333333333333333333333333333333333333333333333333\EVolt\ wurden die
Ergebnisse der Kollaboration...
\stoptext

Cheers, Peter

-- 
http://pmrb.free.fr/contact/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* AW: AW: Re: Line break after unit or \cite command
  2005-03-10 19:42         ` Peter Münster
@ 2005-03-10 22:15           ` Michael Fuchs
  2005-03-11  8:41             ` Patrick Gundlach
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Fuchs @ 2005-03-10 22:15 UTC (permalink / raw)


Hi Peter!

I tried to make the XXX a little bit longer.
But unluckily I still don't have success with that. 
TeX only wants to insert the line break after the first
possible position after "wur" in the word "wurden". 
If I make the XXX long enough I even can push 

	XXXX~eV~wur-

out of the page limits.

Michael


> 
> > I want ConTeXt to produce the line break after the \EVolt 
> > command. The unit and following word together are extending 
> > the textwidth. Put TeX doesn't do the linebreak after the 
> > unit. Even using this "\ " macro doesn't have an effect on 
> > this behaviour!
> > > 
> > > > Im Energiebereich bis XXXX~\EVolt\ wurden die Ergebnisse der 
> > > > Kollaboration bestätigt.
> > > >
> > > > ConTeXt breaks "wurden" in "wur"-"den".
> 
> Hi Michael,
> your "XXXX" must be just a little bit longer:
> 
> \def\EVolt{\,eV}
> \starttext
> \de
> Im Energiebereich bis
> 33333333333333333333333333333333333333333333333333\EVolt\ wurden die
> Ergebnisse der Kollaboration...
> \stoptext
> 
> Cheers, Peter
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Line break after unit or \cite command
  2005-03-10 22:15           ` AW: " Michael Fuchs
@ 2005-03-11  8:41             ` Patrick Gundlach
  2005-03-11 10:34               ` AW: " Michael Fuchs
  0 siblings, 1 reply; 15+ messages in thread
From: Patrick Gundlach @ 2005-03-11  8:41 UTC (permalink / raw)


Hello Michael,

please post a complete example that we can try out [on
live.contextgarden.net]; currently we have to guess what is going on.

Patrick

-- 
ConTeXt wiki: http://contextgarden.net

^ permalink raw reply	[flat|nested] 15+ messages in thread

* AW: Re: Line break after unit or \cite command
  2005-03-11  8:41             ` Patrick Gundlach
@ 2005-03-11 10:34               ` Michael Fuchs
  2005-03-11 18:24                 ` Peter Münster
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Fuchs @ 2005-03-11 10:34 UTC (permalink / raw)


Hi Patrick!

Here is an example that shows the problem. I created it using 
live.contextgarden.net. The problem appears with standard and
german hyphenation.

Michael

-------------------------------------------
\starttext

    \version[temporary]
    \setuppapersize[A4][A4]
    \setupcolors[state=start]
    \setuplayout[
        backspace=25mm, topspace=10mm, header=10mm, headerdistance=5mm,
        width=middle, height=fit,
        footer=10mm, footerdistance=5mm, bottom=5mm]
    \language           [de]   % Switching to german hyphenation

\usemodule[units]

 \unit[keV]{\Kilo \EVolt}{kilo electronvolt}
 \unit[MeV]{\Mega \EVolt}{mega electronvolt}
 \unit[GeV]{\Giga \EVolt}{giga electronvolt}


In dieser Arbeit wurde die Reaktion ...... untersucht. Im
Energiebereich bis XXXXX~\MeV\ wurden die
Ergebnisse der Kollaboration bestätigt. Weiterhin
wurde erstmals der totale und der differentielle Wirkungsquerschnitt
der Reaktion für Photonenergien bis 3~\GeV\ bestimmt. Die Bestimmung
der Akzeptanz wurde mit einem neuen Verfahren durchgeführt, das die
Dynamik der Reaktion korrekt berücksichtigt.

\stoptext
-------------------------------------------

 

> Hello Michael,
> 
> please post a complete example that we can try out [on
> live.contextgarden.net]; currently we have to guess what is going on.
> 
> Patrick
> 
> -- 
> ConTeXt wiki: http://contextgarden.net
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: AW: Re: Line break after unit or \cite command
  2005-03-11 10:34               ` AW: " Michael Fuchs
@ 2005-03-11 18:24                 ` Peter Münster
  2005-03-11 19:15                   ` AW: " Michael Fuchs
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Münster @ 2005-03-11 18:24 UTC (permalink / raw)


On Fri, 11 Mar 2005, Michael Fuchs wrote:

> Here is an example that shows the problem. I created it using 
> live.contextgarden.net. The problem appears with standard and
> german hyphenation.

Nice example: now we see, that you are using the units-module.

Just to show you, what could be a minimal example, that shows the problem:

\usemodule[units]
\starttext
In dieser Arbeit wurde die Reaktion untersucht. Im Energiebereich bis
XXXXXXX~\EVolt\ wurden die Ergebnisse der Kollaboration bestätigt.
\stoptext

With these few lines, everything is clear. It seems to be an error in the
units-module.
Possible workaround: XXXXXXX~\EVolt\hbox{} wurden...

Cheers, Peter

-- 
http://pmrb.free.fr/contact/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* AW: AW: Re: Line break after unit or \cite command
  2005-03-11 18:24                 ` Peter Münster
@ 2005-03-11 19:15                   ` Michael Fuchs
  2005-03-13 17:48                     ` Patrick Gundlach
  2005-03-13 20:41                     ` AW: AW: " h h extern
  0 siblings, 2 replies; 15+ messages in thread
From: Michael Fuchs @ 2005-03-11 19:15 UTC (permalink / raw)


Hi everybody!

Sorry for the too long example. I wasn't sure what caused the 
problem and wanted to provide all relevant information at one 
time. I didn't mention the units module explicitly because I
have the same problem using the \cite command from the 
bib-module and I assumed, that it would be a more general 
problem.

The workaround with the \hbox{} does work. Is this some kind of
bug and will be fixed in the future? 

Thank you all for your help! :-))

Michael


> -----Ursprüngliche Nachricht-----
> Von: ntg-context-bounces@ntg.nl 
> [mailto:ntg-context-bounces@ntg.nl] Im Auftrag von Peter Münster
> Gesendet: Freitag, 11. März 2005 19:24
> An: mailing list for ConTeXt users
> Betreff: Re: AW: [NTG-context] Re: Line break after unit or 
> \cite command
> 
> On Fri, 11 Mar 2005, Michael Fuchs wrote:
> 
> > Here is an example that shows the problem. I created it using 
> > live.contextgarden.net. The problem appears with standard and
> > german hyphenation.
> 
> Nice example: now we see, that you are using the units-module.
> 
> Just to show you, what could be a minimal example, that shows 
> the problem:
> 
> \usemodule[units]
> \starttext
> In dieser Arbeit wurde die Reaktion untersucht. Im Energiebereich bis
> XXXXXXX~\EVolt\ wurden die Ergebnisse der Kollaboration bestätigt.
> \stoptext
> 
> With these few lines, everything is clear. It seems to be an 
> error in the
> units-module.
> Possible workaround: XXXXXXX~\EVolt\hbox{} wurden...
> 
> Cheers, Peter
> 
> -- 
> http://pmrb.free.fr/contact/
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Line break after unit or \cite command
  2005-03-11 19:15                   ` AW: " Michael Fuchs
@ 2005-03-13 17:48                     ` Patrick Gundlach
  2005-03-13 20:41                     ` AW: AW: " h h extern
  1 sibling, 0 replies; 15+ messages in thread
From: Patrick Gundlach @ 2005-03-13 17:48 UTC (permalink / raw)


Hello Michael,


[...]

> The workaround with the \hbox{} does work. Is this some kind of
> bug and will be fixed in the future? 

as a workaround, you can say

\usemodule[units]
\enablemode[atpragma]% warning, probably 10000s of side effects
\starttext
In dieser Arbeit wurde die Reaktion untersucht. Im Energiebereich bis
XXXXXXX \EVolt{} wurden die Ergebnisse der Kollaboration bestätigt.
\stoptext

But I'd consider this a bug (well, of course not a but, but more an
undocumented feature).

Patrick
-- 
ConTeXt wiki: http://contextgarden.net

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: AW: AW: Re: Line break after unit or \cite command
  2005-03-11 19:15                   ` AW: " Michael Fuchs
  2005-03-13 17:48                     ` Patrick Gundlach
@ 2005-03-13 20:41                     ` h h extern
  2005-03-14  9:59                       ` Patrick Gundlach
  2005-03-14 18:10                       ` AW: AW: " Peter Münster
  1 sibling, 2 replies; 15+ messages in thread
From: h h extern @ 2005-03-13 20:41 UTC (permalink / raw)


Michael Fuchs wrote:
> Hi everybody!
> 
> Sorry for the too long example. I wasn't sure what caused the 
> problem and wanted to provide all relevant information at one 
> time. I didn't mention the units module explicitly because I
> have the same problem using the \cite command from the 
> bib-module and I assumed, that it would be a more general 
> problem.
> 
> The workaround with the \hbox{} does work. Is this some kind of
> bug and will be fixed in the future? 
> 
> Thank you all for your help! :-))
> 
> Michael
> 
> 
> 
>>-----Ursprüngliche Nachricht-----
>>Von: ntg-context-bounces@ntg.nl 
>>[mailto:ntg-context-bounces@ntg.nl] Im Auftrag von Peter Münster
>>Gesendet: Freitag, 11. März 2005 19:24
>>An: mailing list for ConTeXt users
>>Betreff: Re: AW: [NTG-context] Re: Line break after unit or 
>>\cite command
>>
>>On Fri, 11 Mar 2005, Michael Fuchs wrote:
>>
>>
>>>Here is an example that shows the problem. I created it using 
>>>live.contextgarden.net. The problem appears with standard and
>>>german hyphenation.
>>
>>Nice example: now we see, that you are using the units-module.
>>
>>Just to show you, what could be a minimal example, that shows 
>>the problem:
>>
>>\usemodule[units]
>>\starttext
>>In dieser Arbeit wurde die Reaktion untersucht. Im Energiebereich bis
>>XXXXXXX~\EVolt\ wurden die Ergebnisse der Kollaboration bestätigt.
>>\stoptext
>>
>>With these few lines, everything is clear. It seems to be an 
>>error in the
>>units-module.
>>Possible workaround: XXXXXXX~\EVolt\hbox{} wurden...

the \hbox{} will introduce a space

your problem originates in tex not being able to break lines within the 
constraints, one optiion is to increase the tolerance

\showframe

\setuptolerance[verytolerant]

\usemodule[units]

\starttext

In dieser Arbeit wurde die Reaktion untersucht. Im Energiebereich bis
XXXXXXX \EVolt\ wurden die Ergebnisse der Kollaboration bestätigt.

\stoptext




-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Line break after unit or \cite command
  2005-03-13 20:41                     ` AW: AW: " h h extern
@ 2005-03-14  9:59                       ` Patrick Gundlach
  2005-03-14 18:10                       ` AW: AW: " Peter Münster
  1 sibling, 0 replies; 15+ messages in thread
From: Patrick Gundlach @ 2005-03-14  9:59 UTC (permalink / raw)


Hello Hans,

[...]

> your problem originates in tex not being able to break lines within
> the constraints, one optiion is to increase the tolerance
>
> \showframe
>
> \setuptolerance[verytolerant]

yuck! This leads to laaaarge space. There is a penalty after the unit,
I doubt that it should be there. 

Patrick
-- 
ConTeXt wiki: http://contextgarden.net

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: AW: AW: Re: Line break after unit or \cite command
  2005-03-13 20:41                     ` AW: AW: " h h extern
  2005-03-14  9:59                       ` Patrick Gundlach
@ 2005-03-14 18:10                       ` Peter Münster
  1 sibling, 0 replies; 15+ messages in thread
From: Peter Münster @ 2005-03-14 18:10 UTC (permalink / raw)


On Sun, 13 Mar 2005, h h extern wrote:

> >>Possible workaround: XXXXXXX~\EVolt\hbox{} wurden...
> 
> the \hbox{} will introduce a space

Really? I've tried

\starttext
XXX\hbox{}XXX
\stoptext

But I can't see any space...
Cheers, Peter

-- 
http://pmrb.free.fr/contact/

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2005-03-14 18:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-10 15:11 Line break after unit or \cite command Michael Fuchs
2005-03-10 15:16 ` Adam Lindsay
2005-03-10 15:36   ` AW: " Michael Fuchs
2005-03-10 17:10     ` Patrick Gundlach
2005-03-10 17:47       ` AW: " Michael Fuchs
2005-03-10 19:42         ` Peter Münster
2005-03-10 22:15           ` AW: " Michael Fuchs
2005-03-11  8:41             ` Patrick Gundlach
2005-03-11 10:34               ` AW: " Michael Fuchs
2005-03-11 18:24                 ` Peter Münster
2005-03-11 19:15                   ` AW: " Michael Fuchs
2005-03-13 17:48                     ` Patrick Gundlach
2005-03-13 20:41                     ` AW: AW: " h h extern
2005-03-14  9:59                       ` Patrick Gundlach
2005-03-14 18:10                       ` AW: AW: " Peter Münster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).