Ununsed LaTeX tweaks

Quotes and Quotations

built-in quoting feature are

\quote{}
\quotation{}

the csquotes package goes with babel

\usepackage{csquotes}

\begin{displayquote}
quote here
\end{displayquote}

–or–

\usepackage{dirtytalk}

\say{quote here}

Code blocks & inline code

\usepackage{xcolor,listings}
\definecolor{mygray}{gray}{0.94}
\lstset{
    backgroundcolor=\color{mygray},
    xleftmargin=0.5in,
    breaklines=true,
    tabsize=8,
}

    %xrightmargin=.25in,

here’s a MWE with a code blocks and inline code

xelatex codeblock.tex # create aux
xelatex codeblock.tex
    rm -f codeblock.tex
    rm -f codeblock.aux codeblock.log codeblock.toc
evince codeblock.pdf &

Resources

quotes & quotation

csquotes – Context sensitive quotation facilities https://ctan.org/pkg/csquotes/

Directory macros/latex/contrib/dirtytalk https://ctan.org/tex-archive/macros/latex/contrib/dirtytalk

Typesetting quotations https://www.sharelatex.com/learn/Typesetting_quotations

code blocks

LaTeX/Source Code Listings https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings

listings – Typeset source code listings using LATEX https://ctan.org/pkg/listings?lang=en

Code listing https://www.overleaf.com/learn/latex/Code_listing

How can Listings ignore (some) indentations? https://tex.stackexchange.com/questions/304991/how-can-listings-ignore-some-indentations/304994

Indent a code listing in LaTeX https://tex.stackexchange.com/questions/10828/indent-a-code-listing-in-latex

colors

XCOLOR https://steeven9.github.io/USI-LaTeX/html/packages_hyperref_babel_xcolor3.html

Using colours in LaTeX https://www.overleaf.com/learn/latex/Using_colours_in_LaTeX

X11 Color Names https://www.cssportal.com/html-colors/x11-colors.php

Shades of gray https://en.wikipedia.org/wiki/X11_color_names#Shades_of_gray

Pandoc: Markdown to PDF, without cutting off code block lines that are too long https://tex.stackexchange.com/questions/179926/pandoc-markdown-to-pdf-without-cutting-off-code-block-lines-that-are-too-long/412316#412316

fvextra – Extensions and patches for fancyvrb https://ctan.org/pkg/fvextra

inline code

Colored background in inline listings https://newbedev.com/colored-background-in-inline-listings

Adding background color to \verb or \lstinline command without \Colorbox https://tex.stackexchange.com/questions/357227/adding-background-color-to-verb-or-lstinline-command-without-colorbox

Insert inline code block in Latex document https://stackoverflow.com/questions/66192685/insert-inline-code-block-in-latex-document

lstinline command for inline text code changing the style of all the following text in the latex document https://tex.stackexchange.com/questions/536192/lstinline-command-for-inline-text-code-changing-the-style-of-all-the-following-t

insert code keywords inline https://tex.stackexchange.com/questions/286094/insert-code-keywords-inline


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun