0

I want to define for greek a command/shortcut similar to the german |, which inserts minimal space and marks the (by far) preferred point for hyphenation. Additionally I need a second command/shortcut like the first which does not allow for hyphenation at this point. Everything I tried failed: In the best case it does nothing, in the worst case it inserts | and in the very worst case eledmac and eledpar break (though ledmac and ledpar work). As I have used \/ and \| throughout the document, I'd be glad if I could define these commands in the appropriate way without replacing them. The MWE is my latest attempt, which fails as usual. (It is somewhat longer, because I need some interaction with eledmac/eledpar)


\documentclass{scrbook}
\usepackage{savesym}
\usepackage[LGR,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[main=ngerman,greek]{babel}
\languageattribute{greek}{polutoniko}
\usepackage[GlyphNames]{teubner}
\savesymbol{breve}
\usepackage[osf,sc]{mathpazo}
\ifFamily{pplj}{porson}
\usepackage{calc}\usepackage{ragged2e}
\usepackage[nonegthinspace,twothirds]{thinsp}
\usepackage{eledmac}
\usepackage{eledpar}
\usepackage[babel,kerning=true,tracking=true]{microtype}
\makeatletter
\newcommand{\SOK}{\makebox[\widthof{FAI.}][r]{\textgreek{\scshape SW.}}\makebox[\widthof{xx}][r]{}}
\newcommand{\PHAI}{\makebox[\widthof{FAI.}][r]{\textgreek{\scshape FAI.}}\makebox[\widthof{xx}][r]{}}
renewcommand{\,}{\thinspace\linebreak[1]}
%%now it comes (this is the latest attempt, which failed like all others
\addto\extrasgreek{
   \let\|\relax
   \let\/\relax
   \newcommand*{\/}{\discretionary{-}{}{\kern.08em}\linebreak[2]}
   \renewcommand*{\|}{\ifmmode\mskip1mu\else\kern.08em\linebreak[0]\fi}
    }
\makeatother
\begin{document}
\begin{pages}
\begin{Leftside}
  \selectlanguage{polutonikogreek}
   \beginnumbering
   \autopar
   SWKRATHS\quad\>\~W f\ia le Fa\ic dre,  po\ic{}d\hg{} ka\ig{} p\oa\/jen?

   \textsc{SWKRATHS}\quad Par\ag{} Lus\ia ou, \wsc{} S\wa krates, to\uc{}  Kef\aa lou, pore\ua omai d\eg{} 
   pr\oG s per\ia\/paton \esa xw te\ia qous; suqn\oG n g\ag r \es ke\ic{}  di\/\ea\/triya qr\oa non 
   kaj\/\ha menos \es x \er w\/jino\uc. t\wci{} d\eg{} s\wci{} ka\ig{} \es m\wci{} \er ta\ia r\wi{} 
   peij\oa menos \>Akoumen\wci{} kat\ag{} t\ag s \oR do\ug s poio\uc mai to\ug s peri\/p\aa tous; 
   fhs\ig{} g\ag r \as\|kopwt\ea rous e\isc nai t\wc n \es n to\ic s dr\oa mois.

   \SOK Kal\wc s g\aa r, \wsc{} \er ta\ic re, l\ea gei. \as t\ag r Lus\ia as \hsc n, 
    \wr s \esa\|oiken, \es n \asa stei?

   \PHAI Na\ia, par''\,\>Epi\/kr\aa tei, \es n t\hci\/de t\hci{} plhs\ia on to\uc{} 
   \>Olump\ia ou o\is k\ia\ai{} t\hci{} Moruq\ia\ai.

   \SOK T\ia s o\usc n d\hg{} \hsc n \hr{} dia\/trib\ha? \hsg{} d\hc lon \ora\|ti t\wc n 
   l\oa gwn \ur m\ac s Lus\ia as e\ir st\ia a?

   \PHAI Pe\ua s\hi, e\isa{} soi sqol\hg{} pro\/\id\oa nti \as ko\ua ein.

   \SOK T\ia{} d\ea? o\us k \asg n o\isa ei me kat\ag{} P\ia ndaron  ((ka\ig{}  \as\|sqol\ia as 
   \ur p\ea r\/teron)) pr\ac gma poi\ha sesjai t\oG{} s\hg n te ka\ig{} Lus\ia ou dia\/trib\hg n \as ko\uc sai?

   \PHAI Pr\oa\/age d\ha.

   \SOK L\ea gois \asa n.

   \PHAI Ka\ig{} m\ha n, \wsc{} S\wa\/krates, prosv\/\ha kousa g\ea{} soi \hr{} \as ko\ha; \oR{} 
   g\aa r toi l\oa gos \hsc n, per\ig{} \org n di\/e\|tr\ia bomen, o\us k o\isc d''\,\ora n\/tina 
   tr\oa pon \es rwtik\oa s. g\ea\/grafe g\ag r d\hg{} \oR{} Lus\ia as peir\wa men\oa n tina t\wc n kal\wc n, 
   o\us q \ur p''\,\es rasto\uc{} d\ea, \as ll''\,a\us t\oG{} d\hg{} to\uc to ka\ig{} ke\/k\oa myeutai; 
   l\ea gei g\ag r \wr s qarist\ea on m\hg{} \es r\wc nti m\ac llon \hsg{} \es r\wc nti.
   \pend
  \endnumbering
  \end{Leftside}
  \begin{Rightside}
  \selectlanguage{ngerman}\beginnumbering\autopar
  \emph{Sokrates} bla

  \emph{Phaidros} bla

  \emph{Sokrates} bla

  \emph{Phaidros} bla

  \emph{Sokrates} bla

  \emph{Phaidros} bla

  \emph{Sokrates} bla

  \emph{Phaidros} bla

  \emph{Sokrates} bla

  \emph{Phaidros} bla
  \pend
  \endnumbering
  \end{Rightside}
  \Pages
  \end{pages}
\end{document}
  • Greek characters (χαρακτῆρες) instead of teubner-glyphs (qarak\hc res) shouldn't make a difference. – Alexander Wittmann Oct 10 '14 at 8:54
  • 1
    Your macros are not being used. You have added them to the greek language environment definitions, but then you are starting a polutonikogreek environment. They are different! Try it with \addto\extraspolutonikogreek{...}. – Thruston Oct 10 '14 at 11:02
  • I am not sur to understand your need. But in any case you should try without eledmac to see if the problem is made by eledmac or not. (I think not, because eledmac use the default line splitting of tex). – Maïeul Oct 10 '14 at 11:02
  • @Maïeul: One solution worked with ledmac -- it didn't actually work, but it caused no harm --, but eledmac broke. – Alexander Wittmann Oct 10 '14 at 11:38
  • @Thruston: I though polutonikogreek activates \extrasgreek, but I'll try it. – Alexander Wittmann Oct 10 '14 at 11:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.