public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Special symbols in code blocks?
@ 2020-01-01 13:10 Axel Rauschmayer
       [not found] ` <f7effcb8-15e8-4462-953e-d20e4095b752-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Axel Rauschmayer @ 2020-01-01 13:10 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 865 bytes --]

At the moment, I’m doing the following if I want to refer to lines in code:

```js
function func() { // (A)
}
```
The function declaration starts in line A.

I’d prefer this, though:

```js
function func() { // 🅰
}
```
The function declaration starts in line 🅰.

This works for HTML, but not for PDF/LaTeX where especially the monospaced 
(coding) font must have a glyph for 🅰.

Any ideas how this could be achieved?

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/f7effcb8-15e8-4462-953e-d20e4095b752%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 1796 bytes --]

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

* Re: Special symbols in code blocks?
       [not found] ` <f7effcb8-15e8-4462-953e-d20e4095b752-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2020-01-02 18:30   ` BPJ
       [not found]     ` <CADAJKhCu5a84wtjzUTKNO_jodTs=6AOz9jhbBNuOpDd6AUpxOQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: BPJ @ 2020-01-02 18:30 UTC (permalink / raw)
  To: pandoc-discuss

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

The *newunicodechar* package is your friend.

\newunicodechar{🅰️}{ {\myfont 🅰️} }

Possibly you will have to use XeLaTeX or LuaLaTeX and fontspec if you don't
already, but I can't see how that could be a bad thing! :-)


Den ons 1 jan. 2020 14:11Axel Rauschmayer <rauschma-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:

> At the moment, I’m doing the following if I want to refer to lines in code:
>
> ```js
> function func() { // (A)
> }
> ```
> The function declaration starts in line A.
>
> I’d prefer this, though:
>
> ```js
> function func() { // 🅰
> }
> ```
> The function declaration starts in line 🅰.
>
> This works for HTML, but not for PDF/LaTeX where especially the monospaced
> (coding) font must have a glyph for 🅰.
>
> Any ideas how this could be achieved?
>
> --
> You received this message because you are subscribed to the Google Groups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/f7effcb8-15e8-4462-953e-d20e4095b752%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/f7effcb8-15e8-4462-953e-d20e4095b752%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhCu5a84wtjzUTKNO_jodTs%3D6AOz9jhbBNuOpDd6AUpxOQ%40mail.gmail.com.

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

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

* Re: Special symbols in code blocks?
       [not found]     ` <CADAJKhCu5a84wtjzUTKNO_jodTs=6AOz9jhbBNuOpDd6AUpxOQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2020-01-02 21:36       ` Axel Rauschmayer
       [not found]         ` <5988cef2-5907-4a1f-8efb-de33f5b61c41-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Axel Rauschmayer @ 2020-01-02 21:36 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 776 bytes --]

Thanks! Alas, I couldn’t get it to work. This is what I tried (XeLaTeX):

<!-- In header -->
\newfontfamily{\emojifont}{DejaVu Sans}
\usepackage{newunicodechar}
\newunicodechar{🐱}{{\emojifont 🐱}}

<!-- In document -->
```
Cat: 🐱
```

The following text in the body (=not inside a fenced code block) did work:

\textrm{\emojifont 🐱}

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/5988cef2-5907-4a1f-8efb-de33f5b61c41%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 1670 bytes --]

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

* Re: Special symbols in code blocks?
       [not found]         ` <5988cef2-5907-4a1f-8efb-de33f5b61c41-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2020-01-03 18:47           ` BPJ
       [not found]             ` <CADAJKhBUHhryaxKHLTb2iamzW-7nu7wxhODG_8nZjop-oijE_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: BPJ @ 2020-01-03 18:47 UTC (permalink / raw)
  To: pandoc-discuss

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

Bummer! Apparently those verbatim environments disable active characters
then! Perhaps if you filter the generated LaTeX source to insert the
equivalent code. Try running this perl oneliner, which should work with any
reasonably recent version of perl, on the generated LaTeX source:

perl -CADS -ple's/([\x{1f170}-\x{1f189}])/{\\emojifont $1}'

