Code Monkey home page Code Monkey logo

latex-examples's Introduction

LaTeX examples

User Interface

  • \begin{example}[tcb options]{title}, code followed by output, numbered
  • \begin{example*}[tcb options]{title}, unnumbered variant

Typical configured usage

  • side by side, \begin{example}[sidebyside]{title}
  • change code language, \begin{example}[minted options app={language=python}]{title}

Internals

  • direct dependencies:
    • tcolorbox, with libraries hooks, minted, skins and xparse loaded
    • accsupp
  • environments are based on tcolorbox's minted library, -shell-escape required
  • added
    • \emptyaccsupp
    • tcolorbox options example options and example title
  • modified
    • \theFancyVerbLine

User Interface

  • \printDef{csname}, print definition of \cs{csname}
  • \printAndRunCode{code}

Internals

  • direct dependencies:
    • fvextra
    • xcolor with no package options
  • added
    • \toString

User Interface

  • \pgfkeys{<key>/.patch={<search>}{<replace>}}
  • \pgfkeyspatchvalue{<key path>}{<search>}{<replace>}

Internals

  • direct dependency: xpatch

User Interface

  • after <key>/.store in=<macro> (or .estore in), handlers .get, .add, .prefix, and .append will act on <macro>, not the key itself

Internals

  • <macro> is stored in new subkey .@store, which will be cleared by .initial
  • for the above four handlers, .@store has higher precedence than the key itself (set by .initial)

User Interface

  • \autonameref{<label key>} and \autonameref*{<label key>}
  • 1-arg \HyRef@autonameref@style which controls the extra output style (see test file)

Internals

  • direct dependency: hyperref
  • \HyRef@autonameref and \HyRef@autonamesetref

User Interface

  • scope options auto mark and no auto mark
  • styles every auto mark and every auto <shape> mark that accept pin options
  • zero-arg macro \tikzAutoMarkText that controls the mark text
    • In the definition of the above styles and macro, \tikzNodeName and \tikzNodeShape can be used as placeholders of node name and shape, respectively.

Initial values

```tex
\tikzset{
  every auto mark/.style={
    font=\ttfamily, rotate=45,
    red, anchor=west, pin position=45,
  },
  every auto coordinate mark/.style={
    blue, anchor=east, pin position=180+45,
  },
}
\newcommand\tikzAutoMarkText{\tikzNodeName}
```

Internals

  • Every auto mark is a node pin drawn by
    \node also[pin={[every auto mark/.try, every auto <shape> mark/.try]{\tikzAutoMarkText}}] (\tikzNodeName);
    at the end of every tikzpicture.
    • maybe draw in execute at end path?
  • direct dependency: tikz and etoolbox (for \patchcmd)
  • tikz options used: execute at begin scope and execute at end picture
  • patched: \tikz@node@finish to append node info to \tikzNodeList
  • added:
    • \tikzNodeList, A comma-separated list of elements {<node_name>, <node_shape>}
    • \newif\iftikz@lib@automark@on

latex-examples's People

Contributors

muzimuzhi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.