Line break after unit or \cite command
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
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 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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
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
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
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/
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
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
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
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/
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
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
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 -----------------------------------------------------------------
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
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/
participants (5)
-
Adam Lindsay
-
h h extern
-
Michael Fuchs
-
Patrick Gundlach
-
Peter Münster