emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* exporting α/β to latex/pdf
@ 2014-05-04 15:13 Sharon Kimble
  2014-05-04 16:03 ` Scott Randby
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Sharon Kimble @ 2014-05-04 15:13 UTC (permalink / raw)
  To: org-mode

[-- Attachment #1: Type: text/plain, Size: 414 bytes --]

I have these two symbols showing in my org-mode buffer with no
problems
╭────
│ alpha (ER-α) and beta (ER-β)
╰────

but they are not exported to latex/pdf. How then can I do so please?

Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
my git repo = https://bitbucket.org/boudiccas/dots
TGmeds = http://www.tgmeds.org.uk
Debian testing, Fluxbox 1.3.5, emacs 24.4.50.19

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: exporting α/β to latex/pdf
  2014-05-04 15:13 exporting α/β to latex/pdf Sharon Kimble
@ 2014-05-04 16:03 ` Scott Randby
  2014-05-04 19:26 ` Joost Helberg
  2014-05-04 21:42 ` Suvayu Ali
  2 siblings, 0 replies; 13+ messages in thread
From: Scott Randby @ 2014-05-04 16:03 UTC (permalink / raw)
  To: emacs-orgmode

On 05/04/2014 11:13 AM, Sharon Kimble wrote:
> I have these two symbols showing in my org-mode buffer with no 
> problems ╭──── │ alpha (ER-α) and beta (ER-β) ╰────
> 
> but they are not exported to latex/pdf. How then can I do so 
> please?

Are you using LaTeX markup to get these symbols? Use $\alpha$ and
$\beta$ to get these two symbols.

Scott Randby

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: exporting α/β to latex/pdf
  2014-05-04 15:13 exporting α/β to latex/pdf Sharon Kimble
  2014-05-04 16:03 ` Scott Randby
@ 2014-05-04 19:26 ` Joost Helberg
  2014-05-04 21:42 ` Suvayu Ali
  2 siblings, 0 replies; 13+ messages in thread
From: Joost Helberg @ 2014-05-04 19:26 UTC (permalink / raw)
  To: Sharon Kimble; +Cc: org-mode

Sharon,

the alpha and beta are encoded in UTF-8, these are passed through to the
latex-file. The correct symbols will only show up in the pdf if your
latex is UTF-8 capable.

Some latex-implementations are, you can use
  \usepackage[utf8x,math]{inputenx}
in your latex file, but I know, not all UTF-8 symbols are supported.
For alpha to come out: \newcommand\textalpha{\ensuremath{\alpha}}
is necessary (see
  http://www.latex-community.org/forum/viewtopic.php?f=9&t=2000
)

I couldn't get the beta to come out because it's not part of OT1.

Anyone a good suggestion for this? I think Sharon has a valid
expactation. 

regards,

Joost

>>>>> "Sharon" == Sharon Kimble <boudiccas@skimble.plus.com> writes:
 > From: Sharon Kimble <boudiccas@skimble.plus.com>
 > To: org-mode <emacs-orgmode@gnu.org>
 > Subject: [O] exporting α/β to latex/pdf
 > Date: 2014-05-04T17:13:45+0200

 > I have these two symbols showing in my org-mode buffer with no
 > problems
 > ╭────
 > │ alpha (ER-α) and beta (ER-β)
 > ╰────

 > but they are not exported to latex/pdf. How then can I do so please?

 > Sharon.
 > -- 
 > A taste of linux = http://www.sharons.org.uk
 > my git repo = https://bitbucket.org/boudiccas/dots
 > TGmeds = http://www.tgmeds.org.uk
 > Debian testing, Fluxbox 1.3.5, emacs 24.4.50.19

-- 
Snow B.V.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: exporting α/β to latex/pdf
  2014-05-04 15:13 exporting α/β to latex/pdf Sharon Kimble
  2014-05-04 16:03 ` Scott Randby
  2014-05-04 19:26 ` Joost Helberg
@ 2014-05-04 21:42 ` Suvayu Ali
  2014-05-04 22:14   ` Nick Dokos
                     ` (2 more replies)
  2 siblings, 3 replies; 13+ messages in thread
From: Suvayu Ali @ 2014-05-04 21:42 UTC (permalink / raw)
  To: emacs-orgmode

