4

I'm trying to highlight a syllable within a word in order to show that it is different from another word. How can I do this with * in org-mode and then properly export to LaTeX?

I'm on Windows 7 32-bit, Emacs 24.4.1 (i686-pc-mingw32), Org-mode version 8.2.10. I have followed the instructions on this page but something went wrong with Org -- it thinks an *.org file is a LaTeX file! I therefore had to comment out those lines in my .emacs configuration file. The lines I'm talking about are these:

(setcar org-emphasis-regexp-components " \t('\"{[:alpha:]")
(setcar (nthcdr 1 org-emphasis-regexp-components) "[:alpha:]- \t.,:!?;'\")}\\")
(org-set-emph-re 'org-emphasis-regexp-components org-emphasis-regexp-components)

I don't know why, but they don't work with my emacs. Are they still valid? Can anyone help me out, please? By the way I have this same question open on StackOverflow (here)

Screenshots

This is the structure of vocab.org. It has LaTeX tags at the bottom of the file so that when I export only the body as vocab.tex, it doesn't have problems recognizing vocab-main.tex as its master file. vocab-main.tex is a file containing all the font and page formatting that make the final pdf look good to the eyes.

vocab.org file structure

  • Can you switch to org-mode? (M-x org-mode) – JeanPierre Dec 28 '15 at 22:42
  • Yes that works...temporarily only! At every restart of emacs, the problem reappears -- the text is white (I have opted for a dark emacs color-theme), as if it's plain text, no special Org-mode hooks applied to it. How do I fix it for good? – WobblyWindows Dec 29 '15 at 13:20
  • I don't know what's going wrong here but another solution is to use a zero width space character as described here – JeanPierre Dec 29 '15 at 14:54
  • 1
    From this discussion, it sounds like what you really want to do is have *.org files open in org-mode by default, is this correct? If so, you can add (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) to your init file – elethan Dec 29 '15 at 14:56
  • @elethan I don't have a proper configuration for Org-mode since I usually work with AUCTEX but please have a look at my .emacs file (see above). I placed the new lines right at the bottom. Is it correct? Maybe that's the problem. – WobblyWindows Dec 29 '15 at 16:12
6

The figure you added in the question explains everything! You have the line

mode: latex

in your file-local variables of the file vocab.org. And latex-mode is exactly what you get!

If you need these lines in your org-file you should add a line with only the special form-feed character ^L in it right after #+END_LATEX. You can input the form-feed character by typing C-q C-L or C-q C-l (after C-q uppercase or lowercase letter L with control key pressed).

File local variables are searched from the end of the file. The form-feed character limits this search forcefully.

The end of your file should look like in the following picture. Note the ^L in the picture! It should be marked by some color as control character.

enter image description here

  • Wait a minute, I lost you there. How should it look then? #+BEGIN_LaTeX: %%% Local Variables: %%% mode: latex %%% TeX-master: "vocab-main" %%% End: #+END_LaTeX ^L Is it correct? Is ^L on the following new line? 'Cause it still doesn't see it as an org file and I have to type M-x org-mode... – WobblyWindows Dec 30 '15 at 11:11
  • Yes, the character sequence is (insert "\n\014\n") in lisp. – Tobias Dec 30 '15 at 11:16
  • Just saw your edit. Re-wrote those tags, now things seems fine. – WobblyWindows Dec 30 '15 at 11:18

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.