Skip to content

mplibcode is not bidi aware #129

Open
@u-fischer

Description

@u-fischer

(extracted from https://tex.stackexchange.com/questions/716319/has-anything-gone-wrong-with-mpchess)

mplibcode is not bidi aware. In the following example, the content of the mplibcode spills out of the bounding box if the direction is set to TRT:

\documentclass{book}
\usepackage{luamplib}

\usepackage{fontspec}
\setmainfont{amiri}
\begin{document}\showoutput
\pardir TRT \textdir TRT

هذا النص يمكن أن يتم تركيبه على أي تصميم دون مشكلة فلن يبدو وكأنه نص منسوخ، غير منظم، غير منسق، أو حتى غير مفهوم. لأنه مازال نصاً بديلاً ومؤقتاً.
\fbox{\begin{mplibcode}
beginfig(0);
color red ; red = (1, 0, 0) ;
fill (0,0)--(100,0)--(100,100)--(0,100)--cycle withcolor red;
endfig;
\end{mplibcode}}
هذا النص يمكن أن يتم تركيبه على أي تصميم دون مشكلة فلن يبدو وكأنه نص منسوخ، غير منظم، غير منسق، أو حتى غير مفهوم. لأنه مازال نصاً بديلاً ومؤقتاً.

\end{document}

image

everything is fine without the \pardir TRT \textdir TRT:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions