Skip to content

add onlyPreamble checks for \documentclass and \documentstyle#839

Merged
brucemiller merged 1 commit into
brucemiller:masterfrom
dginev:only-preamble-documentclass
May 27, 2017
Merged

add onlyPreamble checks for \documentclass and \documentstyle#839
brucemiller merged 1 commit into
brucemiller:masterfrom
dginev:only-preamble-documentclass

Conversation

@dginev
Copy link
Copy Markdown
Collaborator

@dginev dginev commented May 22, 2017

Add onlyPreamble guards for class-selection LaTeX macros. The absence of these errors became apparent during an Authorea debugging session, so I'm contributing them back upstream.

The goal is that given input such as:

\documentclass[11pt,letter]{article}


\begin{document}

\documentclass[letterpaper,10pt]{article}
...
\end{document}

We would like LaTeXML to report a preamble violation error as in:

Error:unexpected:\documentclass The current command '\documentclass' can only appear in the preamble

This is all setup already for usepackage, so just leveraging that infrastructure in this PR.

Bonus: My sublime editing environment removes trailing whitespace (that is actually a tiny speedup for RawTeX I believe)

@brucemiller brucemiller merged commit ee39d4f into brucemiller:master May 27, 2017
@brucemiller
Copy link
Copy Markdown
Owner

Thanks!

@dginev dginev deleted the only-preamble-documentclass branch February 25, 2018 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants