[tex-hyphen] Why does "\-" not work?

Claudio Beccari claudio.beccari at gmail.com
Sun Aug 21 14:22:50 CEST 2016


Dear Adrian,
I took the code you submitted to the group; Since none of your source 
files are included, I commented all your entries in the \includeonly 
list and all \include statements; I did not even enter the T1 option, 
since the default should be OT1, which works well with Englis, but not 
with German; so you should should expressly enter that option of you 
have even a single short stretch of Greman text.
In any case I added the call at the kantlipsum package to generate 
sensible text taken form Kant's writings (lispum generates random text 
in a sort of pig Latin that I totally dislike); in you class statement I 
deleted the oneside option, which is there for compatibility with other 
standard classes, but that is quite off in a book; I added the twocolumn 
option in order to have a narrower line width for typesetting. Finally I 
ran the compilation with pdflatex and hyphenation is working "britishly" 
(which you may like or not, but it works perfectly). The source file I 
used is as such:

% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = pdflatex

\documentclass[12pt, a4paper,twocolumn]{book}
%\includeonly{%
%Introduction2WelcomeToEssex,%
%WelcomeToEssex,%
%DiscoverMascara,%
%%Envy,%
%Wedlock,%
%%Future,%
%%Plenty,%
%StrayDog,%
%%Shame,%
%TheFrenchLady,%
%ThePregnantReceptionist,%
%Bliss,%
%ThePunter,%
%}
\pagestyle{headings}

\author{\href{mailto:Adrian at TransnationalRepublic.org}{Adrian\ 
Fisipojakene}}
\title{Beletristics}
\date{\today}

\usepackage[utf8]{inputenc}
\usepackage[german,british]{babel}
\usepackage{cjhebrew}
\usepackage{graphicx}

\usepackage{url}
\usepackage[authoryear,round,semicolon]{natbib}
\makeindex

\usepackage{makeidx}
\usepackage{fontenc}%  Attention: without encoding option!
\usepackage{lmodern}
\usepackage{textcomp}
\usepackage{verbatim}

\usepackage[pdftex,unicode=true,%
bookmarks,plainpages=false]{hyperref}

\usepackage{kantlipsum}

\begin{document}
%\showthe\language
\kant[1-4]
%\frontmatter
%\maketitle
%\include{Introduction2WelcomeToEssex}
%\include{Introduction2Sundry}
%
%\mainmatter
%
%\include{WelcomeToEssex}
%\include{DiscoverMascara}
%\include{Envy}
%\include{Wedlock}
%\include{Future}
%\include{Plenty}
%\include{StrayDog}
%\include{Shame}
%\include{TheFrenchLady}
%\include{ThePregnantReceptionist}
%\include{Bliss}
%\include{ThePunter}
%
%\backmatter
%\printindex
%\bibliographystyle{named}
%\bibliography{../../bibliographies/Beletristics.bib}
\end{document}

Therefore I assume that if hyphenation is not working with your example, 
the trouble should be in the source files you are using. It is not in 
the preamble and in the document settings. It might be a question of 
encoding, or of a non existent language specification, or any other 
detail that cannot be deduced from the information you gave us.
I suppose you might get better help from stackexchange 
(http://tex.stackexchange.com/), the public international forum 
suggested by any TeX Users Groups, in particular from the American TUG.
Claudio


On 21/08/2016 09:44, Adrian Fronda wrote:
> Dear Claudio,
>
> Thank you for trying to help me. Much appreciated.
>
> I thought
> \usepackage{fontenc}
> presupposes a T1 as a default encoding option. Anyway, I added T1 explicitly, but no automatic hyphenating and no reaction to my own hyphenating with «\-» happened.
>
> Do you have any other idea?
>
> Many thanks for your time,
> Adrian
>
>
>> On 20 Aug 2016, at 18:32, Claudio Beccari <claudio.beccari at gmail.com> wrote:
>>
>> I don't a really important part in your code: you load package fontenc, but you do not specify any encoding option; I do not know exactly what fontenc without encoding option does, but it may be the cause of your problem. Add option [T1] to that call as in
>>
>> \usepackage[T1]{fontenc}
>>
>> and try again.
>> Claudio
>>
>> On 20/08/2016 17:16, Barbara Beeton wrote:
>>> On Sat, 20 Aug 2016, Adrian Fronda wrote:
>>>
>>>      Dear all,
>>>
>>>      I apologise for being a beginner to LaTeX and asking a question which in the eyes of many might appear stupid.
>>>
>>>      Anyway, I need some help with hyphenating, and I think this is the best place for asking questions of that nature.
>>>
>>> without actual text to experiment with,
>>> it's difficult to actually do anything.
>>> however, i noticed one thing:  you have
>>> specified british hyphenation with babel,
>>> but you haven't chosen a language to use
>>> in the processing.  the babel documentation
>>> should tell you how to do that.  even so,
>>> i'm a bit surprised that \- doesn't do
>>> anything useful.
>>>
>>> phil taylor has, in another message,
>>> explained why \hyphenation{word} in the
>>> text doesn't give the desired result.
>>> 					-- bb
>>>
>>>      I have a root file containing the following:
>>>      ???????????????????????????????????????????
>>>      \documentclass[14pt, oneside, a4paper]{book}
>>>      \includeonly{%
>>>      Introduction2WelcomeToEssex,%
>>>      WelcomeToEssex,%
>>>      DiscoverMascara,%
>>>      %Envy,%
>>>      Wedlock,%
>>>      %Future,%
>>>      %Plenty,%
>>>      StrayDog,%
>>>      %Shame,%
>>>      TheFrenchLady,%
>>>      ThePregnantReceptionist,%
>>>      Bliss,%
>>>      ThePunter,%
>>>      }
>>>      \pagestyle{headings}
>>>
>>>      \author{\href{mailto:Adrian at TransnationalRepublic.org}{Adrian\ Fisipojakene}}
>>>      \title{Beletristics}
>>>      \date{\today}
>>>
>>>      \usepackage[utf8]{inputenc}
>>>      \usepackage[german,british]{babel}
>>>      \usepackage{cjhebrew}
>>>      \usepackage{graphicx}
>>>
>>>      \usepackage{url}
>>>      \usepackage[authoryear,round,semicolon]{natbib}
>>>      \makeindex
>>>
>>>      \usepackage{makeidx}
>>>      \usepackage{lmodern}
>>>      \usepackage{textcomp}
>>>      \usepackage{verbatim}
>>>
>>>      \usepackage{fontenc}
>>>      \usepackage[pdftex,unicode=true,%
>>>      bookmarks,plainpages=false]{hyperref}
>>>
>>>      \begin{document}
>>>      \frontmatter
>>>      \maketitle
>>>      \include{Introduction2WelcomeToEssex}
>>>      \include{Introduction2Sundry}
>>>
>>>      \mainmatter
>>>
>>>      \include{WelcomeToEssex}
>>>      \include{DiscoverMascara}
>>>      \include{Envy}
>>>      \include{Wedlock}
>>>      \include{Future}
>>>      \include{Plenty}
>>>      \include{StrayDog}
>>>      \include{Shame}
>>>      \include{TheFrenchLady}
>>>      \include{ThePregnantReceptionist}
>>>      \include{Bliss}
>>>      \include{ThePunter}
>>>
>>>      \backmatter
>>>      \printindex
>>>      \bibliographystyle{named}
>>>      \bibliography{../../bibliographies/Beletristics.bib}
>>>      \end{document}
>>>      ???????????????????????????????????????????
>>>      No hyphenation happens spontaneously in the included files. If I use ?\-?, again, no hyphenation happens where it should. If I use \hypenation{word} inline, then the whole word disappears. I'd very much prefer to be able to use ?\-?, but I would put up with any other solution.
>>>
>>>      Can anybody help?
>>>
>>>      Many thanks
>>>      Adrian
>>>
>>>



More information about the tex-hyphen mailing list