Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

LaTeX: withliteralinclude directives, TABs are converted in PDF into 8 spaces, independently of their location #14064

Open
@jfbu

Description

@jfbu

Describe the bug

Tabulation characters from files which get inserted usingliteralinclude end up "as is" both in the.html and in the.tex file produced by the respective builders.

In the PDF they get converted to 8 spaces, independently of their location.

This is in contrast with viewing the HTML where at least with my Firefox the rendering uses tab stops every 8 characters. Note though that I have found notab-size setting for<pre> in the CSS files (when building the MWE below) so this may be browser dependent. Indeed, I am ignorant if there is a universal convention that in absence oftab-size, tab stops inside<pre> are every 8 characters.

Important: here we do not use:tab-width: option. If using that option tabs are converted to spaces both with LaTeX and HTML and the outputs match one another with tab stops matching the option (only tested with:tab-width: 8).

How to Reproduce

.. literalinclude:: filewithtabs.txt

withfilewithtabs.txt being

============================LINUX KERNEL MEMORY BARRIERS============================hellowherearelittletabsgone?

PDF output:

Image

HTML:

Image

Environment Information

Platform:              darwin; (macOS-15.7.2-arm64-arm-64bit-Mach-O)Python version:        3.13.3 (v3.13.3:6280bb54784, Apr  8 2025, 10:47:54) [Clang 15.0.0 (clang-1500.3.9.4)])Python implementation: CPythonSphinx version:        8.3.0+/5d0ad1686Docutils version:      0.22.4b1.devJinja2 version:        3.1.6Pygments version:      2.19.1

Sphinx extensions

Additional context

Tested with Docutils0.22.3 and0.21.2.

This issue was originally reported at#13656 (comment) by@akiyks.

Note that as work-around it is enough to add:tab-width: 8 option to theliteralinclude directive. Then the.tex file (and also.html) will contain only spaces, matching tab-stops at each multiple of 8 characters.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp