New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: TeX Live to CommonMark #105270
Merged
Merged
doc: TeX Live to CommonMark #105270
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6a82db5
converted texlive doc to markdown
lucasew a858fcd
Remove frontmatter (suggestion)
lucasew 62cefa1
Add anchor (suggestion)
lucasew f335f6c
apply suggestions from @ryantm
lucasew 9be173f
fix nesting of codeblocks into list items as suggested by @jtojnar
lucasew 52bac64
add anchors for subtopics as said by @jtojnar
lucasew File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
|
||
# TeX Live {#sec-language-texlive} | ||
|
||
Since release 15.09 there is a new TeX Live packaging that lives entirely under attribute `texlive`. | ||
|
||
## User's guide {#sec-language-texlive-user-guide} | ||
|
||
- For basic usage just pull `texlive.combined.scheme-basic` for an environment with basic LaTeX support. | ||
- It typically won't work to use separately installed packages together. Instead, you can build a custom set of packages like this: | ||
|
||
```nix | ||
texlive.combine { | ||
inherit (texlive) scheme-small collection-langkorean algorithms cm-super; | ||
} | ||
``` | ||
|
||
- There are all the schemes, collections and a few thousand packages, as defined upstream (perhaps with tiny differences). | ||
- By default you only get executables and files needed during runtime, and a little documentation for the core packages. To change that, you need to add `pkgFilter` function to `combine`. | ||
|
||
```nix | ||
texlive.combine { | ||
# inherit (texlive) whatever-you-want; | ||
pkgFilter = pkg: | ||
pkg.tlType == "run" || pkg.tlType == "bin" || pkg.pname == "cm-super"; | ||
# elem tlType [ "run" "bin" "doc" "source" ] | ||
# there are also other attributes: version, name | ||
} | ||
``` | ||
|
||
- You can list packages e.g. by `nix repl`. | ||
|
||
```ShellSession | ||
$ nix repl | ||
nix-repl> :l <nixpkgs> | ||
nix-repl> texlive.collection-[TAB] | ||
``` | ||
|
||
- Note that the wrapper assumes that the result has a chance to be useful. For example, the core executables should be present, as well as some core data files. The supported way of ensuring this is by including some scheme, for example `scheme-basic`, into the combination. | ||
|
||
## Custom packages {#sec-language-texlive-custom-packages} | ||
|
||
|
||
You may find that you need to use an external TeX package. A derivation for such package has to provide contents of the "texmf" directory in its output and provide the `tlType` attribute. Here is a (very verbose) example: | ||
|
||
```nix | ||
with import <nixpkgs> {}; | ||
|
||
let | ||
foiltex_run = stdenvNoCC.mkDerivation { | ||
pname = "latex-foiltex"; | ||
version = "2.1.4b"; | ||
passthru.tlType = "run"; | ||
|
||
srcs = [ | ||
(fetchurl { | ||
url = "http://mirrors.ctan.org/macros/latex/contrib/foiltex/foiltex.dtx"; | ||
sha256 = "07frz0krpz7kkcwlayrwrj2a2pixmv0icbngyw92srp9fp23cqpz"; | ||
}) | ||
(fetchurl { | ||
url = "http://mirrors.ctan.org/macros/latex/contrib/foiltex/foiltex.ins"; | ||
sha256 = "09wkyidxk3n3zvqxfs61wlypmbhi1pxmjdi1kns9n2ky8ykbff99"; | ||
}) | ||
]; | ||
|
||
unpackPhase = '' | ||
runHook preUnpack | ||
|
||
for _src in $srcs; do | ||
cp "$_src" $(stripHash "$_src") | ||
done | ||
|
||
runHook postUnpack | ||
''; | ||
|
||
nativeBuildInputs = [ texlive.combined.scheme-small ]; | ||
|
||
dontConfigure = true; | ||
|
||
buildPhase = '' | ||
runHook preBuild | ||
|
||
# Generate the style files | ||
latex foiltex.ins | ||
|
||
runHook postBuild | ||
''; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
|
||
path="$out/tex/latex/foiltex" | ||
mkdir -p "$path" | ||
cp *.{cls,def,clo} "$path/" | ||
|
||
runHook postInstall | ||
''; | ||
|
||
meta = with lib; { | ||
description = "A LaTeX2e class for overhead transparencies"; | ||
license = licenses.unfreeRedistributable; | ||
maintainers = with maintainers; [ veprbl ]; | ||
platforms = platforms.all; | ||
}; | ||
}; | ||
foiltex = { pkgs = [ foiltex_run ]; }; | ||
|
||
latex_with_foiltex = texlive.combine { | ||
inherit (texlive) scheme-small; | ||
inherit foiltex; | ||
}; | ||
in | ||
runCommand "test.pdf" { | ||
nativeBuildInputs = [ latex_with_foiltex ]; | ||
} '' | ||
cat >test.tex <<EOF | ||
\documentclass{foils} | ||
|
||
\title{Presentation title} | ||
\date{} | ||
|
||
\begin{document} | ||
\maketitle | ||
\end{document} | ||
EOF | ||
pdflatex test.tex | ||
cp test.pdf $out | ||
'' | ||
``` |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, we had a tab key symbol here (though it does not seem to be properly styled in the current stylesheet). Not sure if we should try to add it.
Otherwise, the diff looks fine and should be ready to merge after squash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that [TAB] is an improvement over that obscure character.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is not the textual representation but rather the graphical one. Compare
with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, it looks a lot better with that styling.