Proceedings of the asmeconf International Examples Congress and Exposition AIECE21 January 20, 2021, Cambridge, MA

AIECE2021-0002

LANGUAGE SUPPORT IN ASMECONF: NON-LATIN ALPHABETS, LUALATEX, AND FONTSPEC

∗ John H. Lienhard V1,

1Department of Mechanical Engineering Massachusetts Institute of Technology, Cambridge, MA

ABSTRACT other scripts, additional steps are needed. The asmeconf class This note describes the use of asmeconf to format multilin- handles this differently under pdfLATEX and LuaLATEX. gual documents in Latin or non-Latin alphabets. Font support encompasses the Arabic, Chinese, Greek, Hindi, Japanese, Ko- 3. NON-LATIN SCRIPTS UNDER PDFLATEX rean, Marathi, Russian, and Tamil languages, among others. For When using pdfLATEX, asmeconfwill load appropriate fonts asian alphabets, LuaLATEX and fontspec are employed. The for Greek, Vietnamese, and certain cyrillic- languages (see system fonts that must be installed for fontspec are listed, and Table 1). The user can give the corresponding class option and examples of simple abstracts are shown in twenty-five languages. then call for a change of language as described in Section 6. No Keywords: asmeconf, language support, non-Latin alpha- additional work is required. bets, fontspec, LuaLATEX To access a broader range of fonts, asmeconf can be used under LuaLATEX, with fontspec. In that case, asmeconf will 1. INTRODUCTION: WHY HAVE THIS? employ fonts that are installed in the user’s , The asmeconf class [1] provides a template for formatting rather than LATEX fonts. conference papers submitted to the American Society of Mechan- ical Engineers. The goal of adding language support to asmeconf 4. SYSTEM FONTS is to enable authors to include translations of a paper’s abstract The fontspec package [3] allows LuaLATEX to access fonts or brief quotations in languages other than English. Although that are installed on the user’s system. Today, these fonts are the entire asmeconf template may, in principle, be switched to normally in , a 16-bit format that allows a font to contain another language without modifying the class file, I have not ex- a vast number of glyphs—up to 216. Multiple languages can be plored this option in much detail. These language capabilities are contained within a single font. Specialized unicode fonts are ded- experimental, and their future development will be guided by the icated to particular languages, especially those such as Japanese feedback that I receive from authors. that have many thousands of characters. When processed in pdfLATEX, asmeconf uses the newtxtext 2. THE BABEL PACKAGE and fonts, a collection of eight-bit fonts, for Latin The typesetting of languages is handled by the babel pack- script. To use fontspec, we must replace those fonts with cor- age [2], which is called by the asmeconf class. For many responding unicode fonts (the math fonts, from newtxmath, are languages, babel includes language definition (.ldf) that unchanged). Specialized fonts are needed for some additional provide information about section or caption titles, hyphenation scripts. Thus, the user will need to install several unicode fonts rules, and so on. When an .ldf exists, babel will recognize onto their own system in order to use asmeconf with fontspec. the language as a global option that can be passed as an option Fortunately, all these fonts are all free and easily downloaded. to asmeconf, assuming that an appropriate font is available. A The needed fonts are listed in Table 2. list of the many languages with .ldf files is given in the babel documentation. 5. USING FONTSPEC WITH ASMECONF For languages in Latin scripts, it’s usually safe to assume that When running LuaLATEX, the [fontspec] option should be the font is present, and many such languages have .ldf files. For called, to load the appropriate fonts. With fontspec, babel will ∗Corresponding author: [email protected] use .ldf files (if available) and separate initialization files(.ini). Version 1.0, January 18, 2021 If a language option is called for which there is no .ldf file, an

