I am using the tikz-timing
package to create a timeline since chronosys
and chronology
wouldn't cooperate and were too limited and archaic-looking to suit my purposes, and moderntimeline
unfortunately was unable to display in a horizontal linear format. (The timeline I'm trying to create is rather complex, and the timeline package selection is extremely limited.)
Everything is working fairly nicely, considering that I have just recently taken up LaTeX (after some limited experience with Lilypond) to create this timeline, except for the fact that typing [white, timing/D/background/.style={fill=orange}]
takes up a ridiculous amount of space (and time), which is very inconvenient and makes the code look super messy.
I've tried using \newcommand
(I've heard \def
is basically just an inferior version of it), but so far the compiler doesn't like me using it that way because I'm not defining an actual command, just a substitution.
What I had originally was
\newcommand{\efill}[1]{timing/D/background/.style={fill=#1}}
thinking this would allow me to type [\efill {blue}]
to set the fill to blue. Since this was an abbreviation and not a command, it didn't work the way I had intended it to.
The ideal solution would allow the definition of character-to-color synonyms (so instead of typing the whole color name, I could just type the single-character name), and the definition of a custom enclosure notation (eg {{ob}}
would expand during compilation to [orange, timing/D/background/.style={fill=blue}]
.
How can I achieve this?
Here is my newbie attempt at an MWE:
\documentclass{article} \usepackage{tikz, tikz-timing} \begin{document} \Huge \begin{tikztimingtable} {\LARGE{Benjy}} & [blue, timing/D/background/.style={fill=none}]DDDD;[orange,timing/D/background/.style={fill=green}]DDDD \\ \begin{extracode} \tableheader {\begin{Large}Character\end{Large}} {\begin{LARGE}\textbf{Events}\end{LARGE}} \tablerules \fulltablegrid \end{extracode} \end{tikztimingtable} \end{document}
I'm not sure if I tagged this correctly, so feel free to add/remove tags.
\efill blue
will recognize only the "b
" as the argument of\efill
. before giving up, try\efill{blue}
to include the whole word in the argument.\LARGE
like{\LARGE <text>}
: they are switches, not commands that take arguments. And you are likely to run into problems if you jam all kinds of different fontsize declarations (or 'switches') in the same paragraph.