38
votes
Accepted
Holiday present-ation vs. content contest
A duck is running away from becoming a Christmas roast while jumping along the lines to help with the carol singing. Luckily it ran fast enough and is meeting all his friends on the last slide.
\...
21
votes
Accepted
Where can I find the article.cls class file of texlive-2016 on my pc?
The easiest way to find any file in the TeX Distribution (if you know its name) is to use the kpsewhich program.
From the command line type:
kpsewhich article.cls
and it should return:
/usr/local/...
19
votes
Holiday present-ation vs. content contest
Surely my entry is not so impressive, but it has been a useful exercise (my first LaTeX class!).
Quite pleased that the overflowing word acts perfectly as tree topper.
\NeedsTeXFormat{LaTeX2e}
\...
15
votes
Holiday present-ation vs. content contest
Here is happyholidays.cls. EDITED, per OP request, to make punctuation following "falalalala" colored, which I accomplished by making \Falala take a mandatory argument, namely, the closing punctuation....
14
votes
Accepted
What happens when a package patches another, and then the original one is reloaded?
Packages are never reloaded (to the exception of fontenc, which is rather special). The code in \usepackage ensures that a package is loaded only once, and any further attempt to load it again is ...
13
votes
Holiday present-ation vs. content contest
\LoadClass{article}\advance\textwidth3cm\advance\oddsidemargin-1.5cm\advance\textheight2cm
\def\Y{Yule - tide \ \ car - ol!}\def\L{ \ \ la}\usepackage{tikz}\definecolor{cc}{RGB}{102
,33,18}\pagestyle{...
13
votes
Accepted
how does '\maketitle' work?
Let's assume you're basing your document class on the article document class. The following definition of \maketitle applies if the titlepage document class option was not set:
\newcommand\maketitle{\...
11
votes
Holiday present-ation vs. content contest
This answer is a little involved. Historical assertions are based on Wikipedia. I have not checked the original sources. As such, historical claims are provided as is with no warranty or guarantee to ...
11
votes
Accepted
Best practice for dtx workflow
Whilst one can handle .dtx sources 'by hand', I think it's best to think of code set up in this way like other source-program relationship: there is a build process. This is really independent of ...
10
votes
Avoid spurious warnings in a parasitic class with key-value options (LaTeX3 \DeclareKeys)
You are mixing two option systems and that confuses the setting of the unused lists handling as for every system a different option is "unknown" and so unused.
Stick to one system (that one ...
9
votes
Accepted
Command for nulifying spaces (String.trim()) in latex
You can use the trimspaces package for this purpose.
Simple examples
\documentclass{article}
\usepackage{trimspaces}
\makeatletter
\newcommand*{\trim}[1]{%
\trim@spaces@noexp{#1}%
}
\makeatother
...
8
votes
Accepted
What command should supersede \DeclareRobustCommand?
The engine-robust command set \NewDocumentCommand, etc., are now the recommended method for creating document commands. These are documented in usrguide.
8
votes
Accepted
\DocumentMetadata in class file?
No you can't. There are some technical reasons (we must ensure that the PDF management code is loaded early and in the right order, and some settings like the PDF version should be done as early as ...
7
votes
Accepted
Add bibliography to toc with KOMA-Script
If you use biblatex together with the KOMA classes it is actually biblatex who is responsible for the format of the heading in your bibliography and not the KOMA class.
Confer also the warning in the ...
7
votes
Accepted
LaTeX(2e) Programming vs. expl3 (which to learn)
Although I think that the question is quite broad, I try to answer it with the focus on package and class writing. I will use shortened versions of your questions:
Is it worth to learn the stable ...
7
votes
Accepted
Does multiple \AtBeginDocument calls execute code in the appearing order
With the hook management system \AtBeginDocument is an alias fro \AddToHook{begindocument} and all entries with the same label (defaulting to toplevel or your class name in this case) are executed ...
6
votes
Accepted
Class: Definition of an empty variable: etoolbox: problems of comparison
\global\def\prez%
\DeclareOption{prezE}
defines \prez so it has to be followed by \DeclareOption and expands to prezE
I guess you intended
\global\def\prez{}%
\DeclareOption{prezE}
to define \prez ...
6
votes
Holiday present-ation vs. content contest
Continued due to SE's size limits.
% !TEX encoding = UTF-8 Unicode
% happyholidays.cls
\NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX)
[1994/12/01]% LaTeX date must December 1994 ...
6
votes
What is the equivalent of `\space` command in em value in TeX?
\space is defined by
\def\space{ }
so it adds a space token not glue.
When typesetting horizontal space as determined by fontdimens and \spacefactor and \xpacefactor will be added just as for a ...
6
votes
Hyperref doesn't highlight cites
Well at least I'm not alone. See this discussion here https://github.com/plk/biblatex/issues/585.
You can use the commands mentioned in the discussion:
\begin{filecontents}{testclass.cls}
\...
6
votes
Accepted
use beamer auctex'hooks with class file derived from beamer
Using M-x TeX-auto-generate in the simplest way
The simplest way is, I think:
Inside Emacs, in a buffer using AUCTeX, do C-h v TeX-auto-private and create the directory corresponding to the variable'...
6
votes
Accepted
When and how are commands in the argument of \AtBeginDocument evaluated?
Tokens added using \AtBeginDocument appear in exactly the order they are added, which is why reordering the preamble makes a difference. From the latest LaTeX release (2020-10-01) there is a new hook ...
6
votes
Accepted
Writing a class file from scratch and getting "Missing \begin{document}" error
If you look at the definition of \normalsize you have:
$ latexdef normalsize
\normalsize:
macro:->\protect \normalsize
\normalsize :
\long macro:->...
6
votes
Avoid spurious warnings in a parasitic class with key-value options (LaTeX3 \DeclareKeys)
The problem seems to be using \ProcessKeyOptions and \ProcessOptions. Instead, I would use:
\begin{filecontents}[overwrite]{\jobname.cls}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{\jobname}
\DeclareKeys[...
6
votes
Accepted
Why do I get "unused global options warning" for options forwarded to a package except for the first option?
This is a bug handling the option lists in the new l3keys based option handler. You can avoid the spurious warning by ensuring there is no excess white space between the options, so
\documentclass[...
6
votes
Accepted
Why \IfPackageAtLeastTF{⟨package⟩}{⟨date⟩}{\PassOptionsToPackage{⟨option⟩}{⟨package⟩}}{} doesn't pass ⟨option⟩ to ⟨package⟩?
LaTeX only knows the version of a package (or class) once it is loaded. Before that the conditional used by \IfPackageAtLeastTF... returns false. Hence the fourth argument of
\IfPackageAtLeastTF{...
5
votes
Accepted
Biblatex produces incomplete .bcf with biber backend
The issue is ltxgrid, or rather the ltxutil package it loads: you can see this with
\documentclass{article}
\usepackage{etoolbox}
\usepackage{ltxgrid}
\usepackage{biblatex}
\addbibresource{minimal....
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
documentclass-writing × 483document-classes × 79
package-writing × 74
class-options × 65
macros × 46
expl3 × 22
sectioning × 19
templates × 17
packages × 16
koma-script × 15
errors × 14
environments × 14
titles × 13
babel × 13
package-options × 13
header-footer × 11
tables × 10
table-of-contents × 10
conditionals × 10
best-practices × 10
kvoptions × 10
biblatex × 9
margins × 9
fancyhdr × 9
latex3 × 9