Is it possible in miktex, or texlive to manually store own characters, for example hiragana letters, in some text file and when we use the character it will look for it in file and display in pdf?

I noticed that some characters are not displayed, but they can be written in utf-8 encoding.

I think its like creating own language pack, but I need only specific characters to be displayed, and manually increasing number of needed symbols.

As we do in English, russian... we type character and it is displayed in pdf file, I want to type command to use characters from the file, type あ (for example hiragana character), and in file is shown あ.

I am using pdflatex.

  • Yes, it is possible. But your question if much to vage to be able to give some specific advice. – Ulrike Fischer Jun 9 '15 at 13:30

I assume you have one or more .otf font files each containing a few characters you need. You perhaps want to be able to use them with something like "this is character \bighat" assuming you have a character you wish to call bighat. If that is what you want, here is a bit of a recipe (I have copied my answer from my answer to a previous question and deleted it from there as it was not relevant there):

For this exercise we will use the font FontAwesome.otf (there is a package that uses this font but for this exercise we will roll our own). You will have your own font or fonts so you should do the same with each.

a) You want to be using XeLaTeX with fontspec.

b) You need to get the UTF codes for the chracters you will need. Here is one method - get the utility Babelmap (this is just one method, under Windows - you will need to find a different utility to explore your font if on a different OS). This is just to take a look at your font, it has nothing directly to do with this exercise.

c) You want the otf font version preferably but ttf is also OK.

d) You don't need to install the font (for this exercise). In babelmap menu go FONTS > ADD UNINSTALLED FONT. Navigate to where you put the font. On the main program screen select "single font" and then select FontAwesome as that single font.

e) Find the code point at which this font starts. In this case you can type F004 in the Go to code point box. If you type F7 or go to FONTS > FONT ANALYSIS UTILITY you can dump the font codes for this font to the clipboard.

f) If you look at the main screen you will see that F017 is a clock icon.

g) Create the following MWE file mwe.tex

% Compile using xelatex or lualatex

%\newfontfamily{\FA}[Path=../code/,Scale=.666]{FontAwesome.otf}%Do something like this to scale your font or if it is a different folder

\def\faclock{{\FA \symbol{"F017}}}%this is a clock
\def\mylittleclock{{\FA \faclock}}%lets give it a macro
%this is only one way to do it -- I prefer to separate these two aspects


Here is a Clock \mylittleclock


h) For this exercise, put the font in the same folder as mwe.tex and make sure it is named exactly FontAwesome.otf (and in the same case)

i) Compile. Voila!

enter image description here

If this is the sort of thing you want you would do it for all the characters/fonts you want, and then put the code somewhere and import it into documents where you want those macros to apply.

  • I am useing pdflatex. I don't understand instruction. I want following: when I type "あ" in document I want to be shown "あ". and manually modify character list. – Giorgi Jun 9 '15 at 14:34

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.