On Sun, May 04, 2014 at 04:13:45PM +0100, Sharon Kimble wrote:
> I have these two symbols showing in my org-mode buffer with no
> problems
> ╭────
> │ alpha (ER-α) and beta (ER-β)
> ╰────
> 
> but they are not exported to latex/pdf. How then can I do so please?

The easiest solution is to use a modern TeX engine like XeTeX or LuaTeX
along with a font with the required glyphs.  I personally use XeTeX with
Linux libertine fonts.  You can find my setup here:

<https://github.com/suvayu/.emacs.d/blob/master/org-mode-config.el#L176>

Feel free to ask if anything is unclear.

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: exporting α/β to latex/pdf
  2014-05-04 21:42 ` Suvayu Ali
@ 2014-05-04 22:14   ` Nick Dokos
  2014-05-05 15:06     ` Suvayu Ali
  2014-05-05 16:52     ` "Clément B."
  2014-05-05  0:08   ` Sharon Kimble
  2014-05-06  2:51   ` Rustom Mody
  2 siblings, 2 replies; 13+ messages in thread
From: Nick Dokos @ 2014-05-04 22:14 UTC (permalink / raw)
  To: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> On Sun, May 04, 2014 at 04:13:45PM +0100, Sharon Kimble wrote:
>> I have these two symbols showing in my org-mode buffer with no
>> problems
>> ╭────
>> │ alpha (ER-α) and beta (ER-β)
>> ╰────
>> 
>> but they are not exported to latex/pdf. How then can I do so please?
>
> The easiest solution is to use a modern TeX engine like XeTeX or LuaTeX
> along with a font with the required glyphs.

The *easiest* solution is to just say \alpha and \beta in the org file
instead of α and β. But biting the bullet and adopting XeTeX or LuaTeX is
probably the *best* way to go (he says without ever having used either...)

>  I personally use XeTeX with
> Linux libertine fonts.  You can find my setup here:
>
> <https://github.com/suvayu/.emacs.d/blob/master/org-mode-config.el#L176>
>

That is a nice resource - thanks!

> Feel free to ask if anything is unclear.
>
> Cheers,

-- 
Nick

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: exporting α/β to latex/pdf
  2014-05-04 21:42 ` Suvayu Ali
  2014-05-04 22:14   ` Nick Dokos
@ 2014-05-05  0:08   ` Sharon Kimble
  2014-05-06  2:51   ` Rustom Mody
  2 siblings, 0 replies; 13+ messages in thread
From: Sharon Kimble @ 2014-05-05  0:08 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> On Sun, May 04, 2014 at 04:13:45PM +0100, Sharon Kimble wrote:
>> I have these two symbols showing in my org-mode buffer with no
>> problems
>> ╭────
>> │ alpha (ER-α) and beta (ER-β)
>> ╰────
>> 
>> but they are not exported to latex/pdf. How then can I do so please?
>
> The easiest solution is to use a modern TeX engine like XeTeX or LuaTeX
> along with a font with the required glyphs.  I personally use XeTeX with
> Linux libertine fonts.  You can find my setup here:
>
> <https://github.com/suvayu/.emacs.d/blob/master/org-mode-config.el#L176>
>
> Feel free to ask if anything is unclear.
>
Thanks for this, my initial thought was that I don't have either
xetex or luatex, but after a bit of digging around I found that
they are part of "texlive", which is already in debians repos, so
I'll have a play with it in the morning.

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
my git repo = https://bitbucket.org/boudiccas/dots
TGmeds = http://www.tgmeds.org.uk
Debian testing, Fluxbox 1.3.5, emacs 24.4.50.19

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: exporting α/β to latex/pdf
  2014-05-04 22:14   ` Nick Dokos
@ 2014-05-05 15:06     ` Suvayu Ali
  2014-05-05 18:38       ` Grant Rettke
  2014-05-05 16:52     ` "Clément B."
  1 sibling, 1 reply; 13+ messages in thread
From: Suvayu Ali @ 2014-05-05 15:06 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1755 bytes --]

Hi Nick,