Den tors 2 jan. 2020 22:37Axel Rauschmayer <rauschma-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:

> Thanks! Alas, I couldn’t get it to work. This is what I tried (XeLaTeX):
>
> <!-- In header -->
> \newfontfamily{\emojifont}{DejaVu Sans}
> \usepackage{newunicodechar}
> \newunicodechar{🐱}{{\emojifont 🐱}}
>
> <!-- In document -->
> ```
> Cat: 🐱
> ```
>
> The following text in the body (=not inside a fenced code block) did work:
>
> \textrm{\emojifont 🐱}
>
> --
> You received this message because you are subscribed to the Google Groups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/5988cef2-5907-4a1f-8efb-de33f5b61c41%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/5988cef2-5907-4a1f-8efb-de33f5b61c41%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhBUHhryaxKHLTb2iamzW-7nu7wxhODG_8nZjop-oijE_A%40mail.gmail.com.

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

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

* Re: Special symbols in code blocks?
       [not found]             ` <CADAJKhBUHhryaxKHLTb2iamzW-7nu7wxhODG_8nZjop-oijE_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2020-01-03 18:54               ` BPJ
  2020-01-03 19:02               ` Fwd: " BPJ
  1 sibling, 0 replies; 8+ messages in thread
From: BPJ @ 2020-01-03 18:54 UTC (permalink / raw)
  To: bpj; +Cc: pandoc-discuss

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

Maybe it doesn't work because the chars are outside the BMP.

Does it work if you use a BMP character? (Can't test ATM since I'm 40 km
from my laptop. I do have a terminal with Vim and perl on my phone but TeX
and pandoc are as yet not available! :-)

Den fre 3 jan. 2020 19:47BPJ <bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org> skrev:

> Bummer! Apparently those verbatim environments disable active characters
> then! Perhaps if you filter the generated LaTeX source to insert the
> equivalent code. Try running this perl oneliner, which should work with any
> reasonably recent version of perl, on the generated LaTeX source:
>
> perl -CADS -ple's/([\x{1f170}-\x{1f189}])/{\\emojifont $1}'
>
> Den tors 2 jan. 2020 22:37Axel Rauschmayer <rauschma-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
>
>> Thanks! Alas, I couldn’t get it to work. This is what I tried (XeLaTeX):
>>
>> <!-- In header -->
>> \newfontfamily{\emojifont}{DejaVu Sans}
>> \usepackage{newunicodechar}
>> \newunicodechar{🐱}{{\emojifont 🐱}}
>>
>> <!-- In document -->
>> ```
>> Cat: 🐱
>> ```
>>
>> The following text in the body (=not inside a fenced code block) did work:
>>
>> \textrm{\emojifont 🐱}
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "pandoc-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pandoc-discuss/5988cef2-5907-4a1f-8efb-de33f5b61c41%40googlegroups.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/5988cef2-5907-4a1f-8efb-de33f5b61c41%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhBmtBxVnSKwtaX_dA_cCAmb9R_i3Ppy7Vrg9E3Bvh%2BFwQ%40mail.gmail.com.

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

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

* Fwd: Special symbols in code blocks?
       [not found]             ` <CADAJKhBUHhryaxKHLTb2iamzW-7nu7wxhODG_8nZjop-oijE_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2020-01-03 18:54               ` BPJ
@ 2020-01-03 19:02               ` BPJ
       [not found]                 ` <CADAJKhAYT0n_8R4+bv1JAmTko7XPXEMHaMdBP1ZviZwmp2PXRA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 8+ messages in thread
From: BPJ @ 2020-01-03 19:02 UTC (permalink / raw)
  To: pandoc-discuss

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

Resending since I used the wrong From address the first time. Apologies in
case they already went through!

Bummer! Apparently those verbatim environments disable active characters
then! Perhaps if you filter the generated LaTeX source to insert the
equivalent code. Try running this perl oneliner, which should work with any
reasonably recent version of perl, on the generated LaTeX source:

perl -CADS -ple's/([\x{1f170}-\x{1f189}])/{\\emojifont $1}'




Maybe it doesn't work because the chars are outside the BMP.

Does it work if you use a BMP character? (Can't test ATM since I'm 40 km
from my laptop. I do have a terminal with Vim and perl on my phone but TeX
and pandoc are as yet not available! :-)


>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhAYT0n_8R4%2Bbv1JAmTko7XPXEMHaMdBP1ZviZwmp2PXRA%40mail.gmail.com.

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

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

* Re: Special symbols in code blocks?
       [not found]                 ` <CADAJKhAYT0n_8R4+bv1JAmTko7XPXEMHaMdBP1ZviZwmp2PXRA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2020-01-04 17:24                   ` Axel Rauschmayer
       [not found]                     ` <d1112893-e65d-4bb7-8dd0-68a88b966d89-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Axel Rauschmayer @ 2020-01-04 17:24 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 812 bytes --]

