I know this question sounds ridiculous, but I wonder if there is a way to align equations without using the align
, gather
, or any environment in general. Basically using TeX and LaTeX primitive to not-package-related commands.
The reason is because a package I'm using does not allow for my usage of equations inside separate blocks or in most environments. The package I'm using is called RyDarab, which unfortunately has very little documentation.
EDIT: Here's what I'm trying to do:
\begin{align*}
\amsin{Z} &= {\frac{1}{\amcsc{Z}}} \amcos{Z} &= {\frac{1}{\amsec{Z}}} \amtan{Z} &= {\frac{1}{\amcot{Z}}} \\
\amcsc{Z} &= {\frac{1}{\amsin{Z}}} \amsec{Z} &= {\frac{1}{\amcos{Z}}} \amcot{Z} &= {\frac{1}{\amtan{Z}}}
\end{align*}
All these trig. functions are redefined in the preamble since RyDarab defines them, but I dislike the default font it uses. I don't know if it's necessary, but just in case:
\renewcommand{\amsin}[1]{\ensuremath{{#1} \ \text{جا}}}
\renewcommand{\amcos}[1]{\ensuremath{{#1} \ \text{جتا}}}
\renewcommand{\amtan}[1]{\ensuremath{{#1} \ \text{ظا}}}
\renewcommand{\amcsc}[1]{\ensuremath{{#1} \ \text{قتا}}}
\renewcommand{\amsec}[1]{\ensuremath{{#1} \ \text{قا}}}
\renewcommand{\amcot}[1]{\ensuremath{{#1} \ \text{ظتا}}}
I'm using XeLaTeX to write in Arabic. Of course, polyglossia
is used.
Now, in theory, this should work, but it reveals a very annoying error:
\let \split \insplit@ \DN@ {\align@ \st@rredtrue }\fi \fi \collect@body \ETC.
! Paragraph ended before \amrlpard was complete.
<to be read again>
\par
This error appears A LOT. Here's how \amrlpard
is defined under the hood:
\def\amrlpard#1$${\testr#1\eqno\eqno\testr}
\def\testr#1\eqno#2\eqno#3\testr{\if!#3!\testl#1\leqno\leqno\testl\else\amrl{#1}\eqno#2$$\fi}
\def\testl#1\leqno#2\leqno#3\testl{\if!#3!\amrl{#1}$$\else\amrl{#1}\leqno#2$$\fi}
Now I have no idea what this does, it's completely incomprehensible for me.
Yes, I know the package is not found everywhere. It needs a lot of updating (last time it was updated was 2008 I guess), and more documentation. But it's the only package that does what I want it to do.
If you want to install RyDarab to find the sty
file, here's the link, I don't think there's any other way to look at the internal files without installing it.
UPDATE 2: I read the answer, but I do not understand then why this piece of code doesn't work:
$${\amsin{Z}} & { = {\frac{1}{\amcsc{Z}}}} {\amcos{Z}} & { = {\frac{1}{\amsec{Z}}}} {\amtan{Z}} & { = {\frac{1}{\amcot{Z}}}} \cr
{\amcsc{Z}} & { = {\frac{1}{\amsin{Z}}}} {\amsec{Z}} & { = {\frac{1}{\amcos{Z}}}} {\amcot{Z}} & { ={ \frac{1}{\amtan{Z}}}}$$
UPDATE 3: Here's the full code:
\documentclass[a4paper, 12pt]{article}
\usepackage{amsmath}
\usepackage{fontspec}
\usepackage{polyglossia}
%\usepackage{ramzarab}
\usepackage{rydarab}
\input amarabiwords % required for XeLateX to mention this explicitly
\funwithdots % required for XeLateX to mention this explicitly
\setmainlanguage{arabic}
\setmainfont[Script=Arabic]{Amiri}
\renewcommand{\amsin}[1]{\ensuremath{{#1} \ \text{جا}}}
\renewcommand{\amcos}[1]{\ensuremath{{#1} \ \text{جتا}}}
\renewcommand{\amtan}[1]{\ensuremath{{#1} \ \text{ظا}}}
\renewcommand{\amcsc}[1]{\ensuremath{{#1} \ \text{قتا}}}
\renewcommand{\amsec}[1]{\ensuremath{{#1} \ \text{قا}}}
\renewcommand{\amcot}[1]{\ensuremath{{#1} \ \text{ظتا}}}
\begin{document}
$${\amsin{Z}} & { = {\frac{1}{\amcsc{Z}}}} {\amcos{Z}} & { = {\frac{1}{\amsec{Z}}}} {\amtan{Z}} & { = {\frac{1}{\amcot{Z}}}} \cr
{\amcsc{Z}} & { = {\frac{1}{\amsin{Z}}}} {\amsec{Z}} & { = {\frac{1}{\amcos{Z}}}} {\amcot{Z}} & { ={ \frac{1}{\amtan{Z}}}}$$
\end{document}
.sty
...?amsmath
couldn't do it either! Can you share an example of what you've currently got, using theRyDarab
package?$$
are depreciated.tabstackengine
package allows for aligned constructs as a macro command...doesn't even have to be in an equation, but works fine inside a normalequation
environment.