From: Alan G. I. <ala...@gm...> - 2023-01-14 17:39:54
|
With current docutils on Windows: --stylesheet=C:/Users/aisaac/svn/aisaac/mydocs/372/372slides is producing %%% User specified packages and stylesheets \usepackage{C:\Users\aisaac\svn\aisaac\mydocs\372\372slides} The forward slashes need to be retained, of course. This might (?) be related to this in the history: docutils/utils/__init__.py find_file_in_dirs() now returns a POSIX path also on Windows; get_stylesheet_list() no longer converts "" to "/". If so, that is a breaking change. Alan Isaac |
From: Alan G. I. <ala...@gm...> - 2023-01-14 18:38:41
|
This is fixed by changing the return of LaTeXTranslator.stylesheet_call to return cmd % path.as_posix() (I.e., by converting the path to a posix representation.) Alan Isaac On 1/14/2023 12:39 PM, Alan G. Isaac wrote: > With current docutils on Windows: > --stylesheet=C:/Users/aisaac/svn/aisaac/mydocs/372/372slides > is producing > %%% User specified packages and stylesheets > \usepackage{C:\Users\aisaac\svn\aisaac\mydocs\372\372slides} > > The forward slashes need to be retained, of course. > > This might (?) be related to this in the history: > > docutils/utils/__init__.py > > find_file_in_dirs() now returns a POSIX path also on Windows; get_stylesheet_list() no longer converts "" to "/". > > If so, that is a breaking change. > > Alan Isaac |
From: Guenter M. <mi...@us...> - 2023-01-16 09:29:47
|
Dear Alan Isaac, thank you for the bug report and fix proposal. On 2023-01-14, Alan G. Isaac wrote: > This is fixed by changing the return of LaTeXTranslator.stylesheet_call to > return cmd % path.as_posix() > (I.e., by converting the path to a posix representation.) This change would mean that with ``rst2latex --stylesheet=C:\tmp\test.sty`` we will get \usepackage{C:/tmp/test} i.e. a conversion of backwards to forward slashes instead of a "literal" use as announced for "--stylesheet" arguments with the HTML writers. However, I believe this would be "the right thing" as LaTeX struggles with the backwards slashes anyway. The commit [r9316] implements a version that avoids fixes side-effects that broke the test suite with the original proposal and tries to clarify the documentation. Could you please test and tell if this is what you intended (I don't have Windows). Thanks again, Günter Milde > On 1/14/2023 12:39 PM, Alan G. Isaac wrote: >> With current docutils on Windows: >> --stylesheet=C:/Users/aisaac/svn/aisaac/mydocs/372/372slides >> is producing >> %%% User specified packages and stylesheets >> \usepackage{C:\Users\aisaac\svn\aisaac\mydocs\372\372slides} >> The forward slashes need to be retained, of course. >> This might (?) be related to this in the history: >> docutils/utils/__init__.py >> find_file_in_dirs() now returns a POSIX path also on Windows; get_stylesheet_list() no longer converts "" to "/". >> If so, that is a breaking change. >> Alan Isaac > _______________________________________________ > Docutils-users mailing list > Doc...@li... > https://lists.sourceforge.net/lists/listinfo/docutils-users > Please use "Reply All" to reply to the list. |
From: Alan G. I. <ala...@gm...> - 2023-01-16 17:14:15
|
On 1/16/2023 4:29 AM, Guenter Milde via Docutils-users wrote: > Dear Alan Isaac, > > thank you for the bug report and fix proposal. > > > The commit [r9316] implements a version that avoids fixes side-effects > that broke the test suite with the original proposal and tries to clarify > the documentation. > > Could you please test and tell if this is what you intended > (I don't have Windows). > This works for me. Note: I use --styleshseet, not --stylesheet-path I did try out the latter just fyi, and it worked, but I did not try out the relative-path expansion. Thanks! Alan |
From: Guenter M. <mi...@us...> - 2023-01-16 22:46:18
|
On 2023-01-16, Alan G. Isaac wrote: > On 1/16/2023 4:29 AM, Guenter Milde via Docutils-users wrote: >> Dear Alan Isaac, >> thank you for the bug report and fix proposal. >> The commit [r9316] implements a version that avoids fixes side-effects >> that broke the test suite with the original proposal and tries to clarify >> the documentation. >> Could you please test and tell if this is what you intended >> (I don't have Windows). > This works for me. > Note: I use --styleshseet, not --stylesheet-path > I did try out the latter just fyi, and it worked, > but I did not try out the relative-path expansion. Could you try with --stylesheet-path and also try running the test suite (docutils/tests/alltests.py), please? Günter |
From: Alan G. I. <ala...@gm...> - 2023-01-16 23:00:34
|
On 1/16/2023 5:45 PM, Guenter Milde via Docutils-users wrote: > Could you try with --stylesheet-path and also try running the test suite > (docutils/tests/alltests.py), please? Done. I ran into only the following problem: One test failed in ``alltests.py``. If I understand correctly, the result is correct, but the expected result needs fixing. Alan ====================================================================== FAIL: test_find_file_in_dirs (test_utils.HelperFunctionTests.test_find_file_in_dirs) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\software\svn\docutils-code\docutils\test\test_utils.py", line 361, in test_find_file_in_dirs self.assertEqual(utils.find_file_in_dirs('alltests.py', dirs), AssertionError: 'D:/software/svn/docutils-code/docutils/test/alltests.py' != 'D:\\software\\svn\\docutils-code\\docutils\\test\\alltests.py' - D:/software/svn/docutils-code/docutils/test/alltests.py ? ^ ^ ^ ^ ^ ^ + D:\software\svn\docutils-code\docutils\test\alltests.py ? ^ ^ ^ ^ ^ ^ ---------------------------------------------------------------------- Ran 1751 tests in 4.267s FAILED (failures=1, skipped=2) |
From: Guenter M. <mi...@us...> - 2023-01-17 17:23:08
|
On 2023-01-16, Alan G. Isaac wrote: > One test failed in ``alltests.py``. If I understand correctly, the > result is correct, but the expected result needs fixing. Could you try again with [r9323]? Thanks, Günter Milde |