@drghaliasri/butex 6.1.3 → 6.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/document2-cli.js.map +1 -1
- package/dist/document2.d.mts +33 -2
- package/dist/document2.d.ts +33 -2
- package/dist/document2.js +430 -44
- package/dist/document2.js.map +1 -1
- package/dist/document2.mjs +421 -39
- package/dist/document2.mjs.map +1 -1
- package/dist/react-document2.d.mts +10 -2
- package/dist/react-document2.d.ts +10 -2
- package/dist/react-document2.js +521 -49
- package/dist/react-document2.js.map +1 -1
- package/dist/react-document2.mjs +521 -49
- package/dist/react-document2.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -254,13 +254,13 @@ const latex = document2Latex(documentNode);
|
|
|
254
254
|
const preview = document2Preview(documentNode, 'svg');
|
|
255
255
|
```
|
|
256
256
|
|
|
257
|
-
`document2Latex(doc)` emits a **complete Arabic XeLaTeX document** by default (preamble + `\begin{document}` + body + `\end{document}`). Structured and editor-authored Arabic roots serialize with the canonical `\arsqrt`; the bundled preamble also accepts raw legacy `\arabsqrt` with the same optional-index signature. It defines BuTeX font wrappers (`\butextakween`, `\butexdiwani`, `\butexdiwanioutline`, `\butexmaghribi`) and the MathJax-compatible `\butexmirror` bridge. The
|
|
257
|
+
`document2Latex(doc)` emits a **complete Arabic XeLaTeX document** by default (preamble + `\begin{document}` + body + `\end{document}`). Structured and editor-authored Arabic roots serialize with the canonical `\arsqrt`; the bundled preamble also accepts raw legacy `\arabsqrt` with the same optional-index signature. It defines BuTeX font wrappers (`\butextakween`, `\butexdiwani`, `\butexdiwanioutline`, `\butexmaghribi`) and the MathJax-compatible `\butexmirror` bridge. The title-path basmala keeps its Maghribi title styling; the fixed closing hamdala is emitted as normal centered `\maghribi` text rather than display math so it participates in ordinary column/page flow. Pass `{ wrapDocument: false }` for body-only blocks. Paragraph blocks export as `\par` followed by the inline content, so prose, citations, and math are not wrapped inside `\paragraph{...}`. Optional `digitsMapping: 'arabicdigits' | 'digits'` controls eastern vs western digit font mapping in the preamble (default `'arabicdigits'`). Pass `{ twocolumn: true }` for `\documentclass[12pt,a4paper,notitlepage,twocolumn]{article}`; title content stays in-column and Document2 figure/table floats use fixed `[H]` placement (with the `float` package) so source block order remains predictable. Figures continue to use `\columnwidth`. See [`examples/example-latex-export.tex`](examples/example-latex-export.tex) for a full sample (regenerated by the wrap vitest). Hosts can also call `getArabicXeLatexPreamble()` alone.
|
|
258
258
|
|
|
259
259
|
For XeLaTeX compiler images, install `src/fonts/Almaghribi-Warsh-Quran.otf` as a system font and refresh fontconfig (`fc-cache -f -v`). Verify with `fc-match "Almaghribi Warsh Quran"`; the preamble uses that installed family name.
|
|
260
260
|
|
|
261
261
|
To add another character font, add its metadata to `src/editor/characterFonts.ts` and its browser `@font-face` asset to `src/diwani-font.ts`.
|
|
262
262
|
|
|
263
|
-
Figures and tables
|
|
263
|
+
Figures and tables export as centered `figure` / `table` environments. In one-column export they retain normal `[htbp]` float placement; in `twocolumn` export they use fixed `[H]` placement to avoid unexpected reordering/gaps. Simple editor table column specifications made only from `l`, `c`, and `r` (for example `lll`) receive a visible grid by default (`|l|l|l|` plus `\hline`); explicitly structured specifications such as `c|c` are preserved. Optional caption/label fields emit `\caption` / `\label`; a labeled figure/table without a caption uses `\refstepcounter{figure}` / `\refstepcounter{table}` before its label so the reference owns the correct counter. Display math stays `\[…\]` unless an equation label is enabled, then export uses `\begin{equation}…\label{…}\end{equation}`. Internal cross-refs still store `\ref` / `\eqref` tokens separately from bibliography `\cite`, but LaTeX export adds the known Arabic object type (`الشكل`, `الجدول`, or `المعادلة`) when the reference target is known and the prose immediately before the token has not already named that type.
|
|
264
264
|
|
|
265
265
|
V2 exports Arabic TeX by default for equations saved from the embedded editor. Imported raw-only math is preserved as raw source and marked non-editable until a structured equation object is attached.
|
|
266
266
|
|