Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent “helpful” redefinitions #21

Open
2 tasks
dahosek opened this issue Jun 21, 2021 · 0 comments
Open
2 tasks

Prevent “helpful” redefinitions #21

dahosek opened this issue Jun 21, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@dahosek
Copy link

dahosek commented Jun 21, 2021


Provide check to allow document classes to declare themselves bidi-aware

There should be a way for a document class to indicate to bidi that they do not need bidi to redefine things for R-L support. This often results in unexpected behavior, as indicated in the tex.se links below. Perhaps the most egregious is that a document class that builds on any of the common document classes might see its formatting overwritten because of, e.g., a few passages of Hebrew, Arabic or Persian that appear in the document.

Check/indicate

  • [x ] Relevant to the xepersian package
  • The xepersian package issue tracker has been searched for similar issues?
  • [x ] Issue tracker has been searched for similar issues?
  • [x ] Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

https://tex.stackexchange.com/questions/596977/best-practice-for-dealing-with-bidis-redefinitions-for-class-authors
https://tex.stackexchange.com/questions/602037/titlesec-package-not-suppressing-chapter-number-from-section-in-xelatex

Minimal example

does not apply, exactly, but here's an minimal version of a document class that might find itself affected:

\LoadClass{book}
\renewcommand{\thesection}{\arabic{section}}

Expected behavior

\thesection should not be modified by bidi. Perhaps by doing something like

\providecommand{\@bidiawareclass}{}

and then having bidi do a check with

\ifdef\@bidiawareclass
\else
  all the redefinitions for assorted classes go here
\fi

or alternatively, using some mechanism like etoolbox's \patchcmd and/or the newer LaTeX hooks would be a more robust way of effecting changes without necessarily damaging existing document classes. If you're open to it, I'd be willing to do a proper PR for some of that code.

@dahosek dahosek added the enhancement New feature or request label Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants