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 From 549ac28f77b215b0ef05930b85b8bf60f29c500b Mon Sep 17 00:00:00 2001 From: taivlam <47955724+taivlam@users.noreply.github.com> Date: Mon, 3 Jan 2022 15:52:43 +0000 Subject: [latex/en] Correct typos & make minor improvements (#4287) * Correct various minor typos * Changed from using `\ ` to `~` for non-breaking spaces in the middle of sentences * The table's column labels had Last and First names (respectively) swapped, compared to the corresponding contents of the table * Made language of sentence about LuaTeX and XeLaTeX clearer --- latex.html.markdown | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'latex.html.markdown') diff --git a/latex.html.markdown b/latex.html.markdown index 29a9f638..34c4b78d 100644 --- a/latex.html.markdown +++ b/latex.html.markdown @@ -95,8 +95,9 @@ to the source code. Separate paragraphs by empty lines. -You need to add a backslash after abbreviations (if not followed by a comma), because otherwise the spacing after the dot is too large: -E.g., i.e., etc.\ are are such abbreviations. +You need to add a tilde after abbreviations (if not followed by a comma) for a +non-breaking space, because otherwise the spacing after the dot is too large: +E.g., i.e., etc.~are are such abbreviations. \section{Lists} Lists are one of the easiest things to create in \LaTeX! I need to go shopping @@ -140,8 +141,7 @@ about! Operators are essential parts of a mathematical document: trigonometric functions ($\sin$, $\cos$, $\tan$), logarithms and exponentials ($\log$, $\exp$), -limits ($\lim$), etc.\ -have pre-defined LaTeX commands. +limits ($\lim$), etc.~have pre-defined LaTeX commands. Let's write an equation to see how it's done: $\cos(2\theta) = \cos^{2}(\theta) - \sin^{2}(\theta)$ @@ -200,24 +200,24 @@ 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 column, to control alignment: + % The basics are 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 + % optionally, 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 & + Number & First Name & Last 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 + % Number | First Name Last Name % -------|--------------------------- % because of \hline % 1 | Biggus Dickus % 2 | Monty Python \end{table} -\section{Getting \LaTeX{} to not compile something (i.e.\ Source Code)} +\section{Getting \LaTeX{} to not compile something (i.e.~Source Code)} Let's say we want to include some code into our \LaTeX{} document, we would then need \LaTeX{} to not try and interpret that text and instead just print it to the document. We do this with a verbatim @@ -236,7 +236,7 @@ environment. By now you're probably wondering how to compile this fabulous document and look at the glorious glory that is a \LaTeX{} pdf. -(yes, this document actually does compile). +(Yes, this document actually does compile). Getting to the final document using \LaTeX{} consists of the following steps: @@ -274,13 +274,13 @@ There exists two main types of links: visible URL \\ % You can not add extra-spaces or special symbols into shadowing text since it % will cause mistakes during the compilation -This package also produces list of thumbnails in the output pdf document and +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 inputs which are pure ASCII (128), -not even extened ASCII, meaning without accents (à, è etc.) and non-Latin symbols. +but not extended 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 @@ -295,8 +295,8 @@ The selected font has to support the glyphs used for your document, you have to \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. +Since LuaTeX and XeLaTeX were designed with built-in support for UTF-8, making +life easier for writing in non-Latin alphabets. \section{End} @@ -317,6 +317,6 @@ That's all for now! ## More on LaTeX -* The amazing LaTeX wikibook: [https://en.wikibooks.org/wiki/LaTeX](https://en.wikibooks.org/wiki/LaTeX) +* The amazing LaTeX Wikibook: [https://en.wikibooks.org/wiki/LaTeX](https://en.wikibooks.org/wiki/LaTeX) * An actual tutorial: [http://www.latex-tutorial.com/](http://www.latex-tutorial.com/) * A quick guide for learning LaTeX: [Learn LaTeX in 30 minutes](https://www.overleaf.com/learn/latex/Learn_LaTeX_in_30_minutes) -- cgit v1.2.3