* Special symbols with monospace
@ 2020-10-15 6:13 Jarmo Hurri
2020-10-15 6:53 ` Maxim Nikulin
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Jarmo Hurri @ 2020-10-15 6:13 UTC (permalink / raw)
To: emacs-orgmode
Greetings.
I like to embed pseudocode etc. in example blocks so that it is typeset
in monospace when exported. But sometimes I would need special symbols,
such as \neq, in pseudocode. What is the easiest way to combine
monospace and special symbols?
Jarmo
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Special symbols with monospace
2020-10-15 6:13 Special symbols with monospace Jarmo Hurri
@ 2020-10-15 6:53 ` Maxim Nikulin
2020-10-15 9:32 ` Jarmo Hurri
2020-10-15 7:13 ` Eric S Fraga
2020-10-15 7:46 ` Colin Baxter
2 siblings, 1 reply; 13+ messages in thread
From: Maxim Nikulin @ 2020-10-15 6:53 UTC (permalink / raw)
To: emacs-orgmode
Jarmo Hurri wrote:
>
> I like to embed pseudocode etc. in example blocks so that it is typeset
> in monospace when exported. But sometimes I would need special symbols,
> such as \neq, in pseudocode. What is the easiest way to combine
> monospace and special symbols?
Is there any problem with UTF-8 symbols such as "≠"? I have typed it using
Compose / =
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Special symbols with monospace
2020-10-15 6:13 Special symbols with monospace Jarmo Hurri
2020-10-15 6:53 ` Maxim Nikulin
@ 2020-10-15 7:13 ` Eric S Fraga
2020-10-15 9:31 ` Jarmo Hurri
2020-10-15 7:46 ` Colin Baxter
2 siblings, 1 reply; 13+ messages in thread
From: Eric S Fraga @ 2020-10-15 7:13 UTC (permalink / raw)
To: Jarmo Hurri; +Cc: emacs-orgmode
On Thursday, 15 Oct 2020 at 09:13, Jarmo Hurri wrote:
> I like to embed pseudocode etc. in example blocks so that it is typeset
> in monospace when exported. But sometimes I would need special symbols,
> such as \neq, in pseudocode. What is the easiest way to combine
> monospace and special symbols?
I resort to LaTeX for this, using a LaTeX src block with the algorithm
and algpseudocode packages.
--
: Eric S Fraga via Emacs 28.0.50, Org release_9.4-57-g8402c4
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Special symbols with monospace
2020-10-15 7:13 ` Eric S Fraga
@ 2020-10-15 9:31 ` Jarmo Hurri
2020-10-15 10:17 ` Eric S Fraga
0 siblings, 1 reply; 13+ messages in thread
From: Jarmo Hurri @ 2020-10-15 9:31 UTC (permalink / raw)
To: emacs-orgmode
Hi there.
Eric S Fraga <e.fraga@ucl.ac.uk> writes:
> I resort to LaTeX for this, using a LaTeX src block with the algorithm
> and algpseudocode packages.
In my case there is a specific pseudocode format I need to use. I think
I would have to try to tune one of these packages pretty heavily.
But I will see. Thanks.
Jarmo
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Special symbols with monospace
2020-10-15 9:31 ` Jarmo Hurri
@ 2020-10-15 10:17 ` Eric S Fraga
2020-10-15 11:11 ` Jarmo Hurri
2020-10-15 15:03 ` Colin Baxter
0 siblings, 2 replies; 13+ messages in thread
From: Eric S Fraga @ 2020-10-15 10:17 UTC (permalink / raw)
To: Jarmo Hurri; +Cc: emacs-orgmode
On Thursday, 15 Oct 2020 at 12:31, Jarmo Hurri wrote:
> In my case there is a specific pseudocode format I need to use. I think
> I would have to try to tune one of these packages pretty heavily.
In that case, you may simply wish to use the alltt environment. This
works for me:
#+begin_src org
,* algorithm pseudo code
,#+latex_header: \usepackage{alltt}
,#+begin_alltt
for i \in [0,1] do
if i \neq 3
x ← i^2
end if
end for
,#+end_alltt
#+end_src
HTH,
eric
--
: Eric S Fraga via Emacs 28.0.50, Org release_9.4-57-g8402c4
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Special symbols with monospace
2020-10-15 10:17 ` Eric S Fraga
@ 2020-10-15 11:11 ` Jarmo Hurri
2020-10-15 15:03 ` Colin Baxter
1 sibling, 0 replies; 13+ messages in thread
From: Jarmo Hurri @ 2020-10-15 11:11 UTC (permalink / raw)
To: emacs-orgmode
Eric S Fraga <e.fraga@ucl.ac.uk> writes:
> In that case, you may simply wish to use the alltt environment. This
> works for me:
>
> #+begin_src org
> ,* algorithm pseudo code
> ,#+latex_header: \usepackage{alltt}
> ,#+begin_alltt
> for i \in [0,1] do
> if i \neq 3
> x ← i^2
> end if
> end for
> ,#+end_alltt
> #+end_src
Excellent, works for me too.
What a great community!
Jarmo
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Special symbols with monospace
2020-10-15 10:17 ` Eric S Fraga
2020-10-15 11:11 ` Jarmo Hurri
@ 2020-10-15 15:03 ` Colin Baxter
2020-10-15 15:21 ` Eric S Fraga
1 sibling, 1 reply; 13+ messages in thread
From: Colin Baxter @ 2020-10-15 15:03 UTC (permalink / raw)
To: Jarmo Hurri; +Cc: emacs-orgmode
Hello Eric,
>>>>> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
> On Thursday, 15 Oct 2020 at 12:31, Jarmo Hurri wrote:
>> In my case there is a specific pseudocode format I need to use. I
>> think I would have to try to tune one of these packages pretty
>> heavily.
> In that case, you may simply wish to use the alltt environment.
> This works for me:
> #+begin_src org ,* algorithm pseudo code ,#+latex_header:
> \usepackage{alltt} ,#+begin_alltt for i \in [0,1] do if i \neq 3 x
> ← i^2 end if end for ,#+end_alltt #+end_src
Is there any reason why you don't use LaTeX's \leftarrow in place of ← ?
With perhaps a (set-input-method 'TeX).
Best wishes,
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Special symbols with monospace
2020-10-15 15:03 ` Colin Baxter
@ 2020-10-15 15:21 ` Eric S Fraga
0 siblings, 0 replies; 13+ messages in thread
From: Eric S Fraga @ 2020-10-15 15:21 UTC (permalink / raw)
To: Colin Baxter; +Cc: Jarmo Hurri, emacs-orgmode
On Thursday, 15 Oct 2020 at 16:03, Colin Baxter wrote:
> Is there any reason why you don't use LaTeX's \leftarrow in place of ← ?
> With perhaps a (set-input-method 'TeX).
Funnily enough, it's because I was originally using the TeX input method
(which I love) that I ended up with ← instead of \gets... :-)
I had realized that my LaTeX did not understand ∈ when I exported to PDF
and so I changed all (but not all) input to LaTeX and not utf-8
symbols. I missed that line!
--
: Eric S Fraga via Emacs 28.0.50, Org release_9.4-57-g8402c4
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Special symbols with monospace
2020-10-15 6:13 Special symbols with monospace Jarmo Hurri
2020-10-15 6:53 ` Maxim Nikulin
2020-10-15 7:13 ` Eric S Fraga
@ 2020-10-15 7:46 ` Colin Baxter
2020-10-15 9:30 ` Jarmo Hurri
2 siblings, 1 reply; 13+ messages in thread
From: Colin Baxter @ 2020-10-15 7:46 UTC (permalink / raw)
To: emacs-orgmode
>>>>> Jarmo Hurri <jarmo.hurri@iki.fi> writes:
> Greetings.
> I like to embed pseudocode etc. in example blocks so that it is
> typeset in monospace when exported. But sometimes I would need
> special symbols, such as \neq, in pseudocode. What is the easiest
> way to combine monospace and special symbols?
> Jarmo
Would https://github.com/jsalzbergedu/pseudocode-mode be any good?
Best wishes,
Colin Baxter
URL: http://www.Colin-Baxter.com
---------------------------------------------------------------------
GnuPG fingerprint: 68A8 799C 0230 16E7 BF68 2A27 BBFA 2492 91F5 41C8
---------------------------------------------------------------------
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2020-10-15 15:33 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-15 6:13 Special symbols with monospace Jarmo Hurri
2020-10-15 6:53 ` Maxim Nikulin
2020-10-15 9:32 ` Jarmo Hurri
2020-10-15 10:37 ` Maxim Nikulin
2020-10-15 11:06 ` Jarmo Hurri
2020-10-15 7:13 ` Eric S Fraga
2020-10-15 9:31 ` Jarmo Hurri
2020-10-15 10:17 ` Eric S Fraga
2020-10-15 11:11 ` Jarmo Hurri
2020-10-15 15:03 ` Colin Baxter
2020-10-15 15:21 ` Eric S Fraga
2020-10-15 7:46 ` Colin Baxter
2020-10-15 9:30 ` Jarmo Hurri
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).