On Sun, May 04, 2014 at 06:14:34PM -0400, Nick Dokos wrote:
> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
> 
> > On Sun, May 04, 2014 at 04:13:45PM +0100, Sharon Kimble wrote:
> >> I have these two symbols showing in my org-mode buffer with no
> >> problems
> >> ╭────
> >> │ alpha (ER-α) and beta (ER-β)
> >> ╰────
> >> 
> >> but they are not exported to latex/pdf. How then can I do so please?
> >
> > The easiest solution is to use a modern TeX engine like XeTeX or LuaTeX
> > along with a font with the required glyphs.
> 
> The *easiest* solution is to just say \alpha and \beta in the org file
> instead of α and β. But biting the bullet and adopting XeTeX or LuaTeX is
> probably the *best* way to go (he says without ever having used either...)

Well put!

I really recommend using XeTeX for most things.  There are some caveats
though.  Clipping is a bit iffy, sometimes it warns as not supported but
works anyway :-p.  Sometimes it has trouble including slightly
non-standard pdf images whereas pdfTeX works fine.  There are also a few
packages here and there that are still not completely supported.  IIRC,
either one of the TikZ math libraries or a 3rd-party TikZ library (maybe
tikz-3dplot) is incompatible.

That said, I attached a sample pdf with lots of unicode produced with
XeLaTeX and Linux Libertine.  As you can see, some glyphs are missing
from Linux Libertine, but otherwise it looks pretty good!

> >  I personally use XeTeX with
> > Linux libertine fonts.  You can find my setup here:
> >
> > <https://github.com/suvayu/.emacs.d/blob/master/org-mode-config.el#L176>
> >
> 
> That is a nice resource - thanks!

Glad you like it.

:)

-- 
Suvayu

Open source is the future. It sets us free.

[-- Attachment #2: unicode.org --]
[-- Type: text/plain, Size: 536 bytes --]

* Unicode with \XeLaTeX
  :PROPERTIES:
  :EXPORT_FILE_NAME: unicode.pdf
  :EXPORT_OPTIONS: texht:t toc:nil
  :EXPORT_LATEX_CLASS: article
  :EXPORT_LATEX_HEADER: \usepackage{metalogo}
  :END:

- Particle names: π, Λ_{b}, D^{±}, K₁, K₂, K⁺, K⁻, μ⁻, e⁺
- Decays: B_{s} → D_{s}K, B_{s} → D_{s}π, B_{s} → D_{s}^{*}π
- parameters: Γ, ΔΓ, Δm_{s}
- Math symbols: ≃, ≥, ≤, ∃, ∈
- Diacritics and characters from other alphabets: naïve, Genève,
  Åkerman, þingvellir
- Currencies: £, €, ¢, ₹, ¥

[-- Attachment #3: unicode.pdf --]
[-- Type: application/pdf, Size: 13175 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: exporting α/β to latex/pdf
  2014-05-04 22:14   ` Nick Dokos
  2014-05-05 15:06     ` Suvayu Ali
@ 2014-05-05 16:52     ` "Clément B."
  2014-05-06 22:33       ` Nick Dokos
  1 sibling, 1 reply; 13+ messages in thread
From: "Clément B." @ 2014-05-05 16:52 UTC (permalink / raw)
  To: emacs-orgmode

> The *easiest* solution is to just say \alpha and \beta in the org file
> instead of α and β. But biting the bullet and adopting XeTeX or LuaTeX is
> probably the *best* way to go (he says without ever having used either...)

For those who stick with pdflatex, you can also use "α" directly in the 
org document, and define

#+latex_header: \usepackage[utf8]{inputenc}
#+latex_header: \declareunicodecharacter{03b1}{α}

Provided your file is indeed encoded in utf-8 (but why would you use any 
other encoding?)

This simply tells the compiler to bind "α" to the unicode character 
"greek small letter alpha" (U+03B1). If there is a lot of unicode in the 
document, XeTeX/LuaTeX are definitely better choices.


Clément

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: exporting α/β to latex/pdf
  2014-05-05 15:06     ` Suvayu Ali
@ 2014-05-05 18:38       ` Grant Rettke
  0 siblings, 0 replies; 13+ messages in thread
From: Grant Rettke @ 2014-05-05 18:38 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: emacs-orgmode@gnu.org

Your example is quite motivating.

With so many LaTeX sitting around its been hard to justify switching
to the seemingly awesome XeTeX and LuaTeX despite the niceties.

Being able to "just do Unicode" though... very nice especially from Org to TeX!
Grant Rettke | AAAS, ACM, ASA, FSF, IEEE, SIAM, Sigma Xi
grettke@acm.org | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson


On Mon, May 5, 2014 at 10:06 AM, Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:
> Hi Nick,
>
> On Sun, May 04, 2014 at 06:14:34PM -0400, Nick Dokos wrote:
>> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
>>
>> > On Sun, May 04, 2014 at 04:13:45PM +0100, Sharon Kimble wrote:
>> >> I have these two symbols showing in my org-mode buffer with no
>> >> problems
>> >> ╭────
>> >> │ alpha (ER-α) and beta (ER-β)
>> >> ╰────
>> >>
>> >> but they are not exported to latex/pdf. How then can I do so please?
>> >
>> > The easiest solution is to use a modern TeX engine like XeTeX or LuaTeX
>> > along with a font with the required glyphs.
>>
>> The *easiest* solution is to just say \alpha and \beta in the org file
>> instead of α and β. But biting the bullet and adopting XeTeX or LuaTeX is
>> probably the *best* way to go (he says without ever having used either...)
>
> Well put!
>
> I really recommend using XeTeX for most things.  There are some caveats
> though.  Clipping is a bit iffy, sometimes it warns as not supported but
> works anyway :-p.  Sometimes it has trouble including slightly
> non-standard pdf images whereas pdfTeX works fine.  There are also a few
> packages here and there that are still not completely supported.  IIRC,
> either one of the TikZ math libraries or a 3rd-party TikZ library (maybe
> tikz-3dplot) is incompatible.
>
> That said, I attached a sample pdf with lots of unicode produced with
> XeLaTeX and Linux Libertine.  As you can see, some glyphs are missing
> from Linux Libertine, but otherwise it looks pretty good!
>
>> >  I personally use XeTeX with
>> > Linux libertine fonts.  You can find my setup here:
>> >
>> > <https://github.com/suvayu/.emacs.d/blob/master/org-mode-config.el#L176>
>> >
>>
>> That is a nice resource - thanks!
>
> Glad you like it.
>
> :)
>
> --
> Suvayu
>
> Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: exporting α/β to latex/pdf
@ 2014-05-06  2:51   ` Rustom Mody
  2014-05-06 12:48     ` Suvayu Ali
  0 siblings, 1 reply; 13+ messages in thread
From: Rustom Mody @ 2014-05-06  2:51 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 580 bytes --]

Suvayu said:

The easiest solution is to use a modern TeX engine like XeTeX or LuaTeX
> along with a font with the required glyphs.  I personally use XeTeX with
> Linux libertine fonts.  You can find my setup here:
>
> <https://github.com/suvayu/.emacs.d/blob/master/org-mode-config.el#L176>
>

Hi Suvayu

I am interested in switching over to xetex. I find however that things dont
work very easily and googleing around I find that some fixes are needed. eg
http://ledgersmb.org/faq/xelatex

Do you also need to do these? Or is there something more generic/uptodate?

Thanks
Rusi

[-- Attachment #2: Type: text/html, Size: 991 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: exporting α/β to latex/pdf
  2014-05-06  2:51   ` Rustom Mody
@ 2014-05-06 12:48     ` Suvayu Ali
  0 siblings, 0 replies; 13+ messages in thread
From: Suvayu Ali @ 2014-05-06 12:48 UTC (permalink / raw)
  To: Rustom Mody; +Cc: emacs-orgmode

Hi Rustom,

On Tue, May 06, 2014 at 08:21:18AM +0530, Rustom Mody wrote:
> Suvayu said:
> 
> The easiest solution is to use a modern TeX engine like XeTeX or LuaTeX
> > along with a font with the required glyphs.  I personally use XeTeX with
> > Linux libertine fonts.  You can find my setup here:
> >
> > <https://github.com/suvayu/.emacs.d/blob/master/org-mode-config.el#L176>
> >
> 
> I am interested in switching over to xetex. I find however that things dont
> work very easily and googleing around I find that some fixes are needed. eg
> http://ledgersmb.org/faq/xelatex

I'm not sure what that FAQ is telling me.  It seems to me, it talks
about some Perl libraries that use LaTeX.  If that is the case, then I
can understand why that would be more involved.  After all it is
probably accessing more low-level features.

> 
> Do you also need to do these? Or is there something more generic/uptodate?

From a users perspective (I just call `xelatex' from the terminal, no
fancy stuff), I found I need to do the same amount of searching as I did
with pdfLaTeX.  This is entirely driven by gaps in my LaTeX
understanding.

That said, there are cases where it has fewer features/bugs (I listed a
few in my earlier email).

Does that answer your question in anyway?  If you faced any specific
issues, I would be interested to know more.

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: exporting α/β to latex/pdf
  2014-05-05 16:52     ` "Clément B."
@ 2014-05-06 22:33       ` Nick Dokos
  2014-05-07 23:30         ` "Clément B."
  0 siblings, 1 reply; 13+ messages in thread
From: Nick Dokos @ 2014-05-06 22:33 UTC (permalink / raw)
  To: emacs-orgmode

"Clément B." <clement@inventati.org> writes:

>> The *easiest* solution is to just say \alpha and \beta in the org file
>> instead of α and β. But biting the bullet and adopting XeTeX or LuaTeX is
>> probably the *best* way to go (he says without ever having used either...)
>
> For those who stick with pdflatex, you can also use "α" directly in
> the org document, and define
>
> #+latex_header: \usepackage[utf8]{inputenc}
> #+latex_header: \declareunicodecharacter{03b1}{α}
>
> Provided your file is indeed encoded in utf-8 (but why would you use
> any other encoding?)
>
> This simply tells the compiler to bind "α" to the unicode character
> "greek small letter alpha" (U+03B1). If there is a lot of unicode in
> the document, XeTeX/LuaTeX are definitely better choices.
>
>

But that's not quite right: you end up with a circular definition (and
both pdflatex and plain latex think so: they infloop).

One way to fix it using a math alpha:

--8<---------------cut here---------------start------------->8---
#+LATEX_HEADER: \DeclareUnicodeCharacter{03b1}{\(\alpha\)}
--8<---------------cut here---------------end--------------->8---

Another is to use \textalpha and a package that defines it:

--8<---------------cut here---------------start------------->8---
#+LATEX_HEADER: \usepackage{textgreek}
#+LATEX_HEADER: \DeclareUnicodeCharacter{03b1}{\textalpha}
--8<---------------cut here---------------end--------------->8---

but then you have to install the package (and possibly some fonts as
well).

Nick

PS. So happy that gmane is back :-)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: exporting α/β to latex/pdf
  2014-05-06 22:33       ` Nick Dokos
@ 2014-05-07 23:30         ` "Clément B."
  0 siblings, 0 replies; 13+ messages in thread
From: "Clément B." @ 2014-05-07 23:30 UTC (permalink / raw)
  To: emacs-orgmode, ndokos

> But that's not quite right: you end up with a circular definition (and
> both pdflatex and plain latex think so: they infloop).
>
> One way to fix it using a math alpha:
>
> --8<---------------cut here---------------start------------->8---
> #+LATEX_HEADER: \DeclareUnicodeCharacter{03b1}{\(\alpha\)}
> --8<---------------cut here---------------end--------------->8---
>

Oh my ! You are right of course. Sorry if I misled anybody.


Clément

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-05-07 23:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-04 15:13 exporting α/β to latex/pdf Sharon Kimble
2014-05-04 16:03 ` Scott Randby
2014-05-04 19:26 ` Joost Helberg
2014-05-04 21:42 ` Suvayu Ali
2014-05-04 22:14   ` Nick Dokos
2014-05-05 15:06     ` Suvayu Ali
2014-05-05 18:38       ` Grant Rettke
2014-05-05 16:52     ` "Clément B."
2014-05-06 22:33       ` Nick Dokos
2014-05-07 23:30         ` "Clément B."
2014-05-05  0:08   ` Sharon Kimble
2014-05-06  2:51   ` Rustom Mody
2014-05-06 12:48     ` Suvayu Ali

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).