Changes

Jump to navigation Jump to search
m
no edit summary
{{cmd|mainlanguage}}[en]
ConTeXt now understands that you will be using English and Ancient Greek. But you need to give it the right fonts to achieve this goal, bearing in mind that English and Ancient Greek do not use the same glyphs, even though some font families, such as TeX Gyre Pagella, are very versatile. So now you need to place the command for the Ancient Greek text. You will need to check that these fonts are available on your system. Refer to the Wiki page on installing and checking fonts, bearing in mind that installing them on your system from the Internet is not enough: they must also be supported by \ConTeXt. You can pass the following command in a console, in order to list all the installed fonts on your system :
{{code|mtxrun}} --script fonts --list --all
Or, in order to find a particular font, say GFS Didot :
{{code|mtxrun}} --script fonts --list --pattern=gfsdidot --all 
If you are sure to have previously installed some police, but you can see it, as a reminder, two commands are useful:
{{code|mtxrun}} --script cache --erase && mtxrun --generate
 and this one : {{code|mtxrun}} --script fonts --reload 
Again, if you are a beginner, read some documentation like which are listed here [[https://wiki.contextgarden.net/Documentation]]
You can choose between several fonts. In order to test them, you can write your preamble as follow (the "%" is to comment the line) :
Choose between Ipaexmincho 'ipaexmincho' font and 'NotoSansTC ' (Traditional Chinese)as follow : 
{{cmd|definefallbackfamily}} [mainface] [rm] [ipaexmincho] [range=cjkunifiedideographs]
{{cmd|definefallbackfamily}} [mainface] [rm] [notosanstc] [range=cjkunifiedideographs]
 
=== Define a font for Arabic ===
{{cmd|definefallbackfamily}}[mainface] [serif] [hussaininastaleeq] [range=arabic]
 
===Define the main text font ===
{{cmd|definefontfamily}}[mainface] [serif] [GFS Didot]
 
{{cmd|setupbodyfont}}[mainface]
 
== An example of mixed languages ==
There is below an example of 5 pages printed mainly in English, where you can find Ancient Greek, Traditional Chinese and Arabic. This text is more than a MWE (''Minimum Working Example''), because it also contains footnotes, a an header and a footer, as well as boxed a framed text. But even if at first glance this page seems difficult for a beginner, you can practise with the code on this page. Details: the Arabic text is printed correctly, i.e. from right to left. You can adjust the size of the text with a number of commands concerning the number of lines per page, the font size, etc. >Note : for some reason, each command here begin with 2 backslashes : one is enough ...
% ''We are writing an example of a text written in a Latin language, in which we want to print here and there some text in ancient Greek, Arabic and Chinese.(The sign '%' means that ConTeXT ignores the text or the command. It's a comment).''
{{cmd|setuplanguage}}[en][patterns={en,agr}]
{{cmd|setupbodyfontenvironment}}[default][em=italic]
% ''Use Theano Didot as Ancient Greek font'' 
{{cmd|definefallbackfamily}}[mainface][serif][Theano Didot][preset=range:greek, it={Old Standard Italic}, force=yes]
% ''Choose between Ipaexmincho font and NotoSansTC (Traditional Chinese)''
%''\definefallbackfamily [mainface] [rm] [ipaexmincho] [range=cjkunifiedideographs]<\pre>''
{{cmd|definefallbackfamily}} [mainface] [rm] [notosanstc] [range=cjkunifiedideographs]
 ''% Choose now between two Arabic fonts''  %''{{cmd|\definefallbackfamily}}[mainface] [serif] [nafeesnastaleeq] [range=arabic]''
{{cmd|definefallbackfamily}}[mainface] [serif] [hussaininastaleeq] [range=arabic]
{{cmd|setupcolors}}[state=start]
 
 
% ''Definition of the frame style (printed at the end of the document)''
{{cmd|defineframedtext}}
frame=off,
background=MyFrame,
''%width=\textwidth'',
width=max,
height=fit,
[Definition]
[headstyle=\bf\smallcaps]
 
% ''Using MPGraphic (MetaPost), with appropriate syntax''
{{cmd|startuseMPgraphic}}{MyFrame}
{{cmd|section}} {\sc Preamble}
 
% ''Main text in English''
When it comes to submitting a document in a national language (as English, or German, or French), everything is fine. When it comes to writing a slightly complex document in any Romance language, but with quotations — or references — in another language, which in particular does not have the same requirements as your own Romance language, nor the same {\em diacritical marks}, we run into a few difficulties. Software suites such as Microsoft Office or LibreOffice are not lacking in power, but the truth is that as soon as we get into the requirements and detail of professional publishing, which consists of presenting a readable text enriched (with notes, etc.), the situation quickly becomes technically rather difficult. The most common situation we encounter in Philosophy, History, or and more generally in the Humanities, is that of a text in which there are quotations from Greek or Latin authors, with references in footnotes, which contain Greek, or even Arabic, or any other language. It could be something like this sample:
 
% ''The quotation in ancient Greek is in a narrower style''
{{cmd|blank}}{{cmd|\startnarrower}}[1*left,1*right]\tfx\setupinterlinespace
{{cmd|startnarrower}}[1*left,1*right]\tfx\setupinterlinespace
% ''Here below, the Greek text is on the left columns; the English translation is on the right columns''
{{cmd|startTwoColumns}}
{{cmd|quotation}}
{Ἔφη γάρ οἱ Σωκράτη ἐντυχεῖν λελουμένον τε καὶ τὰς βλαύτας ὑποδεδεμένον, ἃ ἐκεῖνος ὀλιγάκις ἐποίει· καὶ ἐρέσθαι αὐτὸν ὅποι ἴοι οὕτω καλὸς γεγενημένος. καὶ τὸν εἰπεῖν ὅτι· Ἐπὶ δεῖπνον εἰς Ἀγάθωνος. χθὲς γὰρ αὐτὸν διέφυγον τοῖς ἐπινικίοις, φοβηθεὶς τὸν ὄχλον· ὡμολόγησα δ᾽ εἰς τήμερον παρέσεσθαι. ταῦτα δὴ ἐκαλλωπισάμην, ἵνα καλὸς παρὰ καλὸν ἴω}. {{cmd|\TwoColumns}} 
\quotation{I met Socrates," he said, "coming out of the bath with sandals on his feet, which is hardly his custom, and I asked him where he was going looking so good. He replied: "I'm going to Agathon's for dinner. Yesterday I avoided the party he gave in honour of his victory, because I was afraid of the crowds; but I promised to come the next day: that's why I dressed up; I wanted to look good so I could come to a good-looking man's house.}
{{cmd|stopnarrower}}
{{cmd|section}}{Éditing with \ConTeXT as an alternative to LaTeX} %''Note : if you want to transcript the words TeX, LaTeX and other TeX in the appropriate face, add a backslash before the word, like that : \LaTeX; \ConTeXt — an alternative}.''
Readers familiar with this type of language will have recognised from the previous paragraphs the brand name and technique used in the \TeX language. However, the use of this software relies on a fairly large set of declarations and it takes a great deal of practice to be able to play with, if not the power, at least the finesse of \LaTeX. There are a great many commands, and it is often necessary to refer to a manual to remember the subtleties that have made it possible to achieve a particular printed result. Of course, there is commercial software to help with professional publishing in the Humanities sector. But on the one hand they are not free and are relatively expensive for an individual, not to mention the cost of licences for professional groups of teachers and researchers.
Given this state of affairs, we can turn to \ConTeXt, which is not an alternative to \LaTeX, but a more synthetic (or even more elegant) way of using \LaTeX. \ConTeXt, like \LaTeX, is a software suite which contains the macros of \LaTeX, the routines of the {\em Perl} language, as well as the macros of \LuaTeX. It is therefore possible to define just about everything that is required for professional publishing, without going into the technical knowledge of the \LaTeX language. Of course, there are a number of technical issues to be addressed if you want to work with this type of tool: for mathematicians, perfect presentation and editing of complex equations, diagrams and tables requires a fairly advanced apprenticeship. This is also true for users who come from the humanities, who know their field, and who want to write a simple document, a journal article, or even entire chapters of an academic work. Very often, it is the publishers who take care of the layout of the document you want to publish, based on a Word style sheet. But sometimes, if it is a dossier of several articles, or even an edition with financial support for publication, you would like to have control over the quality of the printed document.
This is one of the reasons why you might want to control the editorial chain, not just to do without an editor, but to have an overview of your own work, or a collective work.
 
% ''Here below a paragraph which contains Chinese text and Arabic''
{{cmd|section}}{How to get Greek, Chinese and Arabic to coexist on the same page?}
{{cmd|stoptext}}
 
 
== See also ==
 
* [[Palatino_Linotype_under_MKIV]]
* [[Greek]]
* [[Arabic_fonts]]
* [[Arabic_and_Hebrew]]
* [[Chinese_Japanese_and_Korean]]
* [[CJK fonts]]
 
[[Category:Fonts]]
[[Category:Languages]]
48

edits

Navigation menu