1 TABLE 1: Languages in non-Latin scripts for which asmeconf is provide language support under fontspec require an up-to-date known to provide font support. Class options that must be called LATEX distribution (2020 or later). 3) The features described here are shown. require asmeconf version 1.22 or later (2021). Language Option pdfLAT X LuaLAT X E E 7. ABSTRACTS Arabic bidi=basic X Examples of abstracts in various languages now follow. Belarusian belarusian XX Reading the source . file for this document may clarify the Bengali — X syntax. Bulgarian bulgarian XX Chinese — X 摘要 Greek greek XX 这是文章的摘要。我们用中文书写,描述了问题,方法和结果, Hindi — X 还包括了参考文献。 Japanese japanese X Korean — X 摘 要 Macedonian macedonian XX 這是文章的摘要。我們用中文書寫,描述了問題,方法和結果, Marathi — X 還包括了參考文獻。 Russian russian XX ∗ Serbian serbianc XX 摘 要 Tamil — X 係文嘅摘要。我哋用中文書寫,描述了問題,方法同結果,仲 Ukrainian ukrainian XX 包括埋參考文獻。 Vietnamese vietnamese XX ∗ Serbian option [serbianc], for both engines, uses cyrillic. In RESUMEN pdfLATEX, use \selectlanguage{serbianc}. In LuaLATEX, instead se- Este es el resumen del artículo. Escribimos en español. Se lect “serbian-cyrillic”. describen el problema, los métodos y los resultados. También se incluyen referencias. error will result. However, such languages may still have an .ini ABSTRACT that provides necessary information. For example, Chinese and This is the summary of the article. We write in English. Korean do not have .ldf files, but they do have .ini files. These The problem, methods, and results are described. References languages can be accessed as described in Section 6. are also included. Japanese typesetting is a little more complicated. When [japanese] is given as an option to the class, asmeconf calls the luatexja-fontspec package [4], which is a specialized module सारांश for typesetting Japanese. यह िहदी मे िलखे गए एक लेख का सारांश है। समया, िविधयो और पिरणामो When captions and the like are not needed (as for short pas- का वणॄन िकया गया है। संदभॄ भी शािमल है। sages), babel can load many languages “on the fly”, with only a basic call in the .tex file (see Section 6), if an appropriate font is সারসংক্প available. এ綿 নিবন্র সংক্প্তসার। আমরা বাংলা ভাষা붼 লিখি। সমস্য, পদ্ধতি What about support for scripts not shown in Table 2? Macros এবং ফলাফল বর্না করা হ붼। উল্খ巁লিও অন্তরভ্ ক্তয় র ছে। from babel for adding fonts can be placed into the preamble صخلم of your document. The babel package supports roughly 250 متي.جئاتنلاوقرطلاوةلكشملافصومتي.ةيبرعلاببتكن.لاقملاصخلموهاذه languages, and asmeconf has been tried with only about thirty. .ًاضيأعجارملانيمضت 6. HOW TO CALL A LANGUAGE A language is called by \begin{selectlanguage}{}, RESUMO where is the lower-case name of the language. For Este é o resumo do artigo. Escrevemos em português. O example, suppose that a Spanish language abstract is desired. problema, métodos e resultados são descritos. Referências The user puts [spanish] as a global option (this language has também estão incluídas. an .ldf file), and then writes: АННОТАЦИЯ \begin{selectlanguage}{spanish} \begin{abstract*} Это резюме статьи. Пишем по русски. Описаны проблема, методы и результаты. Библиография так- Este es el resumen del artículo… \end{abstract*} же включена. \end{selectlanguage} 概要 Nota Bene: 1) Your .tex file must be saved in utf-8 この論文の日本語での要約は以下のとおりです。問題、方 encoding. Some operating systems default to a different encod- 法、および結果が説明されています。参考資料も添付してあり ing that will garble unicode characters. 2) The features used to ます。

2 TABLE 2: System fonts used by asmeconf with fontspec. For all fonts, load regular and bold face. For Latin, Cyrillic, and Greek, also load italic and bold italic. For Noto Sans Arabic, install semibold instead of bold.

