Skip to content
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

LaTeX template: Render \subtitle #5213

Merged
merged 6 commits into from
Jan 11, 2019
Merged

LaTeX template: Render \subtitle #5213

merged 6 commits into from
Jan 11, 2019

Conversation

adunning
Copy link
Contributor

@adunning adunning commented Jan 10, 2019

This renders \subtitle without requiring a different document class such as scrartcl, using the titling package. This integrates the solution in the manual, which I believe was based on an example from Enrico Gregorio, https://tex.stackexchange.com/a/50186 but is simplified. The matter has come up several times (#4675, #3896, #1327 and on pandoc-discuss), so it seems worthwhile to include it by default even if requiring titling isn't ideal.

The blank command was added in 4ac59af to avoid problems with packages that define \subtitle. I've verified that this solution will not load with Beamer or KOMA (I was initially using a separate test for KOMA, but \providecommand is sufficient to stop titling from loading).

I'm not using a test for the presence of titling on the principle of providing an error rather than silently changing key aspects of the document's appearance, but there are some distributions that omit it (which was why I didn't add this code to the template earlier), so this could be added.

adunning and others added 4 commits January 10, 2019 18:31
This renders `\subtitle` without requiring a different document class such as `scrartcl`, using the `titling` package. Based on an example from Enrico Gregorio, <https://tex.stackexchange.com/a/50186>. The blank command was added in <4ac59af> to avoid problems with packages that define `\subtitle`. This solution will not load with either Beamer or KOMA; I've also verified that this does not affect Memoir's version of the command.

Addresses #4675, #3896, #1327.
@adunning
Copy link
Contributor Author

I thought of another method using etoolbox. This is part of collection-latexrecommended in TeX Live, so it should be in almost any distribution, whereas titling is in collection-latexextra (which BasicTeX doesn't install by default). I've confirmed this works with article, book, report, and memoir (KOMA remains unaffected).

Group subtitle elements to ensure proper spacing. Load `etoolbox` outside command definition, since putting it inside causes an error if `\title` is placed after `\begin{document}`; it's already loaded on LuaLaTeX/XeLaTeX in any case.
@jgm
Copy link
Owner

jgm commented Jan 11, 2019

I like this solution!

@jgm jgm merged commit fd222b8 into jgm:master Jan 11, 2019
@adunning adunning deleted the patch-1 branch January 11, 2019 20:08
@adunning
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants