Jan:

Pandoc has a default RTF template that it uses: 
https://github.com/jgm/pandoc-templates/blob/master/default.rtf

The font in Pandoc's default template is Helvetica, as you can see in its first 
line:

{\rtf1\ansi\deff0{\fonttbl{\f0 \fswiss Helvetica;}{\f1 \fmodern Courier;}}

I have just learned from 
https://latex2rtf.sourceforge.net/rtfspec_6.html#rtfspec_10 that there is a way 
to specify an "Unknown or default font" using \fnil in RTF, which would look 
like this when modifying the previous line from Pandoc's template:

{\rtf1\ansi\deff0{\fonttbl{\f0 \fnil;}{\f1 \fnil;}}

I modified Pandoc's default RTF template using the previous line, saved it as 
~/.pandoc/templates/no-font.rtf, and used it to generate an RTF file from 
BibTeX on the clipboard with the following command:

pbpaste | pandoc -f bibtex -t rtf -C --csl=apa.csl --template=no-font.rtf -o 
Desktop/references.rtf

If I open the resulting references.rtf file in Microsoft Word, it displays 
using Word's default font, Times New Roman. However, if I open the file in 
QuickLook or in TextEdit, it displays using Helvetica. It may be that Helvetica 
is the macOS default font for rich text.

You could create an RTF export template for BibDesk using \fnil as the font, 
but it seems that \fnil will always be interpreted as Helvetica in standard 
macOS rich text.

I found the following blog post by Andrew Heiss that describes how he uses an 
Automator action to convert Markdown in any macOS app to rich text using 
Pandoc: 
https://www.andrewheiss.com/blog/2019/10/09/convert-md-rtf-macos-services/

Heiss's method would be be another option: use a Markdown (plain-text) export 
template in BibDesk, and use an Automator action after you paste the text to 
convert the Markdown to rich text. But I don't see how this would be a better 
solution than an RTF export template in BibDesk. Heiss developed his solution 
because he wants syntax highlighting for his programming-language code blocks, 
which Pandoc provides.

Nathan

> On Sep 15, 2024, at 4:55 PM, Christiaan Hofman <[email protected]> wrote:
> 
> There will always be some formatting, like the font. It generates rich 
> text.There does not exist rich text with *only* an italic attribute, that 
> does not exist (does not make sense), as italic is a part of the font 
> information. There is always the font, at minimum.
> 
> As for Nathan’s suggestion, that goes outside BiBDesk. And it will also 
> generate rich text, so it will also contain at least font attributes.
>  
> Christiaan
> 
>> On 15 Sep 2024, at 21:02, Jan David Hauck via Bibdesk-users 
>> <[email protected]> wrote:
>> 
>> I’m sorry, I still don’t understand how I would add a key to the key path to 
>> remove the formatting?  
>> From the list here https://bibdesk.sourceforge.io/manual/BibDeskHelp_95.html 
>> I couldn’t see anything that would do that.  
>> 
>> I tried Nathan’s suggestions, but yes, as you said, it still has font 
>> information preserved (it pastes it as Helvetica, not exactly sure where it 
>> gets that from if it is not using any template).  
>> 
>> Thanks,
>> 
>> Jan



_______________________________________________
Bibdesk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Reply via email to