In most scientific journals, articles that contain foreign words or sentences, should be written in italic. In this case, I wrote an article in Indonesian, while the foreign word or phrase is the local language and English.
The first example, a respondent who was interviewed answered in the local language.
"Nggak!"
Nggak is the vocabulary of the Java language which means "not".
The second example, a technical term like: unduh (download).
Based on a @gopalakrishna-palem answer to this question (How to create a pre-processing command that accepts plain text and generates formatted text (based on configurable options)), I tried to define:
\def\KeyWords{
% local language
nggak,
% English
File, download,
}
But this solution only format the first occurrence of each keyword and requires that the words or sentences are placed in \def\MyText{}, for example:
\def\MyText{
"File nggak bisa di-unduh (download)."
}
Which will produce: "File nggak bisa di-unduh (download)." [that means "File can't be downloaded].
So, the problems are:
- How to write the word or sentence -that be formatted- as plain paragraphs?, and
- How to format the word are repeated?
\newcommand{\foreignword}[1]{\emph{#1}}and use that as\foreignword{File} \foreignword{nggak} bisa di-unduh (\foreignword{download}). Of course that is less automated, but somewhat clearer and more robust. – moewe Jan 02 '14 at 14:33\newcommand{\foreignword}[1]{\textbf{#1}}. In LaTeX one aims to use semantic markup using macros describe what is being shown not how it is to be typeset. – moewe Jan 02 '14 at 14:50