0

How do I change the color from Yellow to say, gray. Also I don't like the rounded boxes, and the thick boundary. The package documentation doesn't clearly say what I must do either.

\documentclass{article}
\usepackage{prerex}

\begin{document}
\begin{chart}%\grid
            \reqhalfcourse 30,55:{}{Foundations\\of Physics}{}{Melon}
            \reqhalfcourse 10,45:{}{Functional\\Analysis}{}
            \reqhalfcourse -12,30:{}{Sheaf\\Theory}{}
            \reqhalfcourse -5,05:{}{Microlocal\\Sheaves}{}
            \reqhalfcourse 13,22:{}{Complex\\Analysis}{}
            \reqhalfcourse 20,30:{}{Operator\\Algebras}{}
            \reqhalfcourse 5,15:{}{Microlocal\\Analysis}{}
            \reqhalfcourse 40,40:{}{Operational\\Theories}{}
            \reqhalfcourse 20,00:{}{AQFT}{}
            \reqhalfcourse 40,27:{}{Quantum\\Foundations}{}
            \reqhalfcourse 58,27:{}{Evolution}{}
            \reqhalfcourse 58,18:{}{Thermodynamics}{}
            \reqhalfcourse 20,-20:{}{Quantum\\Gravity}{}
            
            \prereq 5,15,20,00:
            \prereq 10,45,20,30:
            \prereq 10,45,5,15:
            \prereqc 13,22,20,00:
            \prereqc -12,30,-5,05:
            \prereq -5,05,20,00:
            \prereq 58,18,58,27:
            \prereq 20,30,20,00: 
            \prereqc 20,00,20,-20;0:
            \prereqc 58,18,20,-20;0:
            \prereqc 58,27,20,-20;0:
            
            \coreq 13,22,40,40:
            \coreq 30,55,58,18:
            \coreq 20,30,40,27: 
            \coreq 30,55,20,00:
            \coreq 30,55,40,27:
            \coreq 40,27,20,00:
            \coreq 40,27,58,27:
            
            
            \coreq 40,40,40,27: 
            \coreq 40,40,20,00: 
            
            \begin{pgfonlayer}{courses}
                \draw[dashed] ([shift={(-2mm,-1mm)}]x40y27.south west) rectangle ([shift={(1mm,2mm)}]x58y27.north east);
            \end{pgfonlayer}
        \end{chart}
\end{document}

The result is:

enter image description here

1
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Aug 3 at 21:04

1 Answer 1

2

The package prerex uses different approaches to set the default appearance of the nodes. Some values are stored in variables that you cound redefine (such as \background for the background color which is set to yellow!15 by default, or different line widths), but other things, such as the border radius, are more or less hard coded.

The most straight-forward and yet highly customizable approach would be to place the nodes inside the chart environment inside a scope and redefine the appearance of the nodes using regular TikZ style options like this:

\documentclass{article}
\usepackage{prerex}

\begin{document}

\begin{chart}%\grid
    \begin{scope}[every rectangle node/.style={
        sharp corners,
        line width=0.6pt,
        fill=gray!15
    }]
        \reqhalfcourse 30,55:{}{Foundations\\of Physics}{}{Melon}
        \reqhalfcourse 10,45:{}{Functional\\Analysis}{}
        \reqhalfcourse -12,30:{}{Sheaf\\Theory}{}
        \reqhalfcourse -5,05:{}{Microlocal\\Sheaves}{}
        \reqhalfcourse 13,22:{}{Complex\\Analysis}{}
        \reqhalfcourse 20,30:{}{Operator\\Algebras}{}
        \reqhalfcourse 5,15:{}{Microlocal\\Analysis}{}
        \reqhalfcourse 40,40:{}{Operational\\Theories}{}
        \reqhalfcourse 20,00:{}{AQFT}{}
        \reqhalfcourse 40,27:{}{Quantum\\Foundations}{}
        \reqhalfcourse 58,27:{}{Evolution}{}
        \reqhalfcourse 58,18:{}{Thermodynamics}{}
        \reqhalfcourse 20,-20:{}{Quantum\\Gravity}{}
    \end{scope}
    
    \prereq 5,15,20,00:
    \prereq 10,45,20,30:
    \prereq 10,45,5,15:
    \prereqc 13,22,20,00:
    \prereqc -12,30,-5,05:
    \prereq -5,05,20,00:
    \prereq 58,18,58,27:
    \prereq 20,30,20,00: 
    \prereqc 20,00,20,-20;0:
    \prereqc 58,18,20,-20;0:
    \prereqc 58,27,20,-20;0:
    
    \coreq 13,22,40,40:
    \coreq 30,55,58,18:
    \coreq 20,30,40,27: 
    \coreq 30,55,20,00:
    \coreq 30,55,40,27:
    \coreq 40,27,20,00:
    \coreq 40,27,58,27:
    
    
    \coreq 40,40,40,27: 
    \coreq 40,40,20,00: 
    
    \begin{pgfonlayer}{courses}
        \draw[dashed] ([shift={(-2mm,-1mm)}]x40y27.south west) rectangle ([shift={(1mm,2mm)}]x58y27.north east);
    \end{pgfonlayer}
\end{chart}

\end{document}

enter image description here

1
  • Damn! This is exactly like I wanted. Thanks a lot!
    – MrPajeet
    Aug 4 at 2:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.