Code Comments
Programming Forum and web based access to our favorite programming groups.I don't know if anyone in these newsgroups uses Arabtex to produce
documents involving Arabic, but I'm wondering if anyone might have a
solution to my problem:
I need to provide hyphens in my transliteration of arabic words to
separate parts of the words(i.e. morphemes), while not having those
hyphens break up the Arabic words themselves. Arabtex provides this
capability by allowing the user to insert hyphens in the input which
aren't shown in the Arabic output, but do come out in the
transliteration. However, tehre is one problem with this- if the hyphen
preceded a vowel, then Arabtex treats everything after the hyphen(even
in the Arabic text) as a new word and therefore provides an alif for the
vowel. This is not a desirable outcome for me, as the hyphens occur
within words to break apart morphemes. For example, I give the following
input:
\RL{al-muwa.z.zaf-UN}
which produces the first two parts as expected,but adds an alif to the
plural ending, so it looks like alif-waw-nun, which obviously isn't
correct. The transliteration, however, is correct.
Is there any way to trick Arabtex into not thinking this is a new word,
or to alter it in such a way that I can get the results I want? I will
be using hyphens in this way extremely frequently in the next few months.
Thanks!
Post Follow-up to this messageIn article <dn5kvg$i7a$1@news.doit.wisc.edu>, Alexander Magidow <amagidow@wisc.edu> wrote: > I need to provide hyphens in my transliteration of arabic words to > separate parts of the words(i.e. morphemes), while not having those > hyphens break up the Arabic words themselves. I never managed to get Arabtex up and running (though honestly, I didn't try very hard, since I didn't have a pressing need for it), so I can't tell you whether there is a way to do it in Arabtex. However, if you can't find a way to do the hyphenation you want within Arabtex proper, can you just turn off Arabtex's automatic transliterations and put your own in by hand? It would of course require inputing the words twice, but you might be able to get around that with a macro (though this may not work if the placement of your manual transliterations would require individualized tweaking). Nathan -- Nathan Sanders Linguistics Program Williams College http://wso.williams.edu/~nsanders/
Post Follow-up to this messageNathan Sanders wrote: > In article <dn5kvg$i7a$1@news.doit.wisc.edu>, > Alexander Magidow <amagidow@wisc.edu> wrote: > > > > > I never managed to get Arabtex up and running (though honestly, I > didn't try very hard, since I didn't have a pressing need for it), so > I can't tell you whether there is a way to do it in Arabtex. > > However, if you can't find a way to do the hyphenation you want within > Arabtex proper, can you just turn off Arabtex's automatic > transliterations and put your own in by hand? It would of course > require inputing the words twice, but you might be able to get around > that with a macro (though this may not work if the placement of your > manual transliterations would require individualized tweaking). > > Nathan > Well, since it does all sorts of nice(and fancy) underdotting, it might in the long run be simpler to just make a macro with two arguments- the first as input for the arabic output, the second with the input for the transliterated output, where I could put all the hyphens I want. I was just hoping there might be a more elegant solution.
Post Follow-up to this messageIn article <dn6rke$88l$1@news.doit.wisc.edu>, Alexander Magidow <amagidow@wisc.edu> wrote: > Well, since it does all sorts of nice(and fancy) underdotting, it might > in the long run be simpler to just make a macro with two arguments- the > first as input for the arabic output, the second with the input for the > transliterated output, where I could put all the hyphens I want. I was > just hoping there might be a more elegant solution. With a bit of work (that I unfortunately don't know how to do), you could make a single-argument macro that takes just the hyphenated input and strips out all the hyphens before turning it into Arabic (and of course, leaves them for the transliteration. Nathan -- Nathan Sanders Linguistics Program Williams College http://wso.williams.edu/~nsanders/
Post Follow-up to this messageAlexander Magidow wrote: > > Nathan Sanders wrote: > > Well, since it does all sorts of nice(and fancy) underdotting, it might > in the long run be simpler to just make a macro with two arguments- the > first as input for the arabic output, the second with the input for the > transliterated output, where I could put all the hyphens I want. I was > just hoping there might be a more elegant solution. You could ask Jonathan Rodgers about his translation of Fischer's grammar. He said it was _very_ difficult to work with TeX and took a very long time. (Is there a reason not to use MSWord, which supports r-to-l input?) -- Peter T. Daniels grammatim@att.net
Post Follow-up to this messageIn article <43970DD3.5D67@worldnet.att.net>, "Peter T. Daniels" <grammatim@worldnet.att.net> wrote: > (Is there a reason not to use MSWord, Just one? No. I have never had to pay to use TeX (and certainly didn't have to pay an Evil Heartless Monopoloy(TM)), TeX documents written on a Windows machine don't mysteriously lose symbols when opened on a Mac simply because of differences in the operating system, my TeX documents will not reformat themselves (changing hyphenation or even pagination) based on what printer I'm connected to, my computer has never gotten a virus from opening a TeX document, nor have any of my TeX files become irreversibly "corrupt", forcing me to start over from a previous version. I can't say the same for Word. As for the typographical issues, the imagine linked below shows the string "Tafi" as it appears in Word and in TeX: http://wso.williams.edu/~nsanders/comparison.jpg Note Word's lack of proper kerning between "T" and "a" and its lack of an automatic "fi" ligature. Word's basic text formatting is inexcusably bad, and that's without even considering hyphenation or mathematical formulas! Word generally does produce nicer tables, though. Nathan -- Nathan Sanders Linguistics Program Williams College http://wso.williams.edu/~nsanders/
Post Follow-up to this message> Word generally does produce nicer tables, though. Each time I recieve a Word document with a table, I tremble. The table is formated in such a cryptic way that modifying it is quite impossible. I have to make a new one, and input the info there. The output isn=B4t very pleasing either, visually speaking. Gabriel
Post Follow-up to this messageGabriel Guernik wrote: > > > Each time I recieve a Word document with a table, I tremble. The table > is formated in such a cryptic way that modifying it is quite > impossible. I have to make a new one, and input the info there. The > output isnīt very pleasing either, visually speaking. FrameMaker makes excellent tables. Unfortunately it doesn't do r-to-l, and Adobe will not adapt it to OS X. They bought it up so as to destroy the competition with its own products, but PageMaker and InDesign aren't made for creating large books. There is _no_ replacement for FrameMaker. But 7.2 for Windows is a pretty good emulation of the last Mac version. -- Peter T. Daniels grammatim@att.net
Post Follow-up to this messageNathan Sanders wrote: > In article <43970DD3.5D67@worldnet.att.net>, > "Peter T. Daniels" <grammatim@worldnet.att.net> wrote: > > > > > Just one? No. > > I have never had to pay to use TeX (and certainly didn't have to pay > an Evil Heartless Monopoloy(TM)), TeX documents written on a Windows > machine don't mysteriously lose symbols when opened on a Mac simply > because of differences in the operating system, my TeX documents will > not reformat themselves (changing hyphenation or even pagination) > based on what printer I'm connected to, my computer has never gotten a > virus from opening a TeX document, nor have any of my TeX files become > irreversibly "corrupt", forcing me to start over from a previous > version. > > I can't say the same for Word. > > As for the typographical issues, the imagine linked below shows the > string "Tafi" as it appears in Word and in TeX: > > http://wso.williams.edu/~nsanders/comparison.jpg > > Note Word's lack of proper kerning between "T" and "a" and its lack of > an automatic "fi" ligature. Word's basic text formatting is > inexcusably bad, and that's without even considering hyphenation or > mathematical formulas! > > Word generally does produce nicer tables, though. > Actually I would differ even on that- the tables in Latex are REALLY nice to work with- I just produced two last night, one in Arabic, one transliterated(same table, actually, but I couldn't fit both in one...its complicated, don't ask) However, I couldn't figure out how to restrict the width of the table to a certain amount(preferably the width of the dominant text) in such a way that it would force the cells which were overful to expand vertically rather than horizontally. Surely there's a way... I use OpenOffice.org for some document processing, but since I'm writing a very lengthy senior thesis involving both English and Arabic, I decided a normal word processor would be much more of a headache than the difficulties I encountered learning Latex- I can't abide randomly shifting text, magical changes of typeface, etc. As for your idea of how to write a macro in latex that would strip out hyphens(well, hyphens not proceeded by alif laam, perhaps), I think this would be an optimal solution. However, I don't know how to write such complex macros in Latex- if you could give me a link to a webpage that would explain parsing,conditionals, etc in latex, that'd be great. I have a programming background which should help me understand any more intensive code. > Nathan >
Post Follow-up to this messageIn article <dn8006$rsa$1@news.doit.wisc.edu>,
Alexander Magidow <amagidow@wisc.edu> wrote:
> Nathan Sanders wrote:
>
> Actually I would differ even on that- the tables in Latex are REALLY
> nice to work with- I just produced two last night, one in Arabic, one
> transliterated(same table, actually, but I couldn't fit both in
Well, there are some aspects of Word's tables I really like, such as
borders and shading. I haven't tried any packages for tables, but the
default LaTeX table borders are ugly and inflexible if you need more
than single lines and there is no cell shading.
> one...its complicated, don't ask) However, I couldn't figure out how to
> restrict the width of the table to a certain amount(preferably the width
> of the dominant text) in such a way that it would force the cells which
> were overful to expand vertically rather than horizontally. Surely
> there's a way...
\tabular{p{3in}}
will produce a column of width 3 inches, fitting the overflow as if it
were a regular paragraph of that width. I'm not sure how to get the
width to be equal to the width of a text string, though.
> I use OpenOffice.org for some document processing, but since I'm writing
> a very lengthy senior thesis involving both English and Arabic, I
> decided a normal word processor would be much more of a headache than
> the difficulties I encountered learning Latex- I can't abide randomly
> shifting text, magical changes of typeface, etc.
Absolutely agree. I wish I had done that for my dissertation. Since
I was writing on OT phonology, I had tons of complex tables that just
screamed out to be corrupted by Word 98. Luckily, that particular bug
was fixed in Word X, which I managed to upgrade to halfway through.
(And I had already gone through the agony of losing hours of writing
to the Complex Table Bug, so I was prepared. Rather than relying on
Word's normal backup protocols, I had three or four true backup files
that I rotated through, to ensure that when the CTB struck---and it
did---I would actually be able to open an uncorrupted backup file.)
> As for your idea of how to write a macro in latex that would strip out
> hyphens(well, hyphens not proceeded by alif laam, perhaps), I think this
> would be an optimal solution. However, I don't know how to write such
> complex macros in Latex- if you could give me a link to a webpage that
> would explain parsing,conditionals, etc in latex, that'd be great. I
> have a programming background which should help me understand any more
> intensive code.
I don't think you need a conditional. Use different symbols to mark
hard hyphens versus morpheme boundaries, say - and +. Then have the
macro edit the string twice separately, one for each of the two
outputs: delete + and then translate into Arabic script, and change +
into - and then transliterate.
So, something like \arabic{abc-def+ghi} would come out as if you had
used abc-defghi for Arabic and abc-def-ghi for transliteration.
I don't how to do character substitution like that in LaTeX, though.
I don't think LaTeX has anything sed-like built into it, but there
must be a package out there that does.
A search at CTAN reveals the substr.sty package, which appears to deal
with substrings of strings, but I don't know how useful it would be in
this case.
Nathan
--
Nathan Sanders
Linguistics Program
Williams College
http://wso.williams.edu/~nsanders/
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.