Script Language Fonts Where to get the font Latin∗ most European languages Tex Gyre Termes, http://www.gust.org.pl/projects/e-foundry/tex-gyre Tex Gyre Heros Arabic Arabic, Punjabi, Urdu, others , https://github.com/alif-type/amiri Noto Sans Arabic https://github.com/googlefonts/noto-fonts Bengali Assamese, Bengali, others Noto Bengali, https://github.com/googlefonts/noto-fonts Noto Sans Bengali Cyrillic Belarusian, Bulgarian, Noto Serif, https://github.com/googlefonts/noto-fonts Macedonian, Russian, Noto Sans, Serbian, Ukrainian, others Noto Sans Mono Hindi, Kashmiri, Marathi, Noto Serif Devanagari, https://github.com/googlefonts/noto-fonts Nepali, Sanskrit, others Noto Sans Devanagari Greek Greek Noto Serif, Noto Sans, https://github.com/googlefonts/noto-fonts Noto Sans Mono Korean Noto Serif CJK KR, https://github.com/googlefonts/noto-fonts Noto Sans CJK KR, Noto Sans Mono CJK KR Japanese Japanese Noto Serif CJK JP, https://github.com/googlefonts/noto-fonts Noto Sans CJK JP, Noto Sans Mono CJK JP Simplified Mandarin Noto Serif CJK SC, https://github.com/googlefonts/noto-fonts Chinese Noto Sans CJK SC, Noto Sans Mono CJK SC Tamil Tamil, others Noto Serif Tamil, https://github.com/googlefonts/noto-fonts Noto Sans Tamil Traditional Traditional Mandarin, Noto Serif CJK TC, https://github.com/googlefonts/noto-fonts Chinese Cantonese Noto Sans CJK TC, Noto Sans Mono CJK TC ∗ The Latin fonts are required with asmeconf+fontspec, even if English is the only language called. Install others as needed.

सारांश gebnisse werden beschrieben. Der Beitrag enthält auch ein Li- हा लेखाचा सारांश आहे. आपण मराठीत िलिहत आहो. ह्यात समया , पद्धती teraturverzeichnis. आिण पिरणामाचे वणॄन केले आहेत. संदभॄ देखील समिवष्ट आहेत. சாரா믍ச믍 ÖZET Bu, makalenin özetidir. Türkçe yazıyoruz. Sorun, yön- இ鏁 கட்翁ரையின் 毁쏁க்கம். நாங்கள் தமிழில் temler ve sonuçlar açıklanmaktadır. Referanslar da dahildir. எ폁鏁கி�றோம். சிக்கல், 믁றைகள் மற்쟁ம் 믁羿ퟁகள் விவரிக்கப்பட்翁ள்ளன. 埁றிப்ꯁக쿁ம் சேர்க்கப்பட் 초록 翁ள்ளன. 이것은 한국어로 쓰인 논문의 초록입니다. 문제, 방법 및 결 과가 설명되어 있습니다. 참조도 포함됩니다. TÓM TẮT NỘI DUNG Đây là phần tóm tắt của bài báo khoa học. Chúng tôi viết RÉSUMÉ bằng tiếng Việt. Vấn đề, các phương pháp và các kết quả được Ceci est le résumé de l’article. Il est écrit en français. Le mô tả trong phần này. Tài liệu tham khảo cũng được bao gồm. problème, les méthodes et les résultats sont décrits. Des réfé- rences sont également incluses. SOMMARIO ZUSAMMENFASSUNG Questo è il riassunto dell’articolo. Scriviamo in italiano. Hier ist die Zusammenfassung des Beitrags. Wir schrei- Vengono descritti il problema, i metodi e i risultati. Sono in- ben auf Deutsch. Die Fragestellung, die Methoden und die Er- clusi anche i riferimenti.

