summaryrefslogtreecommitdiff
path: root/macros/latex/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib')
-rw-r--r--macros/latex/contrib/easybook/README.md2
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx22
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin622175 -> 622172 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.tex4
-rw-r--r--macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.pdfbin196228 -> 197707 bytes
-rw-r--r--macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.tex14
-rw-r--r--macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.pdfbin126738 -> 126738 bytes
-rw-r--r--macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.tex2
-rw-r--r--macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.pdfbin158189 -> 158322 bytes
-rw-r--r--macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.tex2
-rw-r--r--macros/latex/contrib/resolsysteme/tex/ResolSysteme.sty191
-rw-r--r--macros/latex/contrib/tiet-question-paper/LICENSE26
-rw-r--r--macros/latex/contrib/tiet-question-paper/README.md151
-rw-r--r--macros/latex/contrib/tiet-question-paper/images/sample.pngbin0 -> 10575 bytes
-rw-r--r--macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample-org.org182
-rw-r--r--macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample-org.pdfbin0 -> 27901 bytes
-rw-r--r--macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample-org.tex204
-rw-r--r--macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample.pdfbin0 -> 38647 bytes
-rw-r--r--macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample.tex180
-rw-r--r--macros/latex/contrib/tiet-question-paper/tiet-question-paper.cls337
20 files changed, 1202 insertions, 115 deletions
diff --git a/macros/latex/contrib/easybook/README.md b/macros/latex/contrib/easybook/README.md
index 9271e95dda..0f25469ccf 100644
--- a/macros/latex/contrib/easybook/README.md
+++ b/macros/latex/contrib/easybook/README.md
@@ -1,5 +1,5 @@
# The `easybook` document class
-Easily typesetting Chinese theses or books (v2024ch)
+Easily typesetting Chinese theses or books (v2024ci)
## Abstract
`easybook` is a pure academic template created based on the `ctexbook` book document class. It also has the functions of `book` and `article` document class. Combined with the general framework design of the theses of many universities in China, providing multiple commands and interfaces allows users to easily customize the theses templates. Its basic macro package `easybase` can also be used with `ctex` and standard document classes.
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index e39c80ee84..65492e93f7 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -14,13 +14,13 @@
% This work has the LPPL maintenance status `maintained'.
%<class|package>\NeedsTeXFormat{LaTeX2e}[2021/11/15]
%<*class>
-\ProvidesExplClass{easybook}{2024/06/20}{2024ch}
+\ProvidesExplClass{easybook}{2024/06/22}{2024ci}
{Easily typesetting Chinese theses or books}
\bool_new:N \l__eb_compile_draft_bool
\bool_new:N \l__eb_title_newline_bool
-\bool_set_true:N \l__eb_class_mode_book_bool
-\clist_new:N \g__eb_doc_options_clist
+\bool_set_true:N \l__eb_class_mode_book_bool
+\clist_new:N \g__eb_doc_options_clist
\cs_new_protected:Npn \eb_put_ctexbook:n #1
{ \PassOptionsToClass{#1}{ctexbook} }
\cs_generate_variant:Nn \eb_put_ctexbook:n { V }
@@ -66,10 +66,11 @@
\sys_if_engine_xetex:TF
{
- \cs_new_eq:NN \eb_set_family:nnn \xeCJK_set_family:nnn
+ \cs_new_eq:NN \eb_set_family:nnn \xeCJK_set_family:nnn
\cs_new_eq:NN \eb_switch_family:n \xeCJK_switch_family:n
- }{
- \cs_new_eq:NN \eb_set_family:nnn \ctex_ltj_set_family:nnn
+ }
+ {
+ \cs_new_eq:NN \eb_set_family:nnn \ctex_ltj_set_family:nnn
\cs_new_eq:NN \eb_switch_family:n \ctex_ltj_switch_family:n
}
\cs_generate_variant:Nn \eb_set_family:nnn { x }
@@ -300,7 +301,7 @@
%</class>
%<*package>
\RequirePackage{etoolbox}
-\ProvidesExplPackage{easybase}{2024/06/20}{2024ch}
+\ProvidesExplPackage{easybase}{2024/06/22}{2024ci}
{Easily typesetting Chinese theses or books}
\cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -1023,7 +1024,7 @@
{
\noindent
\clist_if_in:NnT \l__eb_footnote_value_clist { flush }
- { \dim_zero:N \fnfirstindent }
+ { \tl_set:Nn \fnfirstindent { 0pt } }
\int_case:nn { \dim_sign:V \fnfirstindent }
{
{ 1 } { \use_i:nnn }
@@ -1771,8 +1772,7 @@
{
\tl_if_exist:cF { tf@#1 }
{ \iow_new:c { tf@#1 }\iow_open:cn { tf@#1 } { \jobname.#1 } }
- }
- {}
+ }{}
}
\cs_set_eq:NN \eb@starttoc \@starttoc
\cs_set:Npn \@starttoc #1
@@ -2625,7 +2625,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2024/06/20}{2024ch}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2024/06/22}{2024ci}
{Customization of tcolorbox for easybook}
\cs_set_protected:Npn \addtotcbstyle #1#2
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index d579c93843..65c2f3233c 100644
--- a/macros/latex/contrib/easybook/easybook.pdf
+++ b/macros/latex/contrib/easybook/easybook.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex
index ca0bcee595..7dad336839 100644
--- a/macros/latex/contrib/easybook/easybook.tex
+++ b/macros/latex/contrib/easybook/easybook.tex
@@ -23,8 +23,8 @@
name = easybook,
color-scheme = blue,
title = EASYBOOK使用手册,
- version = v2024ch,
- date = 2024/06/21,
+ version = v2024ci,
+ date = 2024/06/22,
authors = 瞿毅,
info = 简便地排版中文学位论文或书籍,
email = toquyi@163.com,
diff --git a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.pdf b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.pdf
index 1ee7bc9bba..6e42e68df9 100644
--- a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.pdf
+++ b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.tex b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.tex
index 97155dee5c..dde087fc1c 100644
--- a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.tex
+++ b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.tex
@@ -3,8 +3,8 @@
% arara: lualatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)')
\documentclass[french,a4paper,11pt]{article}
-\def\TPversion{0.1.6}
-\def\TPdate{2 avril 2024}
+\def\TPversion{0.1.7}
+\def\TPdate{22 juin 2024}
\usepackage[executable=python.exe]{pyluatex}
\usepackage[table,svgnames]{xcolor}
\usepackage{amsmath,amssymb}
@@ -319,6 +319,8 @@ L'idée est ici de proposer une version, adaptée à des dimensions classiques,
\part{Historique}
+\verb|v0.1.6|~:~~~~Correction de bugs dans certains calculs avec des fractions.
+
\verb|v0.1.6|~:~~~~Correction de bugs dans certains calculs.
\verb|v0.1.5|~:~~~~Inverse d'une matrice 4x4 et système 4x4 (même en normal).
@@ -906,6 +908,12 @@ est $\mathcal{S}=%
\end{PresentationCode}
\begin{PresentationCode}{}
+La solution de $\systeme{\frac{2}{7}x + \frac{5}{9}y = 13,\frac{73}{37} x - 9y=-11}$
+est $\mathcal{S}=
+\left\lbrace \SolutionSysteme[d](2/7,5/9 § 73/37,-9)(13,-11) \right\rbrace$.
+\end{PresentationCode}
+
+\begin{PresentationCode}{}
%version python
La solution de $\systeme[xyzt]{x+2y+3z+4t=-10,5x+6y+7z=0,x+y+z+t=4,-2x-3y-5z-6t=7}$
est $\mathcal{S}=%
@@ -922,8 +930,6 @@ La solution de $\systeme{x+2y=-5,4x+8y=1}$ est $\mathcal{S}=%
\left\lbrace \SolutionSystemePY(1,2 § 4,8)(-5,1) \right\rbrace$.
\end{PresentationCode}
-\pagebreak
-
\section{Recherche d'un état stable (graphe probabiliste)}
\subsection{Introduction}
diff --git a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.pdf b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.pdf
index d5bc819d92..8aa1f3642e 100644
--- a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.pdf
+++ b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.pdf
Binary files differ
diff --git a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.tex b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.tex
index 407a26aa3e..3527a58223 100644
--- a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.tex
+++ b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.tex
@@ -2,7 +2,7 @@
% !TeX TXS-program:compile = txs:///lualatex/[--shell-escape]
\documentclass[french,a4paper,10pt]{article}
-\def\RSver{0.1.6}
+\def\RSver{0.1.7}
\usepackage[margin=1.5cm]{geometry}
\usepackage[executable=python.exe]{pyluatex}
\usepackage[pyluatex]{ResolSysteme}
diff --git a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.pdf b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.pdf
index cd7b6e1fd3..59e5819a3a 100644
--- a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.pdf
+++ b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.pdf
Binary files differ
diff --git a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.tex b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.tex
index 0eb228e552..ffec22fb9f 100644
--- a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.tex
+++ b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.tex
@@ -2,7 +2,7 @@
% !TeX TXS-program:compile = txs:///pdflatex
\documentclass[french,a4paper,10pt]{article}
-\def\RSver{0.1.6}
+\def\RSver{0.1.7}
\usepackage[margin=1.5cm]{geometry}
\usepackage{ResolSysteme}
\usepackage{systeme}
diff --git a/macros/latex/contrib/resolsysteme/tex/ResolSysteme.sty b/macros/latex/contrib/resolsysteme/tex/ResolSysteme.sty
index 025ea98cfe..a7e95078fa 100644
--- a/macros/latex/contrib/resolsysteme/tex/ResolSysteme.sty
+++ b/macros/latex/contrib/resolsysteme/tex/ResolSysteme.sty
@@ -2,7 +2,8 @@
% licence........: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ResolSysteme}[2024/04/02 v0.1.6 Quelques commandes pour travailler avec des matrices et des sytemes lineaires]
+\ProvidesPackage{ResolSysteme}[2024/06/22 v0.1.7 Quelques commandes pour travailler avec des matrices et des sytemes lineaires]
+% 0.1.7 Correction de bugs dans certains calculs
% 0.1.6 Correction de bugs dans certains calculs
% 0.1.5 Inverse d'une matrice en 4x4 (même en normal !) + Système 4x4 (en normal !)
% 0.1.4 Travail sur graphe probabiliste (2x2/3x3/4x4 en python, ou 2x2 en normal...) + Calculs 4x4 en normal
@@ -612,40 +613,40 @@ def etat_prob_DD(AA,BB,a,b,c,d,puiss) :
{%
\IfBooleanTF{#1}%
{%
- \def\MatInvA{\ConvVersFrac*[#2]{(\MatF*\MatK*\MatP+\MatG*\MatL*\MatN+\MatH*\MatJ*\MatO-\MatF*\MatL*\MatO-\MatG*\MatJ*\MatP-\MatH*\MatK*\MatN)/\DETMATRICE}}%
- \def\MatInvB{\ConvVersFrac*[#2]{(\MatB*\MatL*\MatO+\MatC*\MatJ*\MatP+\MatD*\MatK*\MatN-\MatB*\MatK*\MatP-\MatC*\MatL*\MatN-\MatD*\MatJ*\MatO)/\DETMATRICE}}%
- \def\MatInvC{\ConvVersFrac*[#2]{(\MatB*\MatG*\MatP+\MatC*\MatH*\MatN+\MatD*\MatF*\MatO-\MatB*\MatH*\MatO-\MatC*\MatF*\MatP-\MatD*\MatG*\MatN)/\DETMATRICE}}%
- \def\MatInvD{\ConvVersFrac*[#2]{(\MatB*\MatH*\MatK+\MatC*\MatF*\MatL+\MatD*\MatG*\MatJ-\MatB*\MatG*\MatL-\MatC*\MatH*\MatJ-\MatD*\MatF*\MatK)/\DETMATRICE}}%
- \def\MatInvE{\ConvVersFrac*[#2]{(\MatE*\MatL*\MatO+\MatG*\MatI*\MatP+\MatH*\MatK*\MatM-\MatE*\MatK*\MatP-\MatG*\MatL*\MatM-\MatH*\MatI*\MatO)/\DETMATRICE}}%
- \def\MatInvF{\ConvVersFrac*[#2]{(\MatA*\MatK*\MatP+\MatC*\MatL*\MatM+\MatD*\MatI*\MatO-\MatA*\MatL*\MatO-\MatC*\MatI*\MatP-\MatD*\MatK*\MatM)/\DETMATRICE}}%
- \def\MatInvG{\ConvVersFrac*[#2]{(\MatA*\MatH*\MatO+\MatC*\MatE*\MatP+\MatD*\MatG*\MatM-\MatA*\MatG*\MatP-\MatC*\MatH*\MatM-\MatD*\MatE*\MatO)/\DETMATRICE}}%
- \def\MatInvH{\ConvVersFrac*[#2]{(\MatA*\MatG*\MatL+\MatC*\MatH*\MatI+\MatD*\MatE*\MatK-\MatA*\MatH*\MatK-\MatC*\MatE*\MatL-\MatD*\MatG*\MatI)/\DETMATRICE}}%
- \def\MatInvI{\ConvVersFrac*[#2]{(\MatE*\MatJ*\MatP+\MatF*\MatL*\MatM+\MatH*\MatI*\MatN-\MatE*\MatL*\MatN-\MatF*\MatI*\MatP-\MatH*\MatJ*\MatM)/\DETMATRICE}}%
- \def\MatInvJ{\ConvVersFrac*[#2]{(\MatA*\MatL*\MatN+\MatB*\MatI*\MatP+\MatD*\MatJ*\MatM-\MatA*\MatJ*\MatP-\MatB*\MatL*\MatM-\MatD*\MatI*\MatN)/\DETMATRICE}}%
- \def\MatInvK{\ConvVersFrac*[#2]{(\MatA*\MatF*\MatP+\MatB*\MatH*\MatM+\MatD*\MatE*\MatN-\MatA*\MatH*\MatN-\MatB*\MatE*\MatP-\MatD*\MatF*\MatM)/\DETMATRICE}}%
- \def\MatInvL{\ConvVersFrac*[#2]{(\MatA*\MatH*\MatJ+\MatB*\MatE*\MatL+\MatD*\MatF*\MatI-\MatA*\MatF*\MatL-\MatB*\MatH*\MatI-\MatD*\MatE*\MatJ)/\DETMATRICE}}%
- \def\MatInvM{\ConvVersFrac*[#2]{(\MatE*\MatK*\MatN+\MatF*\MatI*\MatO+\MatG*\MatJ*\MatM-\MatE*\MatJ*\MatO-\MatF*\MatK*\MatM-\MatG*\MatI*\MatN)/\DETMATRICE}}%
- \def\MatInvN{\ConvVersFrac*[#2]{(\MatA*\MatJ*\MatO+\MatB*\MatK*\MatM+\MatC*\MatI*\MatN-\MatA*\MatK*\MatN-\MatB*\MatI*\MatO-\MatC*\MatJ*\MatM)/\DETMATRICE}}%
- \def\MatInvO{\ConvVersFrac*[#2]{(\MatA*\MatG*\MatN+\MatB*\MatE*\MatO+\MatC*\MatF*\MatM-\MatA*\MatF*\MatO-\MatB*\MatG*\MatM-\MatC*\MatE*\MatN)/\DETMATRICE}}%
- \def\MatInvP{\ConvVersFrac*[#2]{(\MatA*\MatF*\MatK+\MatB*\MatG*\MatI+\MatC*\MatE*\MatJ-\MatA*\MatG*\MatJ-\MatB*\MatE*\MatK-\MatC*\MatF*\MatI)/\DETMATRICE}}%
+ \def\MatInvA{\ConvVersFrac*[#2]{(\MatF*\MatK*\MatP+\MatG*\MatL*\MatN+\MatH*\MatJ*\MatO-\MatF*\MatL*\MatO-\MatG*\MatJ*\MatP-\MatH*\MatK*\MatN)/(\DETMATRICE)}}%
+ \def\MatInvB{\ConvVersFrac*[#2]{(\MatB*\MatL*\MatO+\MatC*\MatJ*\MatP+\MatD*\MatK*\MatN-\MatB*\MatK*\MatP-\MatC*\MatL*\MatN-\MatD*\MatJ*\MatO)/(\DETMATRICE)}}%
+ \def\MatInvC{\ConvVersFrac*[#2]{(\MatB*\MatG*\MatP+\MatC*\MatH*\MatN+\MatD*\MatF*\MatO-\MatB*\MatH*\MatO-\MatC*\MatF*\MatP-\MatD*\MatG*\MatN)/(\DETMATRICE)}}%
+ \def\MatInvD{\ConvVersFrac*[#2]{(\MatB*\MatH*\MatK+\MatC*\MatF*\MatL+\MatD*\MatG*\MatJ-\MatB*\MatG*\MatL-\MatC*\MatH*\MatJ-\MatD*\MatF*\MatK)/(\DETMATRICE)}}%
+ \def\MatInvE{\ConvVersFrac*[#2]{(\MatE*\MatL*\MatO+\MatG*\MatI*\MatP+\MatH*\MatK*\MatM-\MatE*\MatK*\MatP-\MatG*\MatL*\MatM-\MatH*\MatI*\MatO)/(\DETMATRICE)}}%
+ \def\MatInvF{\ConvVersFrac*[#2]{(\MatA*\MatK*\MatP+\MatC*\MatL*\MatM+\MatD*\MatI*\MatO-\MatA*\MatL*\MatO-\MatC*\MatI*\MatP-\MatD*\MatK*\MatM)/(\DETMATRICE)}}%
+ \def\MatInvG{\ConvVersFrac*[#2]{(\MatA*\MatH*\MatO+\MatC*\MatE*\MatP+\MatD*\MatG*\MatM-\MatA*\MatG*\MatP-\MatC*\MatH*\MatM-\MatD*\MatE*\MatO)/(\DETMATRICE)}}%
+ \def\MatInvH{\ConvVersFrac*[#2]{(\MatA*\MatG*\MatL+\MatC*\MatH*\MatI+\MatD*\MatE*\MatK-\MatA*\MatH*\MatK-\MatC*\MatE*\MatL-\MatD*\MatG*\MatI)/(\DETMATRICE)}}%
+ \def\MatInvI{\ConvVersFrac*[#2]{(\MatE*\MatJ*\MatP+\MatF*\MatL*\MatM+\MatH*\MatI*\MatN-\MatE*\MatL*\MatN-\MatF*\MatI*\MatP-\MatH*\MatJ*\MatM)/(\DETMATRICE)}}%
+ \def\MatInvJ{\ConvVersFrac*[#2]{(\MatA*\MatL*\MatN+\MatB*\MatI*\MatP+\MatD*\MatJ*\MatM-\MatA*\MatJ*\MatP-\MatB*\MatL*\MatM-\MatD*\MatI*\MatN)/(\DETMATRICE)}}%
+ \def\MatInvK{\ConvVersFrac*[#2]{(\MatA*\MatF*\MatP+\MatB*\MatH*\MatM+\MatD*\MatE*\MatN-\MatA*\MatH*\MatN-\MatB*\MatE*\MatP-\MatD*\MatF*\MatM)/(\DETMATRICE)}}%
+ \def\MatInvL{\ConvVersFrac*[#2]{(\MatA*\MatH*\MatJ+\MatB*\MatE*\MatL+\MatD*\MatF*\MatI-\MatA*\MatF*\MatL-\MatB*\MatH*\MatI-\MatD*\MatE*\MatJ)/(\DETMATRICE)}}%
+ \def\MatInvM{\ConvVersFrac*[#2]{(\MatE*\MatK*\MatN+\MatF*\MatI*\MatO+\MatG*\MatJ*\MatM-\MatE*\MatJ*\MatO-\MatF*\MatK*\MatM-\MatG*\MatI*\MatN)/(\DETMATRICE)}}%
+ \def\MatInvN{\ConvVersFrac*[#2]{(\MatA*\MatJ*\MatO+\MatB*\MatK*\MatM+\MatC*\MatI*\MatN-\MatA*\MatK*\MatN-\MatB*\MatI*\MatO-\MatC*\MatJ*\MatM)/(\DETMATRICE)}}%
+ \def\MatInvO{\ConvVersFrac*[#2]{(\MatA*\MatG*\MatN+\MatB*\MatE*\MatO+\MatC*\MatF*\MatM-\MatA*\MatF*\MatO-\MatB*\MatG*\MatM-\MatC*\MatE*\MatN)/(\DETMATRICE)}}%
+ \def\MatInvP{\ConvVersFrac*[#2]{(\MatA*\MatF*\MatK+\MatB*\MatG*\MatI+\MatC*\MatE*\MatJ-\MatA*\MatG*\MatJ-\MatB*\MatE*\MatK-\MatC*\MatF*\MatI)/(\DETMATRICE)}}%
}%
{%
- \def\MatInvA{\ConvVersFrac[#2]{(\MatF*\MatK*\MatP+\MatG*\MatL*\MatN+\MatH*\MatJ*\MatO-\MatF*\MatL*\MatO-\MatG*\MatJ*\MatP-\MatH*\MatK*\MatN)/\DETMATRICE}}%
- \def\MatInvB{\ConvVersFrac[#2]{(\MatB*\MatL*\MatO+\MatC*\MatJ*\MatP+\MatD*\MatK*\MatN-\MatB*\MatK*\MatP-\MatC*\MatL*\MatN-\MatD*\MatJ*\MatO)/\DETMATRICE}}%
- \def\MatInvC{\ConvVersFrac[#2]{(\MatB*\MatG*\MatP+\MatC*\MatH*\MatN+\MatD*\MatF*\MatO-\MatB*\MatH*\MatO-\MatC*\MatF*\MatP-\MatD*\MatG*\MatN)/\DETMATRICE}}%
- \def\MatInvD{\ConvVersFrac[#2]{(\MatB*\MatH*\MatK+\MatC*\MatF*\MatL+\MatD*\MatG*\MatJ-\MatB*\MatG*\MatL-\MatC*\MatH*\MatJ-\MatD*\MatF*\MatK)/\DETMATRICE}}%
- \def\MatInvE{\ConvVersFrac[#2]{(\MatE*\MatL*\MatO+\MatG*\MatI*\MatP+\MatH*\MatK*\MatM-\MatE*\MatK*\MatP-\MatG*\MatL*\MatM-\MatH*\MatI*\MatO)/\DETMATRICE}}%
- \def\MatInvF{\ConvVersFrac[#2]{(\MatA*\MatK*\MatP+\MatC*\MatL*\MatM+\MatD*\MatI*\MatO-\MatA*\MatL*\MatO-\MatC*\MatI*\MatP-\MatD*\MatK*\MatM)/\DETMATRICE}}%
- \def\MatInvG{\ConvVersFrac[#2]{(\MatA*\MatH*\MatO+\MatC*\MatE*\MatP+\MatD*\MatG*\MatM-\MatA*\MatG*\MatP-\MatC*\MatH*\MatM-\MatD*\MatE*\MatO)/\DETMATRICE}}%
- \def\MatInvH{\ConvVersFrac[#2]{(\MatA*\MatG*\MatL+\MatC*\MatH*\MatI+\MatD*\MatE*\MatK-\MatA*\MatH*\MatK-\MatC*\MatE*\MatL-\MatD*\MatG*\MatI)/\DETMATRICE}}%
- \def\MatInvI{\ConvVersFrac[#2]{(\MatE*\MatJ*\MatP+\MatF*\MatL*\MatM+\MatH*\MatI*\MatN-\MatE*\MatL*\MatN-\MatF*\MatI*\MatP-\MatH*\MatJ*\MatM)/\DETMATRICE}}%
- \def\MatInvJ{\ConvVersFrac[#2]{(\MatA*\MatL*\MatN+\MatB*\MatI*\MatP+\MatD*\MatJ*\MatM-\MatA*\MatJ*\MatP-\MatB*\MatL*\MatM-\MatD*\MatI*\MatN)/\DETMATRICE}}%
- \def\MatInvK{\ConvVersFrac[#2]{(\MatA*\MatF*\MatP+\MatB*\MatH*\MatM+\MatD*\MatE*\MatN-\MatA*\MatH*\MatN-\MatB*\MatE*\MatP-\MatD*\MatF*\MatM)/\DETMATRICE}}%
- \def\MatInvL{\ConvVersFrac[#2]{(\MatA*\MatH*\MatJ+\MatB*\MatE*\MatL+\MatD*\MatF*\MatI-\MatA*\MatF*\MatL-\MatB*\MatH*\MatI-\MatD*\MatE*\MatJ)/\DETMATRICE}}%
- \def\MatInvM{\ConvVersFrac[#2]{(\MatE*\MatK*\MatN+\MatF*\MatI*\MatO+\MatG*\MatJ*\MatM-\MatE*\MatJ*\MatO-\MatF*\MatK*\MatM-\MatG*\MatI*\MatN)/\DETMATRICE}}%
- \def\MatInvN{\ConvVersFrac[#2]{(\MatA*\MatJ*\MatO+\MatB*\MatK*\MatM+\MatC*\MatI*\MatN-\MatA*\MatK*\MatN-\MatB*\MatI*\MatO-\MatC*\MatJ*\MatM)/\DETMATRICE}}%
- \def\MatInvO{\ConvVersFrac[#2]{(\MatA*\MatG*\MatN+\MatB*\MatE*\MatO+\MatC*\MatF*\MatM-\MatA*\MatF*\MatO-\MatB*\MatG*\MatM-\MatC*\MatE*\MatN)/\DETMATRICE}}%
- \def\MatInvP{\ConvVersFrac[#2]{(\MatA*\MatF*\MatK+\MatB*\MatG*\MatI+\MatC*\MatE*\MatJ-\MatA*\MatG*\MatJ-\MatB*\MatE*\MatK-\MatC*\MatF*\MatI)/\DETMATRICE}}%
+ \def\MatInvA{\ConvVersFrac[#2]{(\MatF*\MatK*\MatP+\MatG*\MatL*\MatN+\MatH*\MatJ*\MatO-\MatF*\MatL*\MatO-\MatG*\MatJ*\MatP-\MatH*\MatK*\MatN)/(\DETMATRICE)}}%
+ \def\MatInvB{\ConvVersFrac[#2]{(\MatB*\MatL*\MatO+\MatC*\MatJ*\MatP+\MatD*\MatK*\MatN-\MatB*\MatK*\MatP-\MatC*\MatL*\MatN-\MatD*\MatJ*\MatO)/(\DETMATRICE)}}%
+ \def\MatInvC{\ConvVersFrac[#2]{(\MatB*\MatG*\MatP+\MatC*\MatH*\MatN+\MatD*\MatF*\MatO-\MatB*\MatH*\MatO-\MatC*\MatF*\MatP-\MatD*\MatG*\MatN)/(\DETMATRICE)}}%
+ \def\MatInvD{\ConvVersFrac[#2]{(\MatB*\MatH*\MatK+\MatC*\MatF*\MatL+\MatD*\MatG*\MatJ-\MatB*\MatG*\MatL-\MatC*\MatH*\MatJ-\MatD*\MatF*\MatK)/(\DETMATRICE)}}%
+ \def\MatInvE{\ConvVersFrac[#2]{(\MatE*\MatL*\MatO+\MatG*\MatI*\MatP+\MatH*\MatK*\MatM-\MatE*\MatK*\MatP-\MatG*\MatL*\MatM-\MatH*\MatI*\MatO)/(\DETMATRICE)}}%
+ \def\MatInvF{\ConvVersFrac[#2]{(\MatA*\MatK*\MatP+\MatC*\MatL*\MatM+\MatD*\MatI*\MatO-\MatA*\MatL*\MatO-\MatC*\MatI*\MatP-\MatD*\MatK*\MatM)/(\DETMATRICE)}}%
+ \def\MatInvG{\ConvVersFrac[#2]{(\MatA*\MatH*\MatO+\MatC*\MatE*\MatP+\MatD*\MatG*\MatM-\MatA*\MatG*\MatP-\MatC*\MatH*\MatM-\MatD*\MatE*\MatO)/(\DETMATRICE)}}%
+ \def\MatInvH{\ConvVersFrac[#2]{(\MatA*\MatG*\MatL+\MatC*\MatH*\MatI+\MatD*\MatE*\MatK-\MatA*\MatH*\MatK-\MatC*\MatE*\MatL-\MatD*\MatG*\MatI)/(\DETMATRICE)}}%
+ \def\MatInvI{\ConvVersFrac[#2]{(\MatE*\MatJ*\MatP+\MatF*\MatL*\MatM+\MatH*\MatI*\MatN-\MatE*\MatL*\MatN-\MatF*\MatI*\MatP-\MatH*\MatJ*\MatM)/(\DETMATRICE)}}%
+ \def\MatInvJ{\ConvVersFrac[#2]{(\MatA*\MatL*\MatN+\MatB*\MatI*\MatP+\MatD*\MatJ*\MatM-\MatA*\MatJ*\MatP-\MatB*\MatL*\MatM-\MatD*\MatI*\MatN)/(\DETMATRICE)}}%
+ \def\MatInvK{\ConvVersFrac[#2]{(\MatA*\MatF*\MatP+\MatB*\MatH*\MatM+\MatD*\MatE*\MatN-\MatA*\MatH*\MatN-\MatB*\MatE*\MatP-\MatD*\MatF*\MatM)/(\DETMATRICE)}}%
+ \def\MatInvL{\ConvVersFrac[#2]{(\MatA*\MatH*\MatJ+\MatB*\MatE*\MatL+\MatD*\MatF*\MatI-\MatA*\MatF*\MatL-\MatB*\MatH*\MatI-\MatD*\MatE*\MatJ)/(\DETMATRICE)}}%
+ \def\MatInvM{\ConvVersFrac[#2]{(\MatE*\MatK*\MatN+\MatF*\MatI*\MatO+\MatG*\MatJ*\MatM-\MatE*\MatJ*\MatO-\MatF*\MatK*\MatM-\MatG*\MatI*\MatN)/(\DETMATRICE)}}%
+ \def\MatInvN{\ConvVersFrac[#2]{(\MatA*\MatJ*\MatO+\MatB*\MatK*\MatM+\MatC*\MatI*\MatN-\MatA*\MatK*\MatN-\MatB*\MatI*\MatO-\MatC*\MatJ*\MatM)/(\DETMATRICE)}}%
+ \def\MatInvO{\ConvVersFrac[#2]{(\MatA*\MatG*\MatN+\MatB*\MatE*\MatO+\MatC*\MatF*\MatM-\MatA*\MatF*\MatO-\MatB*\MatG*\MatM-\MatC*\MatE*\MatN)/(\DETMATRICE)}}%
+ \def\MatInvP{\ConvVersFrac[#2]{(\MatA*\MatF*\MatK+\MatB*\MatG*\MatI+\MatC*\MatE*\MatJ-\MatA*\MatG*\MatJ-\MatB*\MatE*\MatK-\MatC*\MatF*\MatI)/(\DETMATRICE)}}%
}%
\IfStrEq{#5}{Aff}%si matrice
{%
@@ -693,26 +694,26 @@ def etat_prob_DD(AA,BB,a,b,c,d,puiss) :
{%
\IfBooleanTF{#1}%
{%
- \def\MatInvA{\ConvVersFrac*[#2]{(\MatE*\MatI-\MatH*\MatF)/\DETMATRICE}}%
- \def\MatInvB{\ConvVersFrac*[#2]{(-\MatB*\MatI+\MatC*\MatH)/\DETMATRICE}}%
- \def\MatInvC{\ConvVersFrac*[#2]{(\MatB*\MatF-\MatC*\MatE)/\DETMATRICE}}%
- \def\MatInvD{\ConvVersFrac*[#2]{(-\MatD*\MatI+\MatF*\MatG)/\DETMATRICE}}%
- \def\MatInvE{\ConvVersFrac*[#2]{(\MatA*\MatI-\MatC*\MatG)/\DETMATRICE}}%
- \def\MatInvF{\ConvVersFrac*[#2]{(-\MatA*\MatF+\MatD*\MatC)/\DETMATRICE}}%
- \def\MatInvG{\ConvVersFrac*[#2]{(\MatD*\MatH-\MatE*\MatG)/\DETMATRICE}}%
- \def\MatInvH{\ConvVersFrac*[#2]{(-\MatA*\MatH+\MatB*\MatG)/\DETMATRICE}}%
- \def\MatInvI{\ConvVersFrac*[#2]{(\MatA*\MatE-\MatB*\MatD)/\DETMATRICE}}%
+ \def\MatInvA{\ConvVersFrac*[#2]{(\MatE*\MatI-\MatH*\MatF)/(\DETMATRICE)}}%
+ \def\MatInvB{\ConvVersFrac*[#2]{(-\MatB*\MatI+\MatC*\MatH)/(\DETMATRICE)}}%
+ \def\MatInvC{\ConvVersFrac*[#2]{(\MatB*\MatF-\MatC*\MatE)/(\DETMATRICE)}}%
+ \def\MatInvD{\ConvVersFrac*[#2]{(-\MatD*\MatI+\MatF*\MatG)/(\DETMATRICE)}}%
+ \def\MatInvE{\ConvVersFrac*[#2]{(\MatA*\MatI-\MatC*\MatG)/(\DETMATRICE)}}%
+ \def\MatInvF{\ConvVersFrac*[#2]{(-\MatA*\MatF+\MatD*\MatC)/(\DETMATRICE)}}%
+ \def\MatInvG{\ConvVersFrac*[#2]{(\MatD*\MatH-\MatE*\MatG)/(\DETMATRICE)}}%
+ \def\MatInvH{\ConvVersFrac*[#2]{(-\MatA*\MatH+\MatB*\MatG)/(\DETMATRICE)}}%
+ \def\MatInvI{\ConvVersFrac*[#2]{(\MatA*\MatE-\MatB*\MatD)/(\DETMATRICE)}}%
}%
{%
- \def\MatInvA{\ConvVersFrac[#2]{(\MatE*\MatI-\MatH*\MatF)/\DETMATRICE}}%
- \def\MatInvB{\ConvVersFrac[#2]{(-\MatB*\MatI+\MatC*\MatH)/\DETMATRICE}}%
- \def\MatInvC{\ConvVersFrac[#2]{(\MatB*\MatF-\MatC*\MatE)/\DETMATRICE}}%
- \def\MatInvD{\ConvVersFrac[#2]{(-\MatD*\MatI+\MatF*\MatG)/\DETMATRICE}}%
- \def\MatInvE{\ConvVersFrac[#2]{(\MatA*\MatI-\MatC*\MatG)/\DETMATRICE}}%
- \def\MatInvF{\ConvVersFrac[#2]{(-\MatA*\MatF+\MatD*\MatC)/\DETMATRICE}}%
- \def\MatInvG{\ConvVersFrac[#2]{(\MatD*\MatH-\MatE*\MatG)/\DETMATRICE}}%
- \def\MatInvH{\ConvVersFrac[#2]{(-\MatA*\MatH+\MatB*\MatG)/\DETMATRICE}}%
- \def\MatInvI{\ConvVersFrac[#2]{(\MatA*\MatE-\MatB*\MatD)/\DETMATRICE}}%
+ \def\MatInvA{\ConvVersFrac[#2]{(\MatE*\MatI-\MatH*\MatF)/(\DETMATRICE)}}%
+ \def\MatInvB{\ConvVersFrac[#2]{(-\MatB*\MatI+\MatC*\MatH)/(\DETMATRICE)}}%
+ \def\MatInvC{\ConvVersFrac[#2]{(\MatB*\MatF-\MatC*\MatE)/(\DETMATRICE)}}%
+ \def\MatInvD{\ConvVersFrac[#2]{(-\MatD*\MatI+\MatF*\MatG)/(\DETMATRICE)}}%
+ \def\MatInvE{\ConvVersFrac[#2]{(\MatA*\MatI-\MatC*\MatG)/(\DETMATRICE)}}%
+ \def\MatInvF{\ConvVersFrac[#2]{(-\MatA*\MatF+\MatD*\MatC)/(\DETMATRICE)}}%
+ \def\MatInvG{\ConvVersFrac[#2]{(\MatD*\MatH-\MatE*\MatG)/(\DETMATRICE)}}%
+ \def\MatInvH{\ConvVersFrac[#2]{(-\MatA*\MatH+\MatB*\MatG)/(\DETMATRICE)}}%
+ \def\MatInvI{\ConvVersFrac[#2]{(\MatA*\MatE-\MatB*\MatD)/(\DETMATRICE)}}%
}%
\IfStrEq{#5}{Aff}%si matrice
{%
@@ -752,16 +753,16 @@ def etat_prob_DD(AA,BB,a,b,c,d,puiss) :
{%
\IfBooleanTF{#1}%
{%
- \def\MatInvA{\ConvVersFrac*[#2]{(\MatD)/\DETMATRICE}}%
- \def\MatInvB{\ConvVersFrac*[#2]{(-\MatB)/\DETMATRICE}}%
- \def\MatInvC{\ConvVersFrac*[#2]{(-\MatC)/\DETMATRICE}}%
- \def\MatInvD{\ConvVersFrac*[#2]{(\MatA)/\DETMATRICE}}%
+ \def\MatInvA{\ConvVersFrac*[#2]{(\MatD)/(\DETMATRICE)}}%
+ \def\MatInvB{\ConvVersFrac*[#2]{(-\MatB)/(\DETMATRICE)}}%
+ \def\MatInvC{\ConvVersFrac*[#2]{(-\MatC)/(\DETMATRICE)}}%
+ \def\MatInvD{\ConvVersFrac*[#2]{(\MatA)/(\DETMATRICE)}}%
}%
{%
- \def\MatInvA{\ConvVersFrac[#2]{(\MatD)/\DETMATRICE}}%
- \def\MatInvB{\ConvVersFrac[#2]{(-\MatB)/\DETMATRICE}}%
- \def\MatInvC{\ConvVersFrac[#2]{(-\MatC)/\DETMATRICE}}%
- \def\MatInvD{\ConvVersFrac[#2]{(\MatA)/\DETMATRICE}}%
+ \def\MatInvA{\ConvVersFrac[#2]{(\MatD)/(\DETMATRICE)}}%
+ \def\MatInvB{\ConvVersFrac[#2]{(-\MatB)/(\DETMATRICE)}}%
+ \def\MatInvC{\ConvVersFrac[#2]{(-\MatC)/(\DETMATRICE)}}%
+ \def\MatInvD{\ConvVersFrac[#2]{(\MatA)/(\DETMATRICE)}}%
}%
\IfStrEq{#5}{Aff}%si matrice
{%
@@ -889,22 +890,22 @@ def etat_prob_DD(AA,BB,a,b,c,d,puiss) :
\xintifboolexpr{\DETMATRICE == 0}%
{\text{Matrice non inversible}}%
{%
- \def\MatInvA{(\MatF*\MatK*\MatP+\MatG*\MatL*\MatN+\MatH*\MatJ*\MatO-\MatF*\MatL*\MatO-\MatG*\MatJ*\MatP-\MatH*\MatK*\MatN)/\DETMATRICE}%
- \def\MatInvB{(\MatB*\MatL*\MatO+\MatC*\MatJ*\MatP+\MatD*\MatK*\MatN-\MatB*\MatK*\MatP-\MatC*\MatL*\MatN-\MatD*\MatJ*\MatO)/\DETMATRICE}%
- \def\MatInvC{(\MatB*\MatG*\MatP+\MatC*\MatH*\MatN+\MatD*\MatF*\MatO-\MatB*\MatH*\MatO-\MatC*\MatF*\MatP-\MatD*\MatG*\MatN)/\DETMATRICE}%
- \def\MatInvD{(\MatB*\MatH*\MatK+\MatC*\MatF*\MatL+\MatD*\MatG*\MatJ-\MatB*\MatG*\MatL-\MatC*\MatH*\MatJ-\MatD*\MatF*\MatK)/\DETMATRICE}%
- \def\MatInvE{(\MatE*\MatL*\MatO+\MatG*\MatI*\MatP+\MatH*\MatK*\MatM-\MatE*\MatK*\MatP-\MatG*\MatL*\MatM-\MatH*\MatI*\MatO)/\DETMATRICE}%
- \def\MatInvF{(\MatA*\MatK*\MatP+\MatC*\MatL*\MatM+\MatD*\MatI*\MatO-\MatA*\MatL*\MatO-\MatC*\MatI*\MatP-\MatD*\MatK*\MatM)/\DETMATRICE}%
- \def\MatInvG{(\MatA*\MatH*\MatO+\MatC*\MatE*\MatP+\MatD*\MatG*\MatM-\MatA*\MatG*\MatP-\MatC*\MatH*\MatM-\MatD*\MatE*\MatO)/\DETMATRICE}%
- \def\MatInvH{(\MatA*\MatG*\MatL+\MatC*\MatH*\MatI+\MatD*\MatE*\MatK-\MatA*\MatH*\MatK-\MatC*\MatE*\MatL-\MatD*\MatG*\MatI)/\DETMATRICE}%
- \def\MatInvI{(\MatE*\MatJ*\MatP+\MatF*\MatL*\MatM+\MatH*\MatI*\MatN-\MatE*\MatL*\MatN-\MatF*\MatI*\MatP-\MatH*\MatJ*\MatM)/\DETMATRICE}%
- \def\MatInvJ{(\MatA*\MatL*\MatN+\MatB*\MatI*\MatP+\MatD*\MatJ*\MatM-\MatA*\MatJ*\MatP-\MatB*\MatL*\MatM-\MatD*\MatI*\MatN)/\DETMATRICE}%
- \def\MatInvK{(\MatA*\MatF*\MatP+\MatB*\MatH*\MatM+\MatD*\MatE*\MatN-\MatA*\MatH*\MatN-\MatB*\MatE*\MatP-\MatD*\MatF*\MatM)/\DETMATRICE}%
- \def\MatInvL{(\MatA*\MatH*\MatJ+\MatB*\MatE*\MatL+\MatD*\MatF*\MatI-\MatA*\MatF*\MatL-\MatB*\MatH*\MatI-\MatD*\MatE*\MatJ)/\DETMATRICE}%
- \def\MatInvM{(\MatE*\MatK*\MatN+\MatF*\MatI*\MatO+\MatG*\MatJ*\MatM-\MatE*\MatJ*\MatO-\MatF*\MatK*\MatM-\MatG*\MatI*\MatN)/\DETMATRICE}%
- \def\MatInvN{(\MatA*\MatJ*\MatO+\MatB*\MatK*\MatM+\MatC*\MatI*\MatN-\MatA*\MatK*\MatN-\MatB*\MatI*\MatO-\MatC*\MatJ*\MatM)/\DETMATRICE}%
- \def\MatInvO{(\MatA*\MatG*\MatN+\MatB*\MatE*\MatO+\MatC*\MatF*\MatM-\MatA*\MatF*\MatO-\MatB*\MatG*\MatM-\MatC*\MatE*\MatN)/\DETMATRICE}%
- \def\MatInvP{(\MatA*\MatF*\MatK+\MatB*\MatG*\MatI+\MatC*\MatE*\MatJ-\MatA*\MatG*\MatJ-\MatB*\MatE*\MatK-\MatC*\MatF*\MatI)/\DETMATRICE}%
+ \def\MatInvA{(\MatF*\MatK*\MatP+\MatG*\MatL*\MatN+\MatH*\MatJ*\MatO-\MatF*\MatL*\MatO-\MatG*\MatJ*\MatP-\MatH*\MatK*\MatN)/(\DETMATRICE)}%
+ \def\MatInvB{(\MatB*\MatL*\MatO+\MatC*\MatJ*\MatP+\MatD*\MatK*\MatN-\MatB*\MatK*\MatP-\MatC*\MatL*\MatN-\MatD*\MatJ*\MatO)/(\DETMATRICE)}%
+ \def\MatInvC{(\MatB*\MatG*\MatP+\MatC*\MatH*\MatN+\MatD*\MatF*\MatO-\MatB*\MatH*\MatO-\MatC*\MatF*\MatP-\MatD*\MatG*\MatN)/(\DETMATRICE)}%
+ \def\MatInvD{(\MatB*\MatH*\MatK+\MatC*\MatF*\MatL+\MatD*\MatG*\MatJ-\MatB*\MatG*\MatL-\MatC*\MatH*\MatJ-\MatD*\MatF*\MatK)/(\DETMATRICE)}%
+ \def\MatInvE{(\MatE*\MatL*\MatO+\MatG*\MatI*\MatP+\MatH*\MatK*\MatM-\MatE*\MatK*\MatP-\MatG*\MatL*\MatM-\MatH*\MatI*\MatO)/(\DETMATRICE)}%
+ \def\MatInvF{(\MatA*\MatK*\MatP+\MatC*\MatL*\MatM+\MatD*\MatI*\MatO-\MatA*\MatL*\MatO-\MatC*\MatI*\MatP-\MatD*\MatK*\MatM)/(\DETMATRICE)}%
+ \def\MatInvG{(\MatA*\MatH*\MatO+\MatC*\MatE*\MatP+\MatD*\MatG*\MatM-\MatA*\MatG*\MatP-\MatC*\MatH*\MatM-\MatD*\MatE*\MatO)/(\DETMATRICE)}%
+ \def\MatInvH{(\MatA*\MatG*\MatL+\MatC*\MatH*\MatI+\MatD*\MatE*\MatK-\MatA*\MatH*\MatK-\MatC*\MatE*\MatL-\MatD*\MatG*\MatI)/(\DETMATRICE)}%
+ \def\MatInvI{(\MatE*\MatJ*\MatP+\MatF*\MatL*\MatM+\MatH*\MatI*\MatN-\MatE*\MatL*\MatN-\MatF*\MatI*\MatP-\MatH*\MatJ*\MatM)/(\DETMATRICE)}%
+ \def\MatInvJ{(\MatA*\MatL*\MatN+\MatB*\MatI*\MatP+\MatD*\MatJ*\MatM-\MatA*\MatJ*\MatP-\MatB*\MatL*\MatM-\MatD*\MatI*\MatN)/(\DETMATRICE)}%
+ \def\MatInvK{(\MatA*\MatF*\MatP+\MatB*\MatH*\MatM+\MatD*\MatE*\MatN-\MatA*\MatH*\MatN-\MatB*\MatE*\MatP-\MatD*\MatF*\MatM)/(\DETMATRICE)}%
+ \def\MatInvL{(\MatA*\MatH*\MatJ+\MatB*\MatE*\MatL+\MatD*\MatF*\MatI-\MatA*\MatF*\MatL-\MatB*\MatH*\MatI-\MatD*\MatE*\MatJ)/(\DETMATRICE)}%
+ \def\MatInvM{(\MatE*\MatK*\MatN+\MatF*\MatI*\MatO+\MatG*\MatJ*\MatM-\MatE*\MatJ*\MatO-\MatF*\MatK*\MatM-\MatG*\MatI*\MatN)/(\DETMATRICE)}%
+ \def\MatInvN{(\MatA*\MatJ*\MatO+\MatB*\MatK*\MatM+\MatC*\MatI*\MatN-\MatA*\MatK*\MatN-\MatB*\MatI*\MatO-\MatC*\MatJ*\MatM)/(\DETMATRICE)}%
+ \def\MatInvO{(\MatA*\MatG*\MatN+\MatB*\MatE*\MatO+\MatC*\MatF*\MatM-\MatA*\MatF*\MatO-\MatB*\MatG*\MatM-\MatC*\MatE*\MatN)/(\DETMATRICE)}%
+ \def\MatInvP{(\MatA*\MatF*\MatK+\MatB*\MatG*\MatI+\MatC*\MatE*\MatJ-\MatA*\MatG*\MatJ-\MatB*\MatE*\MatK-\MatC*\MatF*\MatI)/(\DETMATRICE)}%
%
\IfBooleanTF{#1}%version étoilée := moinsdevant
{%
@@ -944,7 +945,7 @@ def etat_prob_DD(AA,BB,a,b,c,d,puiss) :
\itemtomacro\MAMATRICEA[3,2]\MatH
\itemtomacro\MAMATRICEA[3,3]\MatI
%le déterminant
- \def\DETMATRICE{\xinteval{\MatA*\MatE*\MatI+\MatD*\MatH*\MatC+\MatB*\MatF*\MatG-\MatG*\MatE*\MatC-\MatD*\MatB*\MatI-\MatA*\MatH*\MatF}}%
+ \def\DETMATRICE{\xinteval{(\MatA)*(\MatE)*(\MatI)+(\MatD)*(\MatH)*(\MatC)+(\MatB)*(\MatF)*(\MatG)-(\MatG)*(\MatE)*(\MatC)-(\MatD)*(\MatB)*(\MatI)-(\MatA)*(\MatH)*(\MatF)}}%
%les coeffs de B
\itemtomacro\MAMATRICEB[1]\MatBA
\itemtomacro\MAMATRICEB[2]\MatBB
@@ -953,15 +954,15 @@ def etat_prob_DD(AA,BB,a,b,c,d,puiss) :
\xintifboolexpr{\DETMATRICE == 0}%
{\text{Matrice non inversible}}%
{%
- \def\MatInvA{(\MatE*\MatI-\MatH*\MatF)/\DETMATRICE}%
- \def\MatInvB{(-\MatB*\MatI+\MatC*\MatH)/\DETMATRICE}%
- \def\MatInvC{(\MatB*\MatF-\MatC*\MatE)/\DETMATRICE}%
- \def\MatInvD{(-\MatD*\MatI+\MatF*\MatG)/\DETMATRICE}%
- \def\MatInvE{(\MatA*\MatI-\MatC*\MatG)/\DETMATRICE}%
- \def\MatInvF{(-\MatA*\MatF+\MatD*\MatC)/\DETMATRICE}%
- \def\MatInvG{(\MatD*\MatH-\MatE*\MatG)/\DETMATRICE}%
- \def\MatInvH{(-\MatA*\MatH+\MatB*\MatG)/\DETMATRICE}%
- \def\MatInvI{(\MatA*\MatE-\MatB*\MatD)/\DETMATRICE}%
+ \def\MatInvA{(\MatE*\MatI-\MatH*\MatF)/(\DETMATRICE)}%
+ \def\MatInvB{(-\MatB*\MatI+\MatC*\MatH)/(\DETMATRICE)}%
+ \def\MatInvC{(\MatB*\MatF-\MatC*\MatE)/(\DETMATRICE)}%
+ \def\MatInvD{(-\MatD*\MatI+\MatF*\MatG)/(\DETMATRICE)}%
+ \def\MatInvE{(\MatA*\MatI-\MatC*\MatG)/(\DETMATRICE)}%
+ \def\MatInvF{(-\MatA*\MatF+\MatD*\MatC)/(\DETMATRICE)}%
+ \def\MatInvG{(\MatD*\MatH-\MatE*\MatG)/(\DETMATRICE)}%
+ \def\MatInvH{(-\MatA*\MatH+\MatB*\MatG)/(\DETMATRICE)}%
+ \def\MatInvI{(\MatA*\MatE-\MatB*\MatD)/(\DETMATRICE)}%
%
\IfBooleanTF{#1}%version étoilée := moinsdevant
{%
@@ -993,7 +994,7 @@ def etat_prob_DD(AA,BB,a,b,c,d,puiss) :
\itemtomacro\MAMATRICEA[2,1]\MatC
\itemtomacro\MAMATRICEA[2,2]\MatD
%le déterminant
- \def\DETMATRICE{\xinteval{\MatA*\MatD-\MatB*\MatC}}%
+ \def\DETMATRICE{\xinteval{(\MatA)*(\MatD)-(\MatB)*(\MatC)}}%
%les coeffs de B
\itemtomacro\MAMATRICEB[1]\MatBA
\itemtomacro\MAMATRICEB[2]\MatBB
@@ -1001,19 +1002,19 @@ def etat_prob_DD(AA,BB,a,b,c,d,puiss) :
\xintifboolexpr{\DETMATRICE == 0}%
{\text{Matrice non inversible}}%
{%
- \def\MatInvA{(\MatD)/\DETMATRICE}%
- \def\MatInvB{(-\MatB)/\DETMATRICE}%
- \def\MatInvC{(-\MatC)/\DETMATRICE}%
- \def\MatInvD{(\MatA)/\DETMATRICE}%
+ \def\MatInvA{(\MatD)/(\DETMATRICE)}%
+ \def\MatInvB{(-\MatB)/(\DETMATRICE)}%
+ \def\MatInvC{(-\MatC)/(\DETMATRICE)}%
+ \def\MatInvD{(\MatA)/(\DETMATRICE)}%
%
\IfBooleanTF{#1}%
{%
- \def\MatResA{\ConvVersFrac*[#2]{\MatInvA*\MatBA+\MatInvB*\MatBB}}%
- \def\MatResB{\ConvVersFrac*[#2]{\MatInvC*\MatBA+\MatInvD*\MatBB}}%
+ \def\MatResA{\ConvVersFrac*[#2]{(\MatInvA)*(\MatBA)+(\MatInvB)*(\MatBB)}}%
+ \def\MatResB{\ConvVersFrac*[#2]{(\MatInvC)*(\MatBA)+(\MatInvD)*(\MatBB)}}%
}%
{%
- \def\MatResA{\ConvVersFrac[#2]{\MatInvA*\MatBA+\MatInvB*\MatBB}}%
- \def\MatResB{\ConvVersFrac[#2]{\MatInvC*\MatBA+\MatInvD*\MatBB}}%
+ \def\MatResA{\ConvVersFrac[#2]{(\MatInvA)*(\MatBA)+(\MatInvB)*(\MatBB)}}%
+ \def\MatResB{\ConvVersFrac[#2]{(\MatInvC)*(\MatBA)+(\MatInvD)*(\MatBB)}}%
}%
\IfStrEq{#6}{Matrice}%si matrice
{%
@@ -1442,7 +1443,7 @@ def etat_prob_DD(AA,BB,a,b,c,d,puiss) :
}%
}{}%
\begin{pNiceMatrix}[#3]
- \MatResA & \MatResB & \MatResC \\ \MatResD & \MatResE & \MatResF \\ \MatResG & \MatResH & \MatResI
+ \MatResA & \MatResB & \MatResC \\ \MatResD & \MatResE & \MatResF \\ \MatResG & \MatResH & \MatResI
\end{pNiceMatrix}%
}{}%fin 3,3*3,3
\xintifboolexpr{\NbLigMatA==1 'and' \NbColMatA==4 'and' \NbLigMatB==4 'and' \NbColMatB==1}% (1,4)*(4,1)
diff --git a/macros/latex/contrib/tiet-question-paper/LICENSE b/macros/latex/contrib/tiet-question-paper/LICENSE
new file mode 100644
index 0000000000..df351f4f49
--- /dev/null
+++ b/macros/latex/contrib/tiet-question-paper/LICENSE
@@ -0,0 +1,26 @@
+The MIT License (MIT)
+Copyright (c) 2024 B.V. Raghav
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the ``Software''), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the
+following conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/macros/latex/contrib/tiet-question-paper/README.md b/macros/latex/contrib/tiet-question-paper/README.md
new file mode 100644
index 0000000000..e03586d4fe
--- /dev/null
+++ b/macros/latex/contrib/tiet-question-paper/README.md
@@ -0,0 +1,151 @@
+# `tiet-question-paper.cls` #
+
+[Installation](#installation) |
+[Usage](#usage) |
+[Emacs Org Integration](#emacs-org-integration)
+
+Author: Raghav B. Venkataramaiyer
+Email: bv.raghav -at- thapar -dot- edu
+Email: bvraghav -at- gmail -dot- com
+License: [MIT License](./LICENSE)
+Version: 2024-06-22
+
+Provide a document class `tiet-question-paper` in order
+to create a question paper for [the Thapar
+Institute](https://thapar.edu/) in $\LaTeX$. Although
+created for the TIET, the module, however, is adaptable
+to any organisation.
+
+The following example is a screenshot from
+[`sample.pdf`](./sample.pdf), with the source at
+[`sample.tex`](./sample.tex)
+
+![](./images/sample.png)
+
+## Installation ##
+
+### CTAN ###
+
+TBA
+
+### From Source ###
+
+1. `tlmgr init-usertree`
+2. `kpsewhich -var-value=TEXMFHOME` should return
+ `~/texmf`
+3. `mkdir -p ~/texmf/tex/latex`
+4. `cd ~/texmf/tex/latex`
+5. `git clone
+ git@github.com:bvraghav/qptiet_latex-class tiet-question-paper`
+6. Verify that `kpsewhich tiet-question-paper.cls` finds `tiet-question-paper.cls`.
+
+## Usage ##
+
+### Document Class ###
+
+The document class is based on `article`. And all the
+options are passed forward as is.
+
+```latex
+\documentclass[11pt,onecolumn]{tiet-question-paper}
+```
+
+### Title Block ###
+
+Only the following macros contribute to the title block.
+
+```latex
+\date{28 May 2024}
+% \institute{Thapar Institute of Engineering \&
+% Technology} % Default value
+% \abbrevinst{\textsc{tiet}} % Reserved for future
+% \instaddress{Patiala 147004} % Reserved for future
+% \cohort{} % Reserved for future
+% \instlogo{images/tiet-logo.pdf} % Optional
+\schoolordepartment{Computer Science \& Engineering Department}
+\examname{End Semester Examination}
+\coursecode{UCS505}
+\coursename{Computer Graphics}
+\timeduration{3 hours}
+\maxmarks{45}
+\faculty{ANG,AMK,HPS,YDS,RGB}
+```
+
+### Geometry ###
+
+The class loads `geometry` package with following
+default options,
+
+```latex
+\RequirePackage[%
+ a4paper,%
+ left=1in,%
+ top=0.5in,%
+ right=0.75in,%
+ bottom=0.75in%
+]{geometry}
+```
+
+However, a user may reconfigure using `\geometry`
+command in [the
+preamble](https://duckduckgo.com/?q=what+is+a+preamble+in+latex+document)
+for example,
+
+```latex
+\geometry{letterpaper,bindingoffset=0.2in,
+ left=1.2in,right=1.2in,top=.8in,bottom=.8in,
+ footskip=.25in}
+```
+
+### Rules ###
+
+```latex
+\bvrhrule
+\bvrhrule[2pt]
+```
+Create a horizontal rule with length equal to line
+width and thickness `0.4pt` by default. Optional
+argument specifies line thickness. Here’s the
+implementation detail,
+
+```latex
+\DeclareRobustCommand%
+% Horizontal rule after each question
+\bvrhrule[1][0.4pt]{\rule{\linewidth}{#1}}
+```
+
+### Line Skip ###
+
+```latex
+\bvrskipline
+\bvrskipline[1.2]
+```
+
+Create vertical blank space with height specified as a
+factor of `\baselineskip`. Optional argument specifies
+the factor, `1.0` by default. Here’s the
+implementation detail,
+
+```latex
+\DeclareRobustCommand%
+% Skip line
+\bvrskipline[1][]{\vspace{#1\baselineskip}}
+```
+
+## Emacs Org Integration ##
+Add the following to [the
+init-file](https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html)
+```elisp
+(add-to-list 'org-latex-classes
+ `("tiet-question-paper" "\\documentclass{tiet-question-paper}
+[NO-DEFAULT-PACKAGES]
+\\usepackage{amsmath}
+\\usepackage{graphicx}
+\\usepackage{wrapfig}
+\\usepackage{amssymb}
+\\usepackage[unicode]{hyperref}
+" nil))
+```
+
+Here’s a [`sample-org`](./sample-org.org) file; that
+produces a [`PDF`](./sample-org.pdf)
diff --git a/macros/latex/contrib/tiet-question-paper/images/sample.png b/macros/latex/contrib/tiet-question-paper/images/sample.png
new file mode 100644
index 0000000000..332ad33af1
--- /dev/null
+++ b/macros/latex/contrib/tiet-question-paper/images/sample.png
Binary files differ
diff --git a/macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample-org.org b/macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample-org.org
new file mode 100644
index 0000000000..50b55b4275
--- /dev/null
+++ b/macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample-org.org
@@ -0,0 +1,182 @@
+#+date: \today
+
+#+latex_class: tiet-question-paper
+#+latex_class_options: [11pt]
+#+options: num:nil toc:nil author:nil email:nil
+
+#+latex_header_extra: \hypersetup{%
+#+latex_header_extra: colorlinks,%
+#+latex_header_extra: breaklinks,%
+#+latex_header_extra: urlcolor=[rgb]{0,0.35,0.65},%
+#+latex_header_extra: linkcolor=[rgb]{0,0.35,0.65}%
+#+latex_header_extra: }
+
+#+latex_header_extra: \usepackage{libertinus}
+
+#+latex_header_extra: \instlogo{images/tiet-logo.pdf}
+#+latex_header_extra: \schoolordepartment{%
+#+latex_header_extra: Computer Science \& Engineering Department}
+#+latex_header_extra: \examname{End Semester Examination}
+#+latex_header_extra: \coursecode{UCS505}
+#+latex_header_extra: \coursename{Computer Graphics}
+#+latex_header_extra: \timeduration{3 hours}
+#+latex_header_extra: \maxmarks{45}
+#+latex_header_extra: \faculty{ANG,AMK,HPS,YDS,RGB}
+
+#+latex: \maketitle
+
+*Instructions:*
+1. Attempt any 5 questions;
+2. Attempt all the subparts of a question at one place.
+
+#+latex: \bvrhrule\bvrskipline
+
+1.
+ 1. Given the control polygon $\textbf{b}_0,
+ \textbf{b}_1, \textbf{b}_2, \textbf{b}_3$ of a
+ Cubic Bezier curve; determine the vertex
+ coordinates for parameter values $\forall t\in
+ T$. \hfill [7 marks]
+ \begin{align*}
+ T \equiv
+ & \{0, 0.15, 0.35, 0.5, 0.65, 0.85, 1\} \\
+ \begin{bmatrix}
+ \textbf{b}_0 &\textbf{b}_1& \textbf{b}_2& \textbf{b}_3
+ \end{bmatrix} \equiv& \begin{bmatrix}
+ 1&2&4&3\\ 1&3&3&1
+ \end{bmatrix}
+ \end{align*}
+
+ 2. Explain the role of convex hull in curves.
+ \hfill[2 marks]
+
+#+latex: \bvrhrule
+
+#+ATTR_LATEX: :options [resume]
+1.
+ 1. Describe the continuity conditions for
+ curvilinear geometry. \hfill[5 marks]
+ 2. Define formally, a B-Spline curve. \hfill [2
+ marks]
+ 3. How is a Bezier curve different from a B-Spline
+ curve? \hfill [2 marks]
+
+#+latex: \bvrhrule
+
+#+ATTR_LATEX: :options [resume]
+1.
+ 1. Given a triangle, with vertices defined by column
+ vectors of $P$; find its vertices after
+ reflection across XZ plane. \hfill [3 marks]
+ \begin{align*}
+ P\equiv
+ &\begin{bmatrix}
+ 3&6&5 \\ 4&4&6 \\ 1&2&3
+ \end{bmatrix}
+ \end{align*}
+ 2. Given a pyramid with vertices defined by the
+ column vectors of $P$, and an axis of rotation
+ $A$ with direction $\textbf{v}$ and passing
+ through $\textbf{p}$. Find the coordinates of
+ the vertices after rotation about $A$ by an angle
+ of $\theta=\pi/4$.\hfill [6 marks]
+ \begin{align*}
+ P\equiv
+ &\begin{bmatrix}
+ 0&1&0&0 \\ 0&0&1&0 \\0&0&0&1
+ \end{bmatrix} \\
+ \begin{bmatrix}
+ \mathbf{v} & \mathbf{p}
+ \end{bmatrix}\equiv
+ &\begin{bmatrix}
+ 0&0 \\1&1\\1&0
+ \end{bmatrix}
+ \end{align*}
+#+latex: \bvrhrule
+
+#+ATTR_LATEX: :options [resume]
+1.
+ 1. Explain the two winding number rules for inside
+ outside tests. \hfill [4 marks]
+ 2. Explain the working principle of a CRT. \hfill [5
+ marks]
+
+#+latex: \bvrhrule
+
+#+ATTR_LATEX: :options [resume]
+1.
+ 1. Given a projection plane $P$ defined by normal
+ $\textbf{n}$ and a reference point $\textbf{a}$;
+ and the centre of projection as $\mathbf{p}_0$;
+ find the perspective projection of the point
+ $\textbf{x}$ on $P$. \hfill [5 marks]
+ \begin{align*}
+ \begin{bmatrix}
+ \mathbf{a}&\mathbf{n}&\mathbf{p}_0&\mathbf{x}
+ \end{bmatrix}\equiv
+ &
+ \begin{bmatrix}
+ 3&-1&1&8\\4&2&1&10\\5&-1&3&6
+ \end{bmatrix}
+ \end{align*}
+ 2. Given a geometry $G$, which is a standard unit
+ cube scaled uniformly by half and viewed through
+ a Cavelier projection bearing $\theta=\pi/4$
+ wrt. $X$ axis. \hfill [2 marks]
+ 3. Given a view coordinate system (VCS) with origin
+ at $\textbf{p}_v$ and euler angles ZYX as
+ $\boldsymbol{\theta}$ wrt. the world coordinate
+ system (WCS); find the location $\mathbf{x}_v$ in
+ VCS, corresponding to $\textbf{x}_w$ in
+ WCS. \hfill [2 marks]
+ \begin{align*}
+ \begin{bmatrix}
+ \mathbf{p}_v & \boldsymbol{\theta} & \mathbf{x}_w
+ \end{bmatrix}\equiv
+ &\begin{bmatrix}
+ 5&\pi/3&10\\5&0&10\\0&0&0
+ \end{bmatrix}
+ \end{align*}
+
+#+latex: \bvrhrule
+
+#+ATTR_LATEX: :options [resume]
+1.
+ 1. Describe the visible surface detection problem in
+ about 25 words. \hfill [1 mark]
+ 2. To render a scene with $N$ polygons into a
+ display with height $H$; what are the space and
+ time complexities respectively of a typical
+ image-space method. \hfill [2 marks]
+ 3. Given a 3D space bounded within $[0\quad0\quad0]$
+ and $[7\quad7\quad-7]$, containing two infinite
+ planes each defined by 3 incident points
+ $\mathbf{a}_0, \mathbf{a}_1, \mathbf{a}_2$ and
+ $\mathbf{b}_0, \mathbf{b}_1, \mathbf{b}_2$
+ respectively bearing colours (RGB) as
+ $\mathbf{c}_a$ and $\textbf{c}_b$ respectively.
+ \begin{align*}
+ \begin{bmatrix}
+ \mathbf{a}_0&\mathbf{a}_1&\mathbf{a}_2
+ &\mathbf{b}_0&\mathbf{b}_1&\mathbf{b}_2
+ &\mathbf{c}_a&\mathbf{c}_b
+ \end{bmatrix}\equiv
+ &\begin{bmatrix}
+ 1&6&1&6&1&6&1&0 \\
+ 1&3&6&6&3&1&0&0 \\
+ -1&-6&-1&-1&-6&-1&0&1
+ \end{bmatrix}
+ \end{align*}
+ Compute and/ or determine using the depth-buffer
+ method, the colour at pixel $\mathbf{x}=(2,4)$ on
+ a display resolved into $7\times7$ pixels. The
+ projection plane is at $Z=0$, looking at
+ $-Z$. \hfill [6 marks]
+
+#+latex: \bvrhrule
+
+
+# Local Variables:
+# org-latex-default-packages-alist: nil
+# org-latex-packages-alist: nil
+# End:
diff --git a/macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample-org.pdf b/macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample-org.pdf
new file mode 100644
index 0000000000..bd60bf62e6
--- /dev/null
+++ b/macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample-org.pdf
Binary files differ
diff --git a/macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample-org.tex b/macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample-org.tex
new file mode 100644
index 0000000000..54c7290a67
--- /dev/null
+++ b/macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample-org.tex
@@ -0,0 +1,204 @@
+% Created 2024-06-22 Sat 22:57
+% Intended LaTeX compiler: pdflatex
+\documentclass[11pt]{tiet-question-paper}
+\usepackage{amsmath}
+\usepackage{graphicx}
+\usepackage{wrapfig}
+\usepackage{amssymb}
+\usepackage[unicode]{hyperref}
+
+
+\hypersetup{%
+colorlinks,%
+breaklinks,%
+urlcolor=[rgb]{0,0.35,0.65},%
+linkcolor=[rgb]{0,0.35,0.65}%
+}
+\usepackage{libertinus}
+\instlogo{images/tiet-logo.pdf}
+\schoolordepartment{%
+Computer Science \& Engineering Department}
+\examname{End Semester Examination}
+\coursecode{UCS505}
+\coursename{Computer Graphics}
+\timeduration{3 hours}
+\maxmarks{45}
+\faculty{ANG,AMK,HPS,YDS,RGB}
+\date{\today}
+\title{}
+\hypersetup{
+ pdfauthor={B.V. Raghav},
+ pdftitle={},
+ pdfkeywords={},
+ pdfsubject={},
+ pdfcreator={Emacs 29.3 (Org mode 9.6.15)},
+ pdflang={English}}
+\begin{document}
+
+\maketitle
+
+\textbf{Instructions:}
+\begin{enumerate}
+\item Attempt any 5 questions;
+\item Attempt all the subparts of a question at one place.
+\end{enumerate}
+
+\bvrhrule\bvrskipline
+
+\begin{enumerate}
+\item \begin{enumerate}
+\item Given the control polygon \(\textbf{b}_0,
+ \textbf{b}_1, \textbf{b}_2, \textbf{b}_3\) of a
+Cubic Bezier curve; determine the vertex
+coordinates for parameter values \(\forall t\in
+ T\). \hfill [7 marks]
+\begin{align*}
+ T \equiv
+ & \{0, 0.15, 0.35, 0.5, 0.65, 0.85, 1\} \\
+ \begin{bmatrix}
+ \textbf{b}_0 &\textbf{b}_1& \textbf{b}_2& \textbf{b}_3
+ \end{bmatrix} \equiv& \begin{bmatrix}
+ 1&2&4&3\\ 1&3&3&1
+ \end{bmatrix}
+\end{align*}
+
+\item Explain the role of convex hull in curves.
+\hfill[2 marks]
+\end{enumerate}
+\end{enumerate}
+
+\bvrhrule
+
+\begin{enumerate}[resume]
+\item \begin{enumerate}
+\item Describe the continuity conditions for
+curvilinear geometry. \hfill[5 marks]
+\item Define formally, a B-Spline curve. \hfill [2
+marks]
+\item How is a Bezier curve different from a B-Spline
+curve? \hfill [2 marks]
+\end{enumerate}
+\end{enumerate}
+
+\bvrhrule
+
+\begin{enumerate}[resume]
+\item \begin{enumerate}
+\item Given a triangle, with vertices defined by column
+vectors of \(P\); find its vertices after
+reflection across XZ plane. \hfill [3 marks]
+\begin{align*}
+ P\equiv
+ &\begin{bmatrix}
+ 3&6&5 \\ 4&4&6 \\ 1&2&3
+ \end{bmatrix}
+\end{align*}
+\item Given a pyramid with vertices defined by the
+column vectors of \(P\), and an axis of rotation
+\(A\) with direction \(\textbf{v}\) and passing
+through \(\textbf{p}\). Find the coordinates of
+the vertices after rotation about \(A\) by an angle
+of \(\theta=\pi/4\).\hfill [6 marks]
+\begin{align*}
+ P\equiv
+ &\begin{bmatrix}
+ 0&1&0&0 \\ 0&0&1&0 \\0&0&0&1
+ \end{bmatrix} \\
+ \begin{bmatrix}
+ \mathbf{v} & \mathbf{p}
+ \end{bmatrix}\equiv
+ &\begin{bmatrix}
+ 0&0 \\1&1\\1&0
+ \end{bmatrix}
+\end{align*}
+\end{enumerate}
+\end{enumerate}
+\bvrhrule
+
+\begin{enumerate}[resume]
+\item \begin{enumerate}
+\item Explain the two winding number rules for inside
+outside tests. \hfill [4 marks]
+\item Explain the working principle of a CRT. \hfill [5
+marks]
+\end{enumerate}
+\end{enumerate}
+
+\bvrhrule
+
+\begin{enumerate}[resume]
+\item \begin{enumerate}
+\item Given a projection plane \(P\) defined by normal
+\(\textbf{n}\) and a reference point \(\textbf{a}\);
+and the centre of projection as \(\mathbf{p}_0\);
+find the perspective projection of the point
+\(\textbf{x}\) on \(P\). \hfill [5 marks]
+\begin{align*}
+ \begin{bmatrix}
+ \mathbf{a}&\mathbf{n}&\mathbf{p}_0&\mathbf{x}
+ \end{bmatrix}\equiv
+ &
+ \begin{bmatrix}
+ 3&-1&1&8\\4&2&1&10\\5&-1&3&6
+ \end{bmatrix}
+\end{align*}
+\item Given a geometry \(G\), which is a standard unit
+cube scaled uniformly by half and viewed through
+a Cavelier projection bearing \(\theta=\pi/4\)
+wrt. \(X\) axis. \hfill [2 marks]
+\item Given a view coordinate system (VCS) with origin
+at \(\textbf{p}_v\) and euler angles ZYX as
+\(\boldsymbol{\theta}\) wrt. the world coordinate
+system (WCS); find the location \(\mathbf{x}_v\) in
+VCS, corresponding to \(\textbf{x}_w\) in
+WCS. \hfill [2 marks]
+\begin{align*}
+ \begin{bmatrix}
+ \mathbf{p}_v & \boldsymbol{\theta} & \mathbf{x}_w
+ \end{bmatrix}\equiv
+ &\begin{bmatrix}
+ 5&\pi/3&10\\5&0&10\\0&0&0
+ \end{bmatrix}
+\end{align*}
+\end{enumerate}
+\end{enumerate}
+
+\bvrhrule
+
+\begin{enumerate}[resume]
+\item \begin{enumerate}
+\item Describe the visible surface detection problem in
+about 25 words. \hfill [1 mark]
+\item To render a scene with \(N\) polygons into a
+display with height \(H\); what are the space and
+time complexities respectively of a typical
+image-space method. \hfill [2 marks]
+\item Given a 3D space bounded within \([0\quad0\quad0]\)
+and \([7\quad7\quad-7]\), containing two infinite
+planes each defined by 3 incident points
+\(\mathbf{a}_0, \mathbf{a}_1, \mathbf{a}_2\) and
+\(\mathbf{b}_0, \mathbf{b}_1, \mathbf{b}_2\)
+respectively bearing colours (RGB) as
+\(\mathbf{c}_a\) and \(\textbf{c}_b\) respectively.
+\begin{align*}
+ \begin{bmatrix}
+ \mathbf{a}_0&\mathbf{a}_1&\mathbf{a}_2
+ &\mathbf{b}_0&\mathbf{b}_1&\mathbf{b}_2
+ &\mathbf{c}_a&\mathbf{c}_b
+ \end{bmatrix}\equiv
+ &\begin{bmatrix}
+ 1&6&1&6&1&6&1&0 \\
+ 1&3&6&6&3&1&0&0 \\
+ -1&-6&-1&-1&-6&-1&0&1
+ \end{bmatrix}
+\end{align*}
+Compute and/ or determine using the depth-buffer
+method, the colour at pixel \(\mathbf{x}=(2,4)\) on
+a display resolved into \(7\times7\) pixels. The
+projection plane is at \(Z=0\), looking at
+\(-Z\). \hfill [6 marks]
+\end{enumerate}
+\end{enumerate}
+
+\bvrhrule
+\end{document}
diff --git a/macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample.pdf b/macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample.pdf
new file mode 100644
index 0000000000..9f1ff2b670
--- /dev/null
+++ b/macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample.pdf
Binary files differ
diff --git a/macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample.tex b/macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample.tex
new file mode 100644
index 0000000000..4541405a81
--- /dev/null
+++ b/macros/latex/contrib/tiet-question-paper/tiet-question-paper-sample.tex
@@ -0,0 +1,180 @@
+\documentclass[11pt,a4paper,onecolumn]{tiet-question-paper}
+\date{28 May 2024}
+\institute{Alpha}
+\instlogo{images/tiet-logo.pdf}
+\schoolordepartment{%
+ Computer Science \& Engineering Department}
+\examname{%
+ End Semester Examination}
+\coursecode{UCS505}
+\coursename{Computer Graphics}
+\timeduration{3 hours}
+\maxmarks{45}
+\faculty{ANG,AMK,HPS,YDS,RGB}
+
+\begin{document}
+\maketitle
+\textbf{Instructions:}
+\begin{enumerate}
+\item Attempt any 5 questions;
+\item Attempt all the subparts of a question at one
+ place.
+\end{enumerate}
+\bvrhrule[0.4pt]
+\begin{enumerate}
+\item
+ \begin{enumerate}
+ \item Given the control polygon
+ $\textbf{b}_0, \textbf{b}_1, \textbf{b}_2,
+ \textbf{b}_3$ of a Cubic Bezier curve; determine
+ the coordinates for parameter values
+ $\forall t\in T$. \hfill [7 marks]
+
+ \begin{align*}
+ T \equiv
+ & \{0, 0.15, 0.35, 0.5, 0.65, 0.85, 1\} \\
+ \begin{bmatrix}
+ \textbf{b}_0 &\textbf{b}_1& \textbf{b}_2& \textbf{b}_3
+ \end{bmatrix} \equiv
+ & \begin{bmatrix}
+ 1&2&4&3\\ 1&3&3&1
+ \end{bmatrix}
+ \end{align*}
+ \item Explain the role of convex hull in curves.
+ \hfill[2 marks]
+ \end{enumerate}
+\end{enumerate}
+\bvrhrule[0.4pt]
+\begin{enumerate}[resume]
+\item
+ \begin{enumerate}
+ \item Describe the continuity conditions for
+ curvilinear geometry.
+ \hfill[5 marks]
+ \item Define formally, a B-Spline curve. \hfill [2
+ marks]
+ \item How is a Bezier curve different from a B-Spline
+ curve?
+ \end{enumerate}
+\end{enumerate}
+\bvrhrule[0.4pt]
+\begin{enumerate}[resume]
+\item
+ \begin{enumerate}
+ \item Given a triangle, with vertices defined by
+ column vectors of $P$; find its vertices after
+ reflection across XZ plane. \hfill [3 marks]
+ \begin{align*}
+ P\equiv
+ &\begin{bmatrix}
+ 3&6&5 \\ 4&4&6 \\ 1&2&3
+ \end{bmatrix}
+ \end{align*}
+ \item Given a pyramid with vertices defined by the
+ column vectors of $P$, and an axis of rotation $A$
+ with direction $\textbf{v}$ and passing through
+ $\textbf{p}$. Find the coordinates of the vertices
+ after rotation about $A$ by an angle of
+ $\theta=\pi/4$.\hfill [6 marks]
+ \begin{align*}
+ P\equiv
+ &\begin{bmatrix}
+ 0&1&0&0 \\ 0&0&1&0 \\0&0&0&1
+ \end{bmatrix} \\
+ \begin{bmatrix}
+ \mathbf{v} & \mathbf{p}
+ \end{bmatrix}\equiv
+ &\begin{bmatrix}
+ 0&0 \\1&1\\1&0
+ \end{bmatrix}
+ \end{align*}
+ \end{enumerate}
+\end{enumerate}
+\bvrhrule[0.4pt]
+\begin{enumerate}[resume]
+\item
+ \begin{enumerate}
+ \item Explain the two winding number rules for
+ inside outside tests. \hfill [4 marks]
+ \item Explain the working principle of a
+ CRT. \hfill [5 marks]
+ \end{enumerate}
+\end{enumerate}
+\bvrhrule[0.4pt]
+\begin{enumerate}[resume]
+\item
+ \begin{enumerate}
+ \item Given a projection plane $P$ defined by normal
+ $\textbf{n}$ and a reference point $\textbf{a}$;
+ and the centre of projection as $\mathbf{p}_0$;
+ find the perspective projection of the point
+ $\textbf{x}$ on $P$. \hfill [5 marks]
+ \begin{align*}
+ \begin{bmatrix}
+ \mathbf{a}&\mathbf{n}&\mathbf{p}_0&\mathbf{x}
+ \end{bmatrix}\equiv
+ &
+ \begin{bmatrix}
+ 3&-1&1&8\\4&2&1&10\\5&-1&3&6
+ \end{bmatrix}
+ \end{align*}
+ \item Given a geometry $G$, which is a standard unit
+ cube scaled uniformly by half and viewed through a
+ Cavelier projection bearing $\theta=\pi/4$
+ wrt. $X$-axis. \hfill [2 marks]
+ \item Given a view coordinate system (VCS) with
+ origin at $\textbf{p}_v$ and euler angles ZYX
+ $\boldsymbol{\theta}$ wrt. world coordinate system
+ (WCS); find the location $\mathbf{x}_v$ in VCS,
+ corresponding to the point $\textbf{x}_w$ in
+ WCS. \hfill [2 marks]
+ \begin{align*}
+ \begin{bmatrix}
+ \mathbf{p}_v & \boldsymbol{\theta} & \mathbf{x}_w
+ \end{bmatrix}\equiv
+ &\begin{bmatrix}
+ 5&\pi/3&10\\5&0&10\\0&0&0
+ \end{bmatrix}
+ \end{align*}
+ \end{enumerate}
+\end{enumerate}
+\bvrhrule[0.4pt]
+\begin{enumerate}[resume]
+\item
+ \begin{enumerate}
+ \item Describe the visible surface detection
+ problem in about 25 words. \hfill [1 mark]
+ \item To render a scene with $N$ polygons into a
+ display with height $H$; what are the space and
+ time complexities respectively of a typical
+ image-space method. \hfill [2 marks]
+ \item Given a 3D space bounded within
+ $[0\quad0\quad0]$ and $[7\quad7\quad-7]$,
+ containing two infinite planes each defined by 3
+ incident points
+ $\mathbf{a}_0, \mathbf{a}_1, \mathbf{a}_2$ and
+ $\mathbf{b}_0, \mathbf{b}_1, \mathbf{b}_2$
+ respectively bearing colours (RGB) as
+ $\mathbf{c}_a$ and $\textbf{c}_b$ respectively.
+ \begin{align*}
+ \begin{bmatrix}
+ \mathbf{a}_0&\mathbf{a}_1&\mathbf{a}_2
+ &\mathbf{b}_0&\mathbf{b}_1&\mathbf{b}_2
+ &\mathbf{c}_a&\mathbf{c}_b
+ \end{bmatrix}\equiv
+ &\begin{bmatrix}
+ 1&6&1&6&1&6&1&0 \\
+ 1&3&6&6&3&1&0&0 \\
+ -1&-6&-1&-1&-6&-1&0&1
+ \end{bmatrix}
+ \end{align*}
+
+ Compute and/ or determine using the depth-buffer
+ method, the colour at pixel $\mathbf{x}=(2,4)$ on
+ a display resolved into $7\times7$ pixels. The
+ projection plane is at $Z=0$, looking at
+ $-Z$. \hfill [6 marks]
+ \end{enumerate}
+\end{enumerate}
+\bvrhrule[0.4pt]
+\end{document}
diff --git a/macros/latex/contrib/tiet-question-paper/tiet-question-paper.cls b/macros/latex/contrib/tiet-question-paper/tiet-question-paper.cls
new file mode 100644
index 0000000000..6bc28c5792
--- /dev/null
+++ b/macros/latex/contrib/tiet-question-paper/tiet-question-paper.cls
@@ -0,0 +1,337 @@
+%% ----------------------------------------------------
+%% Latex class ‘tiet-question-paper’
+%%
+%% Author: Raghav B. Venkataramaiyer
+%% Email: bv.raghav -at- thapar -dot- edu
+%% Email: bvraghav -at- gmail -dot- com
+%% License: [MIT License](./LICENSE)
+%% Version: 2024-06-22
+%% ----------------------------------------------------
+
+\NeedsTeXFormat{LaTeX2e}
+
+\ProvidesClass%
+{tiet-question-paper}%
+[2024-06-22 TIET Question Paper class]
+
+%% -----------------------------------
+%% Parent Class
+%% -----------------------------------
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
+\ProcessOptions\relax
+\LoadClass[11pt,a4paper,onecolumn]{article}
+%% -----------------------------------
+
+%% -----------------------------------
+%% Page Margins
+%% -----------------------------------
+\RequirePackage[%
+ a4paper,%
+ left=1in,%
+ top=0.5in,%
+ right=0.75in,%
+ bottom=0.75in%
+]{geometry}
+%% -----------------------------------
+
+%% -----------------------------------
+%% Math package(s)
+%% -----------------------------------
+\RequirePackage{amsmath}
+%% -----------------------------------
+
+%% -----------------------------------
+%% Lipsum for debugging
+%% -----------------------------------
+\RequirePackage{blindtext}
+%% -----------------------------------
+
+%% -----------------------------------
+%% Check for empty argument
+%% -----------------------------------
+\RequirePackage{ifmtarg}
+%% -----------------------------------
+
+%% -----------------------------------
+%% No paragraph indents
+%% -----------------------------------
+\RequirePackage{parskip}
+%% -----------------------------------
+
+%% -----------------------------------
+%% Line spacing
+%% -----------------------------------
+% \RequirePackage{setspace}
+% \doublespacing
+%% -----------------------------------
+
+%% -----------------------------------
+%% Graphics
+%% -----------------------------------
+\RequirePackage{graphicx}
+% \graphicspath{ {./images/} }
+%% -----------------------------------
+
+%% -----------------------------------
+%% Compact Enumeration
+%% -----------------------------------
+\RequirePackage[inline,sizes]{enumitem}
+% \setlist[enumerate]{itemsep=0in}
+\setlist{nosep,leftmargin=*}
+\setlist[enumerate,2]{label=\alph*)}
+%% -----------------------------------
+
+%% -----------------------------------
+%% Extra font sizes
+%% -----------------------------------
+\RequirePackage{anyfontsize}
+%% -----------------------------------
+
+%% -----------------------------------
+%% Automatic width computation
+%% -----------------------------------
+\RequirePackage{linegoal}
+%% -----------------------------------
+
+%% -----------------------------------
+%% Tabularx
+%% -----------------------------------
+\RequirePackage{tabularx}
+%% -----------------------------------
+
+%% -----------------------------------
+%% Box alignment within tables.
+%%
+%% valign keyword in includegraphics
+%% -----------------------------------
+\RequirePackage[export]{adjustbox}
+%% -----------------------------------
+
+%% -----------------------------------
+%% {align} like columnar env.
+%%
+%% Remembers end of paragraph and starts there.
+%% -----------------------------------
+% \RequirePackage{paracol}
+%% -----------------------------------
+
+%% -----------------------------------
+%% Customizing section font
+%% -----------------------------------
+\RequirePackage{sectsty}
+\allsectionsfont{\sffamily}
+\paragraphfont{\sffamily}
+%% -----------------------------------
+
+%% -----------------------------------
+%% Class variable definitions
+%% -----------------------------------
+
+% Variable: institute
+\def\tiet@institute{Thapar Institute of Engineering \&
+ Technology}
+\def\institute#1{\gdef\tiet@institute{#1}}
+
+% Variable: abbrevinst
+\def\tiet@abbrevinst{\textsc{tiet}}
+\def\abbrevinst#1{\gdef\tiet@abbrevinst{#1}}
+
+% Variable: instaddress
+\def\tiet@instaddress{Patiala 147004}
+\def\instaddress#1{\gdef\tiet@instaddress{#1}}
+
+% Variable: instlogo
+\let\tiet@instlogo\relax
+\def\instlogo#1{\gdef\tiet@instlogo{#1}}
+
+% Variable: schoolordepartment
+\let\tiet@schoolordepartment\relax
+\def\schoolordepartment#1{\def\tiet@schoolordepartment{#1}}
+
+% Variable: examname
+\let\tiet@examname\relax
+\def\examname#1{\def\tiet@examname{#1}}
+
+% Variable: cohort
+\let\tiet@cohort\relax
+\def\cohort#1{\def\tiet@cohort{#1}}
+
+% Variable: coursecode
+\let\tiet@coursecode\relax
+\def\coursecode#1{\def\tiet@coursecode{#1}}
+
+% Variable: coursename
+\let\tiet@coursename\relax
+\def\coursename#1{\def\tiet@coursename{#1}}
+
+% Variable: timeduration
+\let\tiet@timeduration\relax
+\def\timeduration#1{\def\tiet@timeduration{#1}}
+
+% Variable: maxmarks
+\let\tiet@maxmarks\relax
+\def\maxmarks#1{\def\tiet@maxmarks{#1}}
+
+% Variable: faculty
+\let\tiet@faculty\relax
+\def\faculty#1{\gdef\tiet@faculty{#1}}
+
+%% -----------------------------------
+
+%% -----------------------------------
+%% Questions Enum
+%%
+%% Ref: https://tex.stackexchange.com/a/164623
+%% Update: Doesn’t help enough.
+%% [TODO]
+%% -----------------------------------
+\DeclareRobustCommand%
+% Horizontal rule after each question
+\bvrhrule[1][0.4pt]{\rule{\linewidth}{#1}}
+
+\DeclareRobustCommand%
+% Skip line
+\bvrskipline[1][]{\vspace{#1\baselineskip}}
+
+% \newlist{qenum}{enumerate}{3}
+% \setlist[qenum]{nosep,label=\arabic*.}
+% % -----------------------------------------------------
+% % We need a toggle to track whether the item is first
+% % in the list or not
+% \newif\ifbvrfirstq\bvrfirstqfalse
+% \setlist*[qenum,1]{%
+% label=\arabic*.,%
+% % ---------------------------------------------------
+% % This saves the standard definition of \item and
+% % then redefines it to add the fill if the item is
+% % not first on the list; if it is the first item, it
+% % omits the fill but toggles the bvrfirstq switch so
+% % the next item will trigger it
+% first={%
+% % -------------------------------------------------
+% % Save the standard definition of \item in a macro,
+% % \olditem
+% \let\olditem\item%
+% % -------------------------------------------------
+% % Set the toggle for first item in the list to true
+% \bvrfirstqtrue%
+% % -------------------------------------------------
+% % New, temporary defition of \item
+% \def\item{\ifbvrfirstq\olditem\bvrfirstqfalse\else
+% \bvrhrule\bvrskipline\olditem\fi}%
+% },%
+% % ---------------------------------------------------
+% % This takes care of adding the fill for the final
+% % item on the list and just makes sure that \item is
+% % reset to its standard definition
+% after={
+% % -------------------------------------------------
+% % Fill for final item in list
+% \bvrhrule%
+% % -------------------------------------------------
+% % Restore standard definition of \item
+% \let\item\olditem%
+% }%
+% }
+% \setlist[qenum,2]{label=\alph*),before={},after={},first={}}
+% %% -----------------------------------
+
+
+%% -----------------------------------
+%% Write Examination Details and Draw Logo
+%% -----------------------------------
+
+\DeclareRobustCommand%
+% Write Examination Details
+\writeexamdetails{
+ \parbox[t][][t]{\linewidth}{\centering\large%
+ {\bfseries \tiet@institute\par}
+
+ \vspace*{0.2\baselineskip}
+ {\tiet@schoolordepartment}
+
+ \vspace*{0.2\baselineskip}
+ {\MakeUppercase\tiet@examname}}
+}
+\DeclareRobustCommand%
+% Draw Logo
+\drawinstlogo{
+ \parbox[t][][t]{\linewidth}{\raggedright%
+ \includegraphics[width=11.5mm,valign=t]
+ {\tiet@instlogo}\par}
+}
+
+
+
+%% -----------------------------------
+%% Title Page
+%% -----------------------------------
+
+% Make title
+\renewcommand\maketitle{
+ {\noindent Roll No. \rule{5cm}{0.4pt} \hfill
+ \bfseries\@date\par}
+
+ % \vspace*{0.5\baselineskip}
+ {\noindent\large \textbf{\tiet@coursecode :
+ \tiet@coursename} \hfill Time:
+ \textbf{\tiet@timeduration} \hspace{0.3em}
+ MM:\textbf{\tiet@maxmarks}}\\
+ {\noindent Faculty: \tiet@faculty}
+
+
+ \vspace*{\baselineskip}
+ \ifx\tiet@instlogo\@empty
+ \writeexamdetails
+ \else
+ \begin{tabularx}{\textwidth}{Xp{18mm}}
+ \writeexamdetails & \drawinstlogo
+ \end{tabularx}
+ \fi
+
+ \par\rule{\textwidth}{0.4pt}
+ \par\vspace*{0.5\baselineskip}
+}
+%% -----------------------------------
+
+%% -----------------------------------
+%% Counterlessfootnote
+%% -----------------------------------
+\newcommand{\footnotenoless}[1]{%
+ \let\svthefootnote\thefootnote
+ \let\thefootnote\relax\footnote{#1}
+ \addtocounter{footnote}{-1}\let\thefootnote\svthefootnote
+}
+%% -----------------------------------
+
+%% -----------------------------------
+%% Abbreviations
+%% -----------------------------------
+\RequirePackage{xspace}
+
+% Add a period to the end of an abbreviation unless
+% there's one already, then \xspace.
+\makeatletter
+\DeclareRobustCommand\onedot{\futurelet\@let@token\@onedot}
+\def\@onedot{\ifx\@let@token.\else.\null\fi\xspace}
+
+\def\eg{\emph{e.g}\onedot}
+\def\Eg{\emph{E.g}\onedot}
+
+\def\ie{\emph{i.e}\onedot}
+\def\Ie{\emph{I.e}\onedot}
+
+\def\cf{\emph{c.f}\onedot}
+\def\Cf{\emph{C.f}\onedot}
+
+\def\etc{\emph{etc}\onedot}
+
+\def\vs{\emph{vs}\onedot}
+
+\def\wrt{w.r.t\onedot}
+\def\dof{d.o.f\onedot}
+
+\def\etal{\emph{et al}\onedot}
+\makeatother
+%% -----------------------------------
+