Re: LyX, Non-TeX-Fonts and export with pandoc

2023-11-19 Thread Richard Kimberly Heck

On 11/19/23 06:30, Tobias Hilbricht wrote:

Riki,

I have added your instructions to the LyX-wiki "Export to OpenDocument
(.odt) and Open Office XML (.docx) file formats with Pandoc".


Thanks!

Riki



Am Samstag, dem 18.11.2023 um 23:08 -0500 schrieb Richard Kimberly
Heck:

Probably this should go into 2.4, but we'll see if anyone has
worries.

On 11/18/23 13:24, Tobias Hilbricht wrote:

Am Samstag, dem 18.11.2023 um 12:46 -0500 schrieb Richard Kimberly
Heck:

On 11/18/23 07:18, Tobias Hilbricht wrote:

But when I check that box and want to use Non-TeX-Fonts, the
export
option to docx or odt via pandoc disappears.

The reason for this is that, if you use non-TeX fonts, then the
immediate export is to a file that would be compiled with XeLaTeX
or
LuaTeX, and there is no converter defined to convert that format
to
ODT
or whatever.

Now that you write it it is quite clear, but it did not occur to me
when looking at Settings - Converter ...


The solution is to define one. This is easiest done I think in
the
configuration files themselves rather than in LyX. Find your user
directory and open the file lyxrc.defaults. In there, you will
find a
line like:

\converter latex  odt3    "pandoc -s -f latex -o $$o -t
odt
$$i"    ""

Copy it and open the file preferences. Paste twice but change it
to:

\converter xetex  odt3    "pandoc -s -f latex -o $$o -t
odt
$$i"    ""
\converter luatex  odt3    "pandoc -s -f latex -o $$o -t
odt
$$i"    ""

Save that file and open LyX. Should work, but not tested. The
same
kind
of thing will work for Word formats.

A quick test with a simple LyX-document produced docx- and odt-
output
without errors and with the expected formatting.

There may be some reason we do not include this by default:
Perhaps
pandoc is liable to choke on something we output in those modes.
Hopefully, someone else will know. But I'm guessing it's an
oversight.


I can understand that and will see how far I can get. Thank you for
your advice!
Tobias




--

Richard Kimberly (Riki) Heck
Professor of Philosophy
Brown University

Pronouns: they/them/their
Website:  http://rkheck.frege.org/

--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: LyX, Non-TeX-Fonts and export with pandoc

2023-11-19 Thread Tobias Hilbricht
Riki,

I have added your instructions to the LyX-wiki "Export to OpenDocument
(.odt) and Open Office XML (.docx) file formats with Pandoc".

Tobias 

Am Samstag, dem 18.11.2023 um 23:08 -0500 schrieb Richard Kimberly
Heck:
> 
> Probably this should go into 2.4, but we'll see if anyone has
> worries.
> 
> On 11/18/23 13:24, Tobias Hilbricht wrote:
> > Am Samstag, dem 18.11.2023 um 12:46 -0500 schrieb Richard Kimberly
> > Heck:
> > > On 11/18/23 07:18, Tobias Hilbricht wrote:
> > > > But when I check that box and want to use Non-TeX-Fonts, the
> > > > export
> > > > option to docx or odt via pandoc disappears.
> > > The reason for this is that, if you use non-TeX fonts, then the
> > > immediate export is to a file that would be compiled with XeLaTeX
> > > or
> > > LuaTeX, and there is no converter defined to convert that format
> > > to
> > > ODT
> > > or whatever.
> > Now that you write it it is quite clear, but it did not occur to me
> > when looking at Settings - Converter ...
> > 
> > > The solution is to define one. This is easiest done I think in
> > > the
> > > configuration files themselves rather than in LyX. Find your user
> > > directory and open the file lyxrc.defaults. In there, you will
> > > find a
> > > line like:
> > > 
> > > \converter latex  odt3    "pandoc -s -f latex -o $$o -t
> > > odt
> > > $$i"    ""
> > > 
> > > Copy it and open the file preferences. Paste twice but change it
> > > to:
> > > 
> > > \converter xetex  odt3    "pandoc -s -f latex -o $$o -t
> > > odt
> > > $$i"    ""
> > > \converter luatex  odt3    "pandoc -s -f latex -o $$o -t
> > > odt
> > > $$i"    ""
> > > 
> > > Save that file and open LyX. Should work, but not tested. The
> > > same
> > > kind
> > > of thing will work for Word formats.
> > A quick test with a simple LyX-document produced docx- and odt-
> > output
> > without errors and with the expected formatting.
> > > There may be some reason we do not include this by default:
> > > Perhaps
> > > pandoc is liable to choke on something we output in those modes.
> > > Hopefully, someone else will know. But I'm guessing it's an
> > > oversight.
> > > 
> > I can understand that and will see how far I can get. Thank you for
> > your advice!
> > Tobias
> 
> 

-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: LyX, Non-TeX-Fonts and export with pandoc

2023-11-18 Thread Richard Kimberly Heck


Probably this should go into 2.4, but we'll see if anyone has worries.

On 11/18/23 13:24, Tobias Hilbricht wrote:

Am Samstag, dem 18.11.2023 um 12:46 -0500 schrieb Richard Kimberly
Heck:

On 11/18/23 07:18, Tobias Hilbricht wrote:

But when I check that box and want to use Non-TeX-Fonts, the export
option to docx or odt via pandoc disappears.

The reason for this is that, if you use non-TeX fonts, then the
immediate export is to a file that would be compiled with XeLaTeX or
LuaTeX, and there is no converter defined to convert that format to
ODT
or whatever.

Now that you write it it is quite clear, but it did not occur to me
when looking at Settings - Converter ...


