Created
April 28, 2015 00:29
-
-
Save tueda/720d4783321fea5e1ce6 to your computer and use it in GitHub Desktop.
An example of LaTeX file, which can be typeset both as a standalone file and a source that can be included by another file via \input.
This file contains hidden or 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
| \makeatletter | |
| \newif\ifStandalone | |
| \ifx\documentclass\@twoclasseserror | |
| \Standalonefalse | |
| \else | |
| \Standalonetrue | |
| \fi | |
| \makeatother | |
| \ifStandalone | |
| \documentclass{article} | |
| \pagestyle{empty} | |
| \begin{document} | |
| \fi | |
| % | |
| \setlength\unitlength{1cm} | |
| \fbox{% | |
| \begin{picture}(2,2) | |
| \put(0,0){\line(1,0){2}} | |
| \end{picture}% | |
| }% | |
| % | |
| \ifStandalone | |
| \end{document} | |
| \fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment