2

I am writing in org-mode and exporting to pdf via LaTeX. I am quite new to Emacs and org-mode, and not familiar with LaTeX, so I am flailing about on the following:

I would like for a small section of my text to be exported in a custom font which resides in my ~/.font directory (.ttf and .otf versions available).

  1. Can it be done?
  2. What tags/statements/syntax are used within the document?
  3. Do I need to alter the Emacs setup? (My Emacs version is 24.5.1.)

There is a related LaTeX question here, but it does not involve Emacs/org-mode. The answer mentioning XeLaTeX would seem to offer the simplest route, but I don't know how to integrate this with org-mode. I had a look at org-mode's documentation about embedded LaTeX - it seems to focus on math expressions, and I remain unclear as to whether something like font changing is supported, and then how.

Thanks for any insights.

  • 2
    You could have defined a LaTeX macro (the one given by myfont in the question you refer to). You'd use #+LATEX_HEADER: \newcommand*{\myfont}... in the beginning of the file, and later in the text you'd use \myfont{text rendered using my font}. – wvxvw Jun 15 '15 at 16:57
  • To use orgmode to produce a LaTeX document, while being new to Emacs, orgmode and LaTeX, is an approach which will almost surely fail. Organise your work with orgmode, read a book about LaTeX and start writing your document using LaTeX, using Emacs and AuCTeX. And even this is not easy, independently from your work. – Keks Dose Jul 15 '15 at 20:30
  • @KeksDose, it would be helpful if you can document or substantiate your claim that orgmode and LaTex approach fails. You also haven't said what is easy or hard. Based on your other comments, clicking a reference to get settings is hard for you. – Emacs User Jul 16 '15 at 14:46
  • @EmacsUser Diplora informs us to be a newbie regarding Emacs, orgmode and LaTeX. Obviously such a person isn't a hard boiled nerd, but someone who has heard of Orgmode and now struggels to get the needed pieces of software. However bright and educated someone is, this is a challenge! – Keks Dose Jul 16 '15 at 15:13
2

That custom font has to be first installed to your LaTeX configuration. Follow these instructions.

Then use the custom font in org-mode files as shown in the sample below. In org-mode, you should use C-e l p (which is export to LaTeX as PDF file) to see the custom font printed. The full complement of LaTeX font directives shown here can then be used with the custom font in your org-mode file.

**** Some org header

Some sample text in normal font followed by \customfont{text in
custom font} and then revert back to normal font.
  • This is not helpfull as long as you don't explain how and where to define a command and the syntax. – Keks Dose Jul 15 '15 at 20:26
  • @KeksDose the instructions link shows the exact command. What part of that did you find unhelpful? – Emacs User Jul 16 '15 at 14:51
  • Sorry, but the "instructions" are a bad joke. Installing a new font in LaTeX is really difficult. Try on your own, I bet you never did. – Keks Dose Jul 16 '15 at 15:10
  • @KeksDose, I can see how you think the inventor of TeX gives notes that one of his students at Stanford posts those instructions and you think it is a joke? Unbelievable. – Emacs User Jul 17 '15 at 18:09
  • 1
    @KeksDose and Emacs User: please be constructive. – Dan Jul 17 '15 at 19:31

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.