Tampilkan postingan dengan label latex. Tampilkan semua postingan
Tampilkan postingan dengan label latex. Tampilkan semua postingan

28 Agustus 2012

Fixing dagger alif in alqalam

Following the inverted damma, I found that the dagger alif is rendered incorrectly on particular letters, i.e. ا د ذ ر ز و ء. Instead of being rendered above the letter, the dagger alif is rendered after that letter. Strangely it is not recognized as diacritic/harakah, instead it is recognized as character skeleton. Thus the fix is really hacks, I haven't found what is the impact on the whole system. The hack is done on qaparse.sty and qaboxes.sty. On qaparse.sty we do the following hacks:

--- qaparse.sty 
+++ origin/qaparse.sty 
@@ -880,12 +880,10 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%% special vowels %%%%%%%%%%%%%%%%%%%%%%%%%% 
 
 \def \sv@a@a #1{% Qur'an alif
- %% \if\xpa\is@in@list \the\last@con dFraQzw>%
- %%  \if\is@in@list #1TA>\add@fathaspec%
- %%  \else\put@syl\tashiltrue\put@con\a@alif@kh\fi%
- %% \else\add@fathaspec\fi%
-        \add@fathaspec%
+ \if\xpa\is@in@list \the\last@con dFraQzw>%
+  \if\is@in@list #1TA>\add@fathaspec%
+  \else\put@syl\tashiltrue\put@con\a@alif@kh\fi%
+ \else\add@fathaspec\fi%
  \stepcounter{qm@rk}%                          % to allow multiple floors for quran marks 
 \case #1\of%
 {   \a@H {\put@con \a@H\put@syl\syl@con}%

On qaboxes.sty we do the following hacks:
--- qaboxes.sty 
+++ origin/qaboxes.sty 
@@ -518,10 +518,7 @@
 \put@hi {\char\a@hamz@s}\or                           % 27
 \put@lo {\char\a@hamz@s}\or                           % 28
 \put@aya\or                                           % 29
-% we shall hack this because it triggers alif dagger harakat error in the following char
-%    ا د ذ ر ز و ء 
-%\put@alif{\char\a@quran@alif}\or                      % 30                                   % 30
-\put@fathaspec\or
+\put@alif{\char\a@quran@alif}\or                      % 30                                   % 30
 \put@hi {\a@syeh}\or                                  % 31
 \put@hi {\char 2 }\or                           % illegal
 \else \put@hi {\char 2 }\or                           % illegal

26 Agustus 2012

Fixing inverted damma in alqalam

I found problem when typeset inverted damma in alqalam. To fix this I have to traverse across the module, because I could not find adequate  documentation about the structure, much worse I have never programmed any latex stuff.
In brief the flow is the following:
1. UTF code is processed in qutfcode.sty. Inverted damma UTF code is d997 (don't get confused with reversed damma). It was not encoded on alqalam version 427/08/17 0.2. Thus I add the encoding "\n@xp\a@u.
Note: some important arabic UTF code can be observed on utf8-chartable.de
2. The "\n@xp\a@u code then will be translated into integer in qaparse.sty. It is encoded as \c@ammad, with integer code 12.
3. Then in qaboxes.sty on function \put@voc case 12, the inverted damma character is translated as \a@ammad to be written.
4. Finally the code is mapped into the font glyph at qxarbsymb.sty.
\chardef \a@ammad = '146.
This is a simple code to view the glyph:

\documentclass{article}
\usepackage{fonttable}
\pagestyle{empty}
\begin{document}
\fonttable{qnskh14} %this is default font in alqalam
\end{document}

02 Mei 2011

basic table in latex



Here is a quite basic plus table creation in latex

\begin{tabular}{|l|l|l|l|l|l|l|l|}  \hline
& & &\multicolumn{5}{|c|}{Internalsinl} \\ \cline{4-8}
ID&Art&Test& aa1,12bb&aa1,100bb&aa1,1ujbb&aa1,1uj0bb&aa1,1ujbb $\cup$ \\
& & & & & & & aa1001,1uj0bb \\ \hline
Axd &Thi s time &Ex spr & hjtp & hjtp & hjtp & hjtp & hjtp \\ \cline{3-8}
&fora frica &Vale & 80 & hjtp & 1xd2& 6d44& 628r \\
& os bam b & & & & & & \\ \hline
Dxd &Waakaka &Expqr & xd2 & xd2 & xd2 & xd2 & xd2 \\ \cline{3-8}
&euey eee &Valy & xd6 & xd6 & 4x8 & 1f16& 1g12 \\ \hline
\end{tabular}

  • First line {|l ....|} determines the column, possible value "l/r/c", and without "|" means without vertical line
  • "&" separate each item in column
  • "cline" line on certain column
  • "hline" horizontal line entire column
  • beware of the number of "&" on each line,
  • every line ends with "\\"

17 Februari 2011

ins dtx and sty

Often when we need an extra package on latex we get a zip file contains *.ins and *.dtx. I just learn today that those files will create the *.sty and the documentation.
First run latex on the *.ins (mainly for creating the *.sty) and then run *.dtx several times (mainly for creating the documentation).
More explanation is here.