From 74b1f3332f476d1898d85e2c1fa723c0c7a63d1f Mon Sep 17 00:00:00 2001 From: Lilian Besson Date: Thu, 28 Jan 2021 18:31:42 +0100 Subject: Add some explanations for: floats, tables, and non-ASCII input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It bothered me that the document contained - I definitely have to lookup the placement options each time. - % Again, I have to look these up. Each. And. Every. Time. So I added a few lines to explain the most basic options of float positions and tables layout. It's really not that magical, at least for the basic options (and they are enough, [I wrote a 300 page thesis](https://perso.crans.org/besson/phd.pdf) with almost no need for any other options except the one introduced here) I also added a last short section about using LaTeX to display non-ASCII symbols (like French ç with \,c) or writing in non-ASCII input. I think it's mandatory to include this, as most LaTeX users are *not* native English speakers. I mentioned LuaTeX and XeLaTeX, just to give their names. --- latex.html.markdown | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'latex.html.markdown') diff --git a/latex.html.markdown b/latex.html.markdown index 49200968..98abc5a1 100644 --- a/latex.html.markdown +++ b/latex.html.markdown @@ -181,7 +181,9 @@ Summations and Integrals are written with sum and int commands: \section{Figures} Let's insert a figure. Figure placement can get a little tricky. +Basic options are [t] for top, [b] for bottom, [h] for here (approximately). I definitely have to lookup the placement options each time. +% See https://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions for more details \begin{figure}[H] % H here denoted the placement option. \centering % centers the figure on the page @@ -198,13 +200,21 @@ We can also insert Tables in the same way as figures. \begin{table}[H] \caption{Caption for the Table.} % the {} arguments below describe how each row of the table is drawn. - % Again, I have to look these up. Each. And. Every. Time. - \begin{tabular}{c|cc} + % The basic is simple: one letter for each columns, to control alignment: + % basic options are: c, l, r and p for centered, left, right and paragraph + % optionnally, you can add a | for a vertical line + % See https://en.wikibooks.org/wiki/LaTeX/Tables for more details + \begin{tabular}{c|cc} % here it means "centered | vertical line, centered centered" Number & Last Name & First Name \\ % Column rows are separated by & \hline % a horizontal line 1 & Biggus & Dickus \\ 2 & Monty & Python \end{tabular} + % it will approximately be displayed like this + % Number | Last Name First Name + % -------|--------------------------- % because of \hline + % 1 | Biggus Dickus + % 2 | Monty Python \end{table} \section{Getting \LaTeX{} to not compile something (i.e.\ Source Code)} @@ -218,7 +228,8 @@ environment. \begin{verbatim} print("Hello World!") a%b; % look! We can use % signs in verbatim. - random = 4; #decided by fair random dice roll + random = 4; #decided by fair random dice roll, https://www.xkcd.com/221/ + See https://www.explainxkcd.com/wiki/index.php/221:_Random_Number \end{verbatim} \section{Compiling} @@ -244,6 +255,7 @@ Step 2 is still happening behind the scenes\footnote{In cases, where you use references (like Eqn.~\ref{eq:pythagoras}), you may need to run Step 2 multiple times, to generate an intermediary *.aux file.}. % Also, this is how you add footnotes to your document! +% with a simple \footnote{...} command. They are numbered ¹, ², ... by default. You write all your formatting information in plain text in Step 1. The compilation part in Step 2 takes care of producing the document in the @@ -265,6 +277,27 @@ There exists two main types of links: visible URL \\ This package also produces list of thumbnails in the output pdf document and active links in the table of contents. +\section{Writing in ASCII or other encodings} + +By default, historically LaTeX accepts input which are pure ASCII, +meaning without accents (à, è etc) and non-latin symbols. + +It is easy to incert accents and basic latin symbols, with backslash shortcuts +Like \,c, \'e, \`A, \ae and \oe etc. % for ç, é, À, etc +% See https://en.wikibooks.org/wiki/LaTeX/Special_Characters#Escaped_codes for more + +To write directly in UTF-8, when compiling with pdflatex, use +\begin{verbatim} + \usepackage[utf8]{inputenc} +\end{verbatim} +The selected font has to support the glyphs used for your document, you have to add +\begin{verbatim} + \usepackage[T1]{fontenc} +\end{verbatim} + +Not that there also exists LuaTeX and XeLaTeX that were designed to have builtin +support for UTF-8 and case ease your life if you don't write in a latin alphabet. + \section{End} That's all for now! -- cgit v1.2.3 From 028b3736d4be6021e1a092b3859db82c3d3f9b97 Mon Sep 17 00:00:00 2001 From: Lilian Besson Date: Sun, 31 Jan 2021 22:23:16 +0100 Subject: Update latex.html.markdown, columns > column Co-authored-by: Andre Polykanine --- latex.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'latex.html.markdown') diff --git a/latex.html.markdown b/latex.html.markdown index 98abc5a1..0d4daad4 100644 --- a/latex.html.markdown +++ b/latex.html.markdown @@ -200,7 +200,7 @@ We can also insert Tables in the same way as figures. \begin{table}[H] \caption{Caption for the Table.} % the {} arguments below describe how each row of the table is drawn. - % The basic is simple: one letter for each columns, to control alignment: + % The basic is simple: one letter for each column, to control alignment: % basic options are: c, l, r and p for centered, left, right and paragraph % optionnally, you can add a | for a vertical line % See https://en.wikibooks.org/wiki/LaTeX/Tables for more details -- cgit v1.2.3 From 8ad80f71e59f5ffb30d51a4649bfabd3575ec9bb Mon Sep 17 00:00:00 2001 From: Lilian Besson Date: Sun, 31 Jan 2021 22:23:34 +0100 Subject: Update latex.html.markdown Co-authored-by: Andre Polykanine --- latex.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'latex.html.markdown') diff --git a/latex.html.markdown b/latex.html.markdown index 0d4daad4..a2218a1f 100644 --- a/latex.html.markdown +++ b/latex.html.markdown @@ -282,7 +282,7 @@ active links in the table of contents. By default, historically LaTeX accepts input which are pure ASCII, meaning without accents (à, è etc) and non-latin symbols. -It is easy to incert accents and basic latin symbols, with backslash shortcuts +It is easy to insert accents and basic Latin symbols, with backslash shortcuts Like \,c, \'e, \`A, \ae and \oe etc. % for ç, é, À, etc % See https://en.wikibooks.org/wiki/LaTeX/Special_Characters#Escaped_codes for more -- cgit v1.2.3 From 14baa531c9024d1f9d0b777331126362ee07d0ce Mon Sep 17 00:00:00 2001 From: Lilian Besson Date: Sun, 31 Jan 2021 22:23:47 +0100 Subject: Update latex.html.markdown Co-authored-by: Andre Polykanine --- latex.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'latex.html.markdown') diff --git a/latex.html.markdown b/latex.html.markdown index a2218a1f..0fabee40 100644 --- a/latex.html.markdown +++ b/latex.html.markdown @@ -280,7 +280,7 @@ active links in the table of contents. \section{Writing in ASCII or other encodings} By default, historically LaTeX accepts input which are pure ASCII, -meaning without accents (à, è etc) and non-latin symbols. +meaning without accents (à, è etc.) and non-Latin symbols. It is easy to insert accents and basic Latin symbols, with backslash shortcuts Like \,c, \'e, \`A, \ae and \oe etc. % for ç, é, À, etc -- cgit v1.2.3 From e6eb5f88ab4f780533f0a2fe07723b5227aac407 Mon Sep 17 00:00:00 2001 From: Lilian Besson Date: Sun, 31 Jan 2021 22:25:39 +0100 Subject: input which are => inputs which are And also change on more http:// link to https:// --- latex.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'latex.html.markdown') diff --git a/latex.html.markdown b/latex.html.markdown index 0fabee40..29a9f638 100644 --- a/latex.html.markdown +++ b/latex.html.markdown @@ -2,7 +2,7 @@ language: latex contributors: - ["Chaitanya Krishna Ande", "http://icymist.github.io"] - - ["Colton Kohnke", "http://github.com/voltnor"] + - ["Colton Kohnke", "https://github.com/voltnor"] - ["Sricharan Chiruvolu", "http://sricharan.xyz"] - ["Ramanan Balakrishnan", "https://github.com/ramananbalakrishnan"] - ["Svetlana Golubeva", "https://attillax.github.io/"] @@ -279,8 +279,8 @@ active links in the table of contents. \section{Writing in ASCII or other encodings} -By default, historically LaTeX accepts input which are pure ASCII, -meaning without accents (à, è etc.) and non-Latin symbols. +By default, historically LaTeX accepts inputs which are pure ASCII (128), +not even extened ASCII, meaning without accents (à, è etc.) and non-Latin symbols. It is easy to insert accents and basic Latin symbols, with backslash shortcuts Like \,c, \'e, \`A, \ae and \oe etc. % for ç, é, À, etc -- cgit v1.2.3