4

I need to create a document with snippets in many languages - between 10 and 30 of them. I've seen people suggest XeLaTeX, but I'm working on a system that I don't have control over and that's a separate issue. For now, I'd like to do this on shareLaTeX. I started by trying babel

\documentclass{article}

    \usepackage[utf8]{inputenc}
    \usepackage[german, french, italian, spanish, portuguese, russian, arabic, hebrew, scottish, irish, english]{babel}
    \usepackage{CJKutf8} %for chinese, korean, japanese

\begin{document}

\begin{enumerate}
    \item one
    \item %\foreignlanguage{scottish}{ceithir}
    \item aon d\'eag %foreignlanguage{irish}{aon d\'eag}
    \item %\foreignlanguage{scottish}{fichead}
    \item fiche a c\'uig %foreignlanguage{irish}{fiche a c\'uig}
\end{enumerate}

\end{document}

but I exceed the default TeX capacity of shareLaTeX, presumably because I have too many languages. Hyphenation would be nice but isn't a hard requirement, and I realize I could typeset some languages without loading any packages. Should I be loading fonts instead for things like Cyrillic, Chinese, or Arabic? Should I be entering everything in hex or decimal unicode? I'll be on a mix of Windows and Linux machines, with an American QWERTY keyboard. What might be the best way for me to go about this?

  • I was in a similar situation, typesetting small pieces in multiple languages. It would have mostly been fine, but once you start playing with Hebrew all is lost and things begin to break all over. That is when I switched to XeLaTeX, which I suggest you do as well to keep your sanity. If you must, try using a single font that has all the characters that you need (Linux Libertine?) and forget about loading packages or hyphenation. If all you need to do is short fragments, that should be all. Enter things in UTF to make it all work. – ANSI C Mastah Feb 10 '15 at 16:54
  • @ANSICMastah Whether or not I have any sanity left to lose is another matter, but like I said, I'm almost certain I don't have an XeLaTeX option here. If Hebrew is the dealbreaker, I could in theory leave it out...I might just make some people mad... – aeroNotAuto Feb 10 '15 at 16:57
  • I just tried using no packages and typing UTF-encoded text, but you very quickly run into trouble. The best I can suggest is that you try babel for all languages and encode the file using UTF8. For languages that don't seem to work, like Hebrew, try using package that transliterates the relevant alphabet, like cjhebew. – ANSI C Mastah Feb 10 '15 at 17:15
  • @ANSICMastah Okay. Is there a way for me to load that many babel languages without exceeding the TeX capacity of shareLaTeX? I know if it were plots instead of languages, I can externalize them, for example. – aeroNotAuto Feb 10 '15 at 17:18
  • 1
    I am not familiar with shareLaTeX: @nplatis says that it does allow you access to XeLaTeX as a processor, and if so: use it! Then you simply type and text in UTF and watch your troubles go away. – ANSI C Mastah Feb 10 '15 at 17:26
3

With ShareLaTeX you do have the option to use XeLaTeX as your document processor, so you can work with a Unicode input file. In theory, this would allow you to input whatever characters you like and, provided you use a suitable font, have it compiled without too many troubles.

Given that ShareLaTeX is a web application, it is rather strange what you mention that you are working on a system that you don't have control over: you could work from any computer you like, or at least devise some strategies to overcome any limitations of that system (e.g., type difficult passages on another computer with a suitable "keyboard" installed, save them on a file and then simply copy and paste them into ShareLaTeX).

  • 1
    I am certainly capable of trying this on another computer; I am simply trying to avoid large amounts of effort or very risky things. I am merely using shareLaTeX as a stepping stone. I am not free to install anything on the actual system I'll be doing this on, nor can I transfer files from an outside USB drive. I also can't download attachments from things like Google Drive. Some of our offices aren't even allowed to have more than one computer with access to the internet. So "overcoming any limitations of that system" is different for different folks. – aeroNotAuto Feb 10 '15 at 17:36

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.