Timeline for Draw the national flag of France
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 18, 2021 at 10:05 | comment | added | Emil Jeřábek |
Oh, and a 108 byte version using dirty tricks: \input color\def~#1!{\color[rgb]{#1}\rule{4cm}{8cm}}\shipout\hbox{~0,.33,.64!~1,1,1!~.94,.25,.21!}\batchmode . Here, the \end command is omitted entirely; this leads to an error, but the \batchmode silences it and allows the job to finish. In fact, if you are running LaTeX in an IDE rather than from a terminal, chances are it may have already set \batchmode from the command line, in which case it may be omitted, too.
|
|
May 18, 2021 at 9:25 | comment | added | Emil Jeřábek |
If you bypass LaTeX’s output routine and just ship a box containing the flag, you don’t need any of the usual nonsense like \documentclass and \begin/\end{document} . (This also neatly gets rid of the unwanted “Page 1”.) On an unrelated note, the outer brackets inside the definition of the macro are unnecessary. So all in all, here is a 116 byte version: \input color\catcode`@11\def~#1!{\color[rgb]{#1}\rule{4cm}{8cm}}\shipout\hbox{~0,.33,.64!~1,1,1!~.94,.25,.21!}\@@end . (Here, \@@end is LaTeX’s renaming of the primitive TeX command \end . The \catcode change is to make it work.)
|
|
May 18, 2021 at 9:10 | comment | added | Emil Jeřábek |
You can save 4 bytes by using the active character ~ in place of \z .
|
|
Nov 23, 2015 at 8:12 | history | edited | Fatalize | CC BY-SA 3.0 |
added 25 characters in body
|
Nov 20, 2015 at 21:55 | comment | added | wchargin |
For completeness, revised version (139 bytes): \documentclass{proc}\input color\begin{document}\def\z#1!{{\color[rgb]{#1}\rule{4cm}{8cm}}}\z0,.33,.64!\z1,1,1!\z.94,.25,.21!\end{document}
|
|
Nov 20, 2015 at 21:54 | comment | added | wchargin |
You can also \input color
|
|
Nov 20, 2015 at 21:54 | comment | added | wchargin |
s.\newcommand\z[1].\def\z#1 to save a bunch of bytes. Also, you can shave off a few by using \def\z#1!{…}\z0,.33,.64!\z1,1,1!\z.94,.25,.21! —that is, use your own delimiters instead of braces for grouping
|
|
Nov 18, 2015 at 13:09 | comment | added | Arcturus |
Well this is about 100 bytes shorter than my asymptote solution...
|
|
Nov 18, 2015 at 8:26 | history | answered | Fatalize | CC BY-SA 3.0 |