3 RINGKASAN a comma by putting \newcolumntype{d}[1]{D{,}{,}{#1}} in Ini adalah ringkasan dari artikel tersebut. Kami menu- the preamble. lis dalam bahasa Indonesia. Masalah, metode, dan hasil di- I have not explored this usage in detail, and I would welcome jelaskan. Referensi juga disertakan. comments from authors who attempt such conversions.

STRESZCZENIE 9. CONCLUSION To jest podsumowanie artykułu. Piszemy po polsku. Opi- asmeconf has multilingual capabilities under both pdfLATEX sano problem, metody i wyniki. Literatura źródłowa zostanie and LuaLATEX. In particular, with fontspec, asmeconf can sup- udostępniona. port a wide range of scripts and languages within a LATEX envi- ronment. These capabilities are largely experimental, and their MUHTASARI future development will be guided by feedback that I receive from Huu ni Muhtasari wa makala. Tunaandika kwa those using these features. Kiswahili. Matatizo, Mbinu na matokeo yameelezewa. Marejeleo pia yamejumuishwa. 10. AKNOWLEDGMENTS Thanks to everyone who helped me sort out the translated АНОТАЦІЯ abstracts: Leon Awerbuch, Debanjan Banerjee, George Bar- Це короткий зміст статті. Пишемо українською bastathis, Svetlana Boriskina, Jacopo Buongiorno, Hyung Won мовою. Описана проблема, методи та результати. Chung, Aslı Demir, Vibhawari Deshmukh, Zi Hao Foo, Turga Стаття включає список використаної літератури. Ganapathy, Steven Gerasimoff, Christine Gervais, Igo Krebs, Omar Labban, Nguyen Le, Bora Mikić, Judith Mmari, Aarón ΠΕΡΙΛΗΨΗ Montoya-Moraga, Thao Nguyen, Yoshiki Okamoto, Danyal Αυτή είναι η περίληψη του άρθρου. Χρησιμοποιούμε Rehman, Yagnaseni Roy, Jaichander Swaminathan, Gregory την ελληνική γλώσσα. Περιγράφεται το πρόβλημα, οι μέ- Thiel, and Keiji Yano. All were generous with their time. θοδοι και τα αποτελέσματα. Περιλαμβάνονται επίσης ανα- φορές. REFERENCES [1] John H. Lienhard, V. “asmeconf: A template for ASME САЖЕТАК conference papers.” Version 1.22. Comprehensive TEX Ово је резиме чланка. Пишемо на српском. Описани Archive Network (2021). Accessed January 18, 2021, URL су проблем, методе и резултати. Укључене су и рефе- https://ctan.org/pkg/asmeconf. ренце. [2] Braams, Johannes L. and Bezos, Javier. “babel: Localiza- tion and internationalization.” Version 3.52. Comprehensive SUMMARIUM TEX Archive Network (2020). Accessed January 3, 2021, Hoc argumentum in articulum. Latine scribere nobis. URL https://ctan.org/pkg/babel. Quaestio est, modi, et describit eventus qui. Alia sunt opera [3] Robertson, Will. “The fontspec package: Font selection for citatis. LuaLATEX and X LE ATEX.” Version 2.7i. Comprehensive TEX Archive Network (2020). Accessed January 5, 2021, URL 8. CHANGING THE LANGUAGE OF THE ENTIRE https://ctan.org/pkg/fontspec. DOCUMENT [4] LuaTEX-ja project team. “The LuaLATEX-ja package.” Ver- The main language of the document is English by default. sion 20210103.0. Comprehensive TEX Archive Network This means that section headings, captions, and other words cho- (2021). Accessed January 5, 2021, URL https://ctan.org/ sen by macros will be in English. pkg/luatexja. To chose a different main language, give the option [5] Carlisle, David. “The dcolumn package.” Version 1.06. [main=..] [main=french] , e.g., . The standard caption and Comprehensive TEX Archive Network (2014). Accessed Jan- section names will follow babel’s dictionary for the language uary 8, 2021, URL https://ctan.org/pkg/dcolumn. chosen. Users may additionally change “Keywords”, “Nomen- clature”, “Corresponding author”, and “Joint first authors” by renewing the commands \keywordname, \nomname, \CAwords, and \JAwords. Changes to the page footer are described in the asmeconf documentation [1]. The pdf bookmark for “Appen- dices” may be changed by renewing \appendicesname. (See the babel documentation [2, §1.15] if the dictionary for the main language lacks the correct word for, say, abstractname). Note that some languages make characters active, which can have unexpected effects. For example, Spanish makes “.” an ac- tive character, which clashes with the default dcolumn decimal separator, d{n.m} [5]. \spanishdeactivate{.} stops this be- havior. Alternatively, the decimal separator can be changed to

4