rtl help #4588
Replies: 2 comments 13 replies
-
@emilyyyylime you write Hebrew no? |
Beta Was this translation helpful? Give feedback.
-
היי 👋 There’s Katvan by @IgKh, which is a text editor made with special care for the issue of intertwined RTL and LTR segments in Typst. If you like its bare-bones approach, there you go. If like me you prefer to have a fully-fledged text editor at your fingertips, with all the modern goodness, give NeoVim a try. It plays extremely well with LSP (tinymist, and supposedly also typst-lsp which I didn’t try); this upgrades the coding/writing experience remarkably. Anyway, regarding the BiDi matter in question, NeoVim’s approach inherits from Vim’s one, which is like so: either a window¹ is fully LTR, presenting each letter in the order it is encoded in the buffer from left to right, or fully RTL, from right to left. You can map a key combination or sequence to toggle between LTR and RTL modes². It takes some time to change your habits from what you are accustomed to in WYSIWYG editors, browser textboxes and almost everywhere nowadays to a this way of working, but IMHO it is worthwhile in the long run if you are going to type a lot in Typst (or LaTeX for that matter), intertwining RTL and LTR sequences. This way you see directly what appears in the file, unclouded by BiDi algorithms. If needed, you can split a buffer between two windows and set each the other directionality. I wrote my Master’s thesis with this approach, using LaTeX (PDF, source files and meta information), so I can testify for its efficiency with complex BiDi files (a Hebrew linguistic text involving a lot of Old English words and LaTeX commands in my case, not Hebrew Typst’s math, but the principle is the same…). For completion, ages ago I wrote this page; most of what I wrote there is greatly outdated, but the principle of what I wrote about Hebrew there stays true. ¹ In the *Vim sense. ² I use double space, as I (almost) never type two spaces sequentially: vim.keymap.del("n", "<Space><Space>")
vim.keymap.set({ "n" }, "<Space><Space>", function()
vim.opt.rl = not vim.opt.rl:get()
end, { desc = "Toggle directionality" }) |
Beta Was this translation helpful? Give feedback.
-
long story short, I've been using typst for school for a few good months now. very satisfied with the language, yet due to me studying in Israel, I gotta use Hebrew (rtl). The thing is, neither the web app or vscode support proper rtl text editing, and it doesn't seem to change anytime soon. Any suggestions? Stuff like msword seems horrible for math compared to typst, and I'm willing to give up the visual aspect.
Beta Was this translation helpful? Give feedback.
All reactions