Thanks! I specifically need this for non-BMP characters.

I agree that post-processing is probably the best option. I just tested it 
and it works! It helps that Pandoc by default doesn’t use the listing 
environment. Therefore, inserting {\emojifont X} is simple:

\begin{Highlighting}[]
\KeywordTok{class}\NormalTok{ Point }\OperatorTok{\{} \CommentTok{// 
{\emojifont 🐱}}
···

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/d1112893-e65d-4bb7-8dd0-68a88b966d89%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 2991 bytes --]

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

* Re: Special symbols in code blocks?
       [not found]                     ` <d1112893-e65d-4bb7-8dd0-68a88b966d89-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2020-01-04 19:33                       ` BPJ
  0 siblings, 0 replies; 8+ messages in thread
From: BPJ @ 2020-01-04 19:33 UTC (permalink / raw)
  To: pandoc-discuss

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

For your stated purpose of flagging lines in code blocks the circled
letters U+24B6–U+24E9 in the BMP might be sufficient.

BTW I would probably define a command for the font change, although that is
probably mostly aesthetic — I'm allergic to the TeX font switchers and tend
to define wrapper commands which take an argument.

\newcommand{\myEmoji}[1]{{\emojifont #1}}

Den lör 4 jan. 2020 18:24Axel Rauschmayer <rauschma-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:

> Thanks! I specifically need this for non-BMP characters.
>
> I agree that post-processing is probably the best option. I just tested it
> and it works! It helps that Pandoc by default doesn’t use the listing
> environment. Therefore, inserting {\emojifont X} is simple:
>
> \begin{Highlighting}[]
> \KeywordTok{class}\NormalTok{ Point }\OperatorTok{\{} \CommentTok{//
> {\emojifont 🐱}}
> ···
>
> --
> You received this message because you are subscribed to the Google Groups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/d1112893-e65d-4bb7-8dd0-68a88b966d89%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/d1112893-e65d-4bb7-8dd0-68a88b966d89%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhA8v76o%2BU5NMc6CbxrTt%3D_E1jtUy3mx8X7tg2EDnegb%2Bw%40mail.gmail.com.

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

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

end of thread, other threads:[~2020-01-04 19:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-01 13:10 Special symbols in code blocks? Axel Rauschmayer
     [not found] ` <f7effcb8-15e8-4462-953e-d20e4095b752-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-01-02 18:30   ` BPJ
     [not found]     ` <CADAJKhCu5a84wtjzUTKNO_jodTs=6AOz9jhbBNuOpDd6AUpxOQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-01-02 21:36       ` Axel Rauschmayer
     [not found]         ` <5988cef2-5907-4a1f-8efb-de33f5b61c41-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-01-03 18:47           ` BPJ
     [not found]             ` <CADAJKhBUHhryaxKHLTb2iamzW-7nu7wxhODG_8nZjop-oijE_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-01-03 18:54               ` BPJ
2020-01-03 19:02               ` Fwd: " BPJ
     [not found]                 ` <CADAJKhAYT0n_8R4+bv1JAmTko7XPXEMHaMdBP1ZviZwmp2PXRA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-01-04 17:24                   ` Axel Rauschmayer
     [not found]                     ` <d1112893-e65d-4bb7-8dd0-68a88b966d89-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-01-04 19:33                       ` BPJ

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 NNTP newsgroup(s).