The solution is to define one. This is easiest done I think in the
configuration files themselves rather than in LyX. Find your user
directory and open the file lyxrc.defaults. In there, you will find a
line like:

\converter latex  odt3    "pandoc -s -f latex -o $$o -t odt
$$i"    ""

Copy it and open the file preferences. Paste twice but change it to:

\converter xetex  odt3    "pandoc -s -f latex -o $$o -t odt
$$i"    ""
\converter luatex  odt3    "pandoc -s -f latex -o $$o -t odt
$$i"    ""

Save that file and open LyX. Should work, but not tested. The same
kind
of thing will work for Word formats.

A quick test with a simple LyX-document produced docx- and odt-output
without errors and with the expected formatting.

There may be some reason we do not include this by default: Perhaps
pandoc is liable to choke on something we output in those modes.
Hopefully, someone else will know. But I'm guessing it's an
oversight.


I can understand that and will see how far I can get. Thank you for
your advice!
Tobias



--

Richard Kimberly (Riki) Heck
Professor of Philosophy
Brown University

Pronouns: they/them/their
Website:  http://rkheck.frege.org/

--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: LyX, Non-TeX-Fonts and export with pandoc

2023-11-18 Thread Tobias Hilbricht
Am Samstag, dem 18.11.2023 um 12:46 -0500 schrieb Richard Kimberly
Heck:
> On 11/18/23 07:18, Tobias Hilbricht wrote:
> > 
> > But when I check that box and want to use Non-TeX-Fonts, the export
> > option to docx or odt via pandoc disappears.
> 
> The reason for this is that, if you use non-TeX fonts, then the 
> immediate export is to a file that would be compiled with XeLaTeX or 
> LuaTeX, and there is no converter defined to convert that format to
> ODT 
> or whatever.

Now that you write it it is quite clear, but it did not occur to me
when looking at Settings - Converter ...

> 
> The solution is to define one. This is easiest done I think in the 
> configuration files themselves rather than in LyX. Find your user 
> directory and open the file lyxrc.defaults. In there, you will find a
> line like:
> 
> \converter latex  odt3    "pandoc -s -f latex -o $$o -t odt 
> $$i"    ""
> 
> Copy it and open the file preferences. Paste twice but change it to:
> 
> \converter xetex  odt3    "pandoc -s -f latex -o $$o -t odt 
> $$i"    ""
> \converter luatex  odt3    "pandoc -s -f latex -o $$o -t odt 
> $$i"    ""
> 
> Save that file and open LyX. Should work, but not tested. The same
> kind 
> of thing will work for Word formats.

A quick test with a simple LyX-document produced docx- and odt-output
without errors and with the expected formatting.
> 
> There may be some reason we do not include this by default: Perhaps 
> pandoc is liable to choke on something we output in those modes. 
> Hopefully, someone else will know. But I'm guessing it's an
> oversight.
> 
I can understand that and will see how far I can get. Thank you for
your advice!
Tobias
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: LyX, Non-TeX-Fonts and export with pandoc

2023-11-18 Thread Richard Kimberly Heck

On 11/18/23 07:18, Tobias Hilbricht wrote:

Dear readers of this list,
I am referring to LyX 2.3.7 on Ubuntu 22.04 and pandoc 2.9.2.1:
I am able to export documents from LyX to docx or odt by means of
pandoc when I use TeX-Fonts (that is, the box "Do not use TeX-Fonts
(via XeteX or LuaTeX)" is *not* checked).

But when I check that box and want to use Non-TeX-Fonts, the export
option to docx or odt via pandoc disappears.


The reason for this is that, if you use non-TeX fonts, then the 
immediate export is to a file that would be compiled with XeLaTeX or 
LuaTeX, and there is no converter defined to convert that format to ODT 
or whatever.


The solution is to define one. This is easiest done I think in the 
configuration files themselves rather than in LyX. Find your user 
directory and open the file lyxrc.defaults. In there, you will find a 
line like:


\converter latex  odt3    "pandoc -s -f latex -o $$o -t odt 
$$i"    ""


Copy it and open the file preferences. Paste twice but change it to:

\converter xetex  odt3    "pandoc -s -f latex -o $$o -t odt 
$$i"    ""
\converter luatex  odt3    "pandoc -s -f latex -o $$o -t odt 
$$i"    ""


Save that file and open LyX. Should work, but not tested. The same kind 
of thing will work for Word formats.


There may be some reason we do not include this by default: Perhaps 
pandoc is liable to choke on something we output in those modes. 
Hopefully, someone else will know. But I'm guessing it's an oversight.


Riki



--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


LyX, Non-TeX-Fonts and export with pandoc

2023-11-18 Thread Tobias Hilbricht
Dear readers of this list,
I am referring to LyX 2.3.7 on Ubuntu 22.04 and pandoc 2.9.2.1:
I am able to export documents from LyX to docx or odt by means of
pandoc when I use TeX-Fonts (that is, the box "Do not use TeX-Fonts
(via XeteX or LuaTeX)" is *not* checked).

But when I check that box and want to use Non-TeX-Fonts, the export
option to docx or odt via pandoc disappears.

However, on the command line I can export the following latex-file by
means of pandoc to docx, eg.

pandoc -s -f latex -o Test_Nicht-TeX-Font_pandoc.docx -t docx
Test_Nicht-TeX-Font_pandoc.tex

%% Test_Nicht-TeX-Font_pandoc.tex
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Liberation Serif}
\begin{document}
Dieses Dokument benutzt einen "Nicht-TeX-Font" im Sinne von
LyX.
\end{document}

Is it possible to export LyX-documents with non-TeX-fonts by means of
pandoc? If yes, what can I do to convince LyX?

Thanks for helpful hints in advance

Tobias
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users