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

add onlyPreamble checks for \documentclass and \documentstyle #839

Merged
merged 1 commit into from May 27, 2017

Conversation

@dginev
Copy link
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
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@brucemiller
Copy link
Owner

@brucemiller brucemiller commented May 27, 2017

Thanks!

@dginev dginev deleted the dginev:only-preamble-documentclass branch Feb 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants