Difference between revisions of "LaTeX/C3/Decimal-Point-Alignment/English"
Ketkinaina (Talk | contribs) (Created page with "'''Title of the Script: '''Decimal point alignment. '''Author''': Ambika Vanchinathan, Ketki Bhamble '''Keywords: '''latex, Siunitx, decimal alignment,table formatting, vide...") |
|||
| Line 1: | Line 1: | ||
| − | '''Title of the Script: '''Decimal point alignment. | + | '''Title of the Script: '''Decimal point alignment'''. |
'''Author''': Ambika Vanchinathan, Ketki Bhamble | '''Author''': Ambika Vanchinathan, Ketki Bhamble | ||
'''Keywords: '''latex, Siunitx, decimal alignment,table formatting, video tutorial. | '''Keywords: '''latex, Siunitx, decimal alignment,table formatting, video tutorial. | ||
| + | |||
{|border=1 | {|border=1 | ||
| Line 13: | Line 14: | ||
'''Title Slide''' | '''Title Slide''' | ||
| − | || Welcome to this | + | || Welcome to this Spoken tutorial on '''Decimal Point Alignment'''. |
|- | |- | ||
|| '''Slide 2''' | || '''Slide 2''' | ||
| Line 20: | Line 21: | ||
|| In this tutorial we will learn to, | || In this tutorial we will learn to, | ||
* Define the '''SIunitx''' package | * Define the '''SIunitx''' package | ||
| − | * Understand the code | + | * Understand the code. |
* Use capital '''S''' to show decimal point alignment. | * Use capital '''S''' to show decimal point alignment. | ||
* Run the LaTeX code to see the output. | * Run the LaTeX code to see the output. | ||
| Line 28: | Line 29: | ||
'''System Requirements''' | '''System Requirements''' | ||
|| To record this tutorial, I am using: | || To record this tutorial, I am using: | ||
| − | *'''Ubuntu Linux OS version | + | *'''Ubuntu Linux OS version''' 22.04 and |
| − | *'''Texworks version 0.6.6 | + | *'''Texworks version''' 0.6.6 |
|- | |- | ||
|| '''Slide 4''' | || '''Slide 4''' | ||
| Line 47: | Line 48: | ||
This file is provided in the Code Files link of this tutorial page. | This file is provided in the Code Files link of this tutorial page. | ||
| + | |||
|| The following code file is required to practice this tutorial. | || The following code file is required to practice this tutorial. | ||
| Line 54: | Line 56: | ||
'''What is Siunitx?''' | '''What is Siunitx?''' | ||
| − | || What is''' Siunitx?''' | + | || What is ''' Siunitx?''' |
The '''siunitx''' package formats, | The '''siunitx''' package formats, | ||
| Line 68: | Line 70: | ||
|- | |- | ||
|| '''\begin{table} ''' | || '''\begin{table} ''' | ||
| − | || This command makes a table and places it automatically in best position. | + | || This command makes a table and places it automatically in the best position. |
|- | |- | ||
|| '''\caption{Standard behaviour of the \texttt{S} column type.\label{tab:S:standard}}''' | || '''\caption{Standard behaviour of the \texttt{S} column type.\label{tab:S:standard}}''' | ||
| Line 79: | Line 81: | ||
This label acts as an identifier. | This label acts as an identifier. | ||
| − | It can be referenced elsewhere in the document using the ref command. | + | It can be referenced elsewhere in the document using the '''ref''' command. |
|- | |- | ||
|| '''\begin{center}''' | || '''\begin{center}''' | ||
| Line 95: | Line 97: | ||
|- | |- | ||
|| '''%\begin{tabular}{l@{}s@{}r} ''' | || '''%\begin{tabular}{l@{}s@{}r} ''' | ||
| − | || The commented line shows that s in lowercase and it does not work in '''siunitx'''. | + | || The commented line shows that '''s''' in lowercase and it does not work in '''siunitx'''. |
|- | |- | ||
|| '''\hline''' | || '''\hline''' | ||
| Line 105: | Line 107: | ||
|- | |- | ||
|| '''No. & {Some Values} & Var.\\''' | || '''No. & {Some Values} & Var.\\''' | ||
| − | || This command creates a table with three columns: '''Number, some Values '''and''' var | + | || This command creates a table with three columns: '''Number''', '''some Values '''and ''' var '''. |
|- | |- | ||
|| '''Highlight:''' | || '''Highlight:''' | ||
| Line 130: | Line 132: | ||
Let’s run the code. | Let’s run the code. | ||
| − | Click the green '''Typeset '''button to run the code. | + | Click the green '''Typeset ''' button to run the code. |
We get an error. | We get an error. | ||
| Line 161: | Line 163: | ||
|| '''As an Assignment''' | || '''As an Assignment''' | ||
| − | Add 2 more rows of data to the table and see the difference in the output | + | Add 2 more rows of data to the table and see the difference in the output. |
|- | |- | ||
|| '''Slide 9''' | || '''Slide 9''' | ||
Latest revision as of 11:24, 28 May 2025
Title of the Script: Decimal point alignment.
Author: Ambika Vanchinathan, Ketki Bhamble
Keywords: latex, Siunitx, decimal alignment,table formatting, video tutorial.
| Visual Cue | Narration |
| Slide 1
Title Slide |
Welcome to this Spoken tutorial on Decimal Point Alignment. |
| Slide 2
Learning Objectives |
In this tutorial we will learn to,
|
| Slide 3
System Requirements |
To record this tutorial, I am using:
|
| Slide 4
Pre-requisites |
To follow this tutorial,
Learners should have basic knowledge of LaTeX. |
| Slide 5
Code Files The following code file is required to practice this tutorial: 1. SIunitx-eg1.tex This file is provided in the Code Files link of this tutorial page. |
The following code file is required to practice this tutorial.
This file is provided in the Code Files link of this tutorial page. |
| Slide 6
What is Siunitx? |
What is Siunitx?
The siunitx package formats,
|
| Now let us begin. | |
| \usepackage{siunitx} | \usepackage{siunitx} Imports the siunitx package.
It enables decimal alignment using the capital S column type in tables. |
| \begin{table} | This command makes a table and places it automatically in the best position. |
| \caption{Standard behaviour of the \texttt{S} column type.\label{tab:S:standard}}
\label{tab:S:standard}} \ref{tab:S:standard} |
This command adds a Caption for the table.
This label acts as an identifier. It can be referenced elsewhere in the document using the ref command. |
| \begin{center} | This command centers the table on the page. |
| \begin{tabular}{...}
({l@{}S@{}r}): |
This command starts a tabular column.
In this command,
|
| %\begin{tabular}{l@{}s@{}r} | The commented line shows that s in lowercase and it does not work in siunitx. |
| \hline
Highlight all three horizontal lines. point the cursor to all three horizontal lines. |
There are three horizontal lines to separate the rows in the table. |
| No. & {Some Values} & Var.\\ | This command creates a table with three columns: Number, some Values and var . |
| Highlight:
1 & 1 & 1000\\ Highlight all the lines: 1 & 1.0 & 1000\\ 2 & 34.2345 & 100 \\ 3 & -555.12 \\ |
In these lines of code, the second column is decimal aligned.
The decimal alignment happens due to the siunitx package. |
| Highlight line 10 and 6
\begin{tabular}{l@{}s@{}r} %% lower case s does not work |
Let us comment line number 10, and uncomment line number 11.
Let’s run the code. Click the green Typeset button to run the code. We get an error. Using lowercase ‘s’ in tabular is a syntax error as LaTeX doesn't recognize it. |
| Comment line number 11 and uncomment line number 10.
Show the output. |
Again comment line number 11 and uncomment line number 10.
Let’s run the code to see the proper output. We have resolved the error. |
| Slide 7
Summary In this tutorial, we have learnt to
|
With this we come to the end of this tutorial. Let us summarise. |
| Slide 8
Assignment |
As an Assignment
Add 2 more rows of data to the table and see the difference in the output. |
| Slide 9
Thank you |
Thank you for joining |