### Create a basic Gantt chart Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt A complete document example showing the ganttchart environment with titles, bars, milestones, and links. ```latex \documentclass{article} \usepackage{pgfgantt} \begin{document} \begin{ganttchart}[ hgrid, vgrid, x unit=0.5cm, y unit title=0.6cm, y unit chart=0.8cm ]{1}{12} \gantttitle{2024 Project Timeline}{12} \\ \gantttitlelist{1,...,12}{1} \\ \ganttgroup{Phase 1}{1}{7} \\ \ganttbar{Research}{1}{3} \\ \ganttbar{Development}{4}{7} \\ \ganttmilestone{Review}{7} \\ \ganttgroup{Phase 2}{8}{12} \\ \ganttbar{Testing}{8}{10} \\ \ganttbar{Deployment}{11}{12} \ganttlink{elem1}{elem2} \ganttlink{elem2}{elem3} \end{ganttchart} \end{document} ``` -------------------------------- ### ganttchart Environment Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt The primary environment for defining a Gantt chart, requiring start and end time slots. ```APIDOC ## ganttchart Environment ### Description The main environment for creating Gantt charts. It accepts two mandatory arguments specifying the start and end time slots, plus optional styling parameters. ### Parameters #### Path Parameters - **start_slot** (integer/date) - Required - The starting time slot of the chart. - **end_slot** (integer/date) - Required - The ending time slot of the chart. ### Request Example \begin{ganttchart}[hgrid, vgrid]{1}{12} \gantttitle{Project}{12} \\ \ganttbar{Task}{1}{5} \end{ganttchart} ``` -------------------------------- ### Define Custom Gantt Chart Time Slot Formats Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Allows defining custom time slot formats for specialized date requirements beyond built-in options. Example shows a 'day of year' format. ```latex % Define a "day of year" format (year.dayofyear) \newgantttimeslotformat{dayofyear}{\def\decompose##1.##2\relax{\def\theyear{##1}\def\theday{##2}} \decompose#1\relax% \pgfcalendardatetojulian{\theyear-01-01}{#2}% \advance#2 by-1\relax% \advance#2 by\theday\relax% } \begin{ganttchart}[ hgrid, vgrid, time slot format=dayofyear ]{2024.1}{2024.31} \gantttitlecalendar{month=name, day} \\ \ganttbar{January Tasks}{2024.5}{2024.25} \end{ganttchart} ``` -------------------------------- ### Use Linked Commands for Sequential Tasks Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Simplifies creating sequential tasks by automatically linking them. Use `ganttlinkedbar`, `ganttlinkedgroup`, and `ganttlinkedmilestone`. ```latex \begin{ganttchart}[vgrid, hgrid]{1}{20} \gantttitlelist{1,...,20}{1} \\ % First task (no link) \ganttbar{Kickoff}{1}{2} \\ % Automatically linked sequence \ganttlinkedbar{Planning}{3}{5} \\ \ganttlinkedbar{Design}{6}{8} \\ \ganttlinkedmilestone{Design Review}{8} \\ \ganttlinkedbar{Implementation}{9}{14} \\ \ganttlinkedbar{Testing}{15}{18} \\ \ganttlinkedmilestone{Release}{20} \end{ganttchart} ``` -------------------------------- ### Add task bars Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Shows basic task bars, custom styling, progress indicators, and empty labels. ```latex \begin{ganttchart}[ vgrid, hgrid, bar/.append style={fill=blue!30}, bar height=0.5, bar top shift=0.25 ]{1}{12} \gantttitlelist{1,...,12}{1} \\ % Basic bar with label \ganttbar{Task 1}{1}{4} \\ % Bar with custom styling \ganttbar[ bar/.append style={fill=green!50, rounded corners=3pt}, bar label font=\bfseries\color{darkgreen} ]{Task 2}{5}{9} \\ % Bar with progress indicator \ganttbar[progress=60]{Task 3}{3}{10} \\ % Empty label bar \ganttbar{}{10}{12} \end{ganttchart} ``` -------------------------------- ### Add Today Marker and Vertical Rules Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Use the today key for date markers and the ganttvrule command for custom vertical reference lines. ```latex \begin{ganttchart}[ vgrid, hgrid, % Today marker today=5, today offset=0.5, today label=Today, today label font=\itshape\color{blue}, today rule/.style={draw=blue, ultra thick, dashed} ]{1}{12} \gantttitlelist{1,...,12}{1} \\ \ganttbar{Task 1}{1}{4} \\ \ganttbar{Task 2}{3}{8} \\ \ganttbar{Task 3}{7}{12} % Custom vertical rules for deadlines \ganttvrule{Deadline 1}{4} \ganttvrule[ vrule/.style={draw=red, thick}, vrule label font=\bfseries\color{red} ]{Final Deadline}{10} \end{ganttchart} ``` -------------------------------- ### Apply Global Configuration with ganttset Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Use ganttset to define consistent styles globally or override them within specific chart scopes. ```latex % Global configuration \ganttset{ hgrid, vgrid, x unit=0.5cm, bar/.append style={fill=blue!30, rounded corners=2pt}, group/.append style={fill=orange!50}, milestone/.append style={fill=red!70}, link/.style={-latex, thick} } \begin{ganttchart}{1}{12} \gantttitlelist{1,...,12}{1} \\ \ganttgroup{Project}{1}{12} \\ \ganttbar{Task 1}{1}{4} \\ \ganttlinkedbar{Task 2}{5}{8} \\ \ganttlinkedmilestone{Done}{10} \end{ganttchart} % Override locally \begin{ganttchart}[bar/.append style={fill=green!30}]{1}{6} \gantttitlelist{1,...,6}{1} \\ \ganttbar{Different Style}{1}{4} \end{ganttchart} ``` -------------------------------- ### Sequential Element Commands Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Convenience commands that create elements and automatically draw a link from the previous element. ```APIDOC ## \ganttlinkedbar, \ganttlinkedgroup, \ganttlinkedmilestone ### Description Convenience commands that create elements and automatically draw a link from the previous element, reducing code verbosity for sequential tasks. ### Request Example \ganttlinkedbar{Planning}{3}{5} ``` -------------------------------- ### Create group elements Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Groups tasks into phases or categories using the \ganttgroup command. ```latex \begin{ganttchart}[ vgrid, hgrid, group/.append style={fill=orange!60}, group peaks height=0.3, group peaks tip position=0.5 ]{1}{16} \gantttitlelist{1,...,16}{1} \\ % Main project group \ganttgroup{Project Alpha}{1}{16} \\ % Phase groups with subtasks \ganttgroup{Phase 1: Planning}{1}{5} \\ \ganttbar{Requirements}{1}{3} \\ \ganttbar{Design}{3}{5} \\ \ganttgroup{Phase 2: Development}{6}{12} \\ \ganttbar{Backend}{6}{9} \\ \ganttbar{Frontend}{8}{12} \\ \ganttgroup{Phase 3: Release}{13}{16} \\ \ganttbar{Testing}{13}{15} \\ \ganttbar{Deploy}{15}{16} \end{ganttchart} ``` -------------------------------- ### Create Custom Link Types Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Define custom link drawing paths using newganttlinktype and coordinate macros like xLeft and yUpper. ```latex \usetikzlibrary{decorations.pathmorphing} % Define a wavy link type \newganttlinktype{wavy}{ \ganttsetstartanchor{on right=0.5} \ganttsetendanchor{on left=0.5} \draw [decorate, decoration={snake, amplitude=2pt, segment length=8pt}, thick, -latex, blue] (\xLeft, \yUpper) -- (\xRight, \yLower); } % Define a down-right-up link \newganttlinktype{dru}{ \ganttsetstartanchor{on bottom} \ganttsetendanchor{on left} \draw [/pgfgantt/link] (\xLeft, \yUpper) -- (\xLeft, \yLower) -- (\xRight, \yLower); } \begin{ganttchart}[vgrid, hgrid]{1}{12} \gantttitlelist{1,...,12}{1} \\ \ganttbar{Task 1}{1}{3} \\ \ganttbar{Task 2}{5}{8} \\ \ganttbar{Task 3}{6}{10} \ganttlink[link type=wavy]{elem0}{elem1} \ganttlink[link type=dru]{elem1}{elem2} \end{ganttchart} ``` -------------------------------- ### Create Gantt Chart Milestones Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Defines milestone markers for significant project events. Customize milestone appearance using styles. ```latex \begin{ganttchart}[ vgrid, hgrid, milestone/.append style={fill=red}, milestone label font=\bfseries\itshape ]{1}{12} \gantttitlelist{1,...,12}{1} \\ \ganttbar{Development}{1}{5} \\ \ganttmilestone{Alpha Release}{5} \\ \ganttbar{Testing}{6}{9} \\ \ganttmilestone{Beta Release}{9} \\ \ganttbar{Final QA}{10}{11} \\ \ganttmilestone[ milestone/.append style={fill=green!70!black} ]{Production Release}{12} \end{ganttchart} ``` -------------------------------- ### Define chart titles Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Demonstrates using \gantttitle for single spans and \gantttitlelist for generating multiple title elements from lists. ```latex \begin{ganttchart}[hgrid, vgrid]{1}{12} % Single title spanning all 12 time slots \gantttitle{Year 2024}{12} \\ % Generate 12 individual title elements (months) \gantttitlelist{Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec}{1} \\ % Numeric list using pgffor syntax \gantttitlelist{1,...,12}{1} \\ \ganttbar{Task}{1}{6} \end{ganttchart} ``` -------------------------------- ### Track Progress in Gantt Charts Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Displays task completion status using the `progress` key. Supports fixed percentages or automatic calculation based on the `today` marker. ```latex \begin{ganttchart}[ vgrid, hgrid, today=6, today label=Current, today rule/.style={draw=red, thick, dashed}, bar/.append style={fill=green!50}, bar incomplete/.append style={fill=red!30}, progress label text={\pgfmathprintnumber[precision=0]{#1}\%} ]{1}{12} \gantttitlelist{1,...,12}{1} \\ % Fixed progress values \ganttbar[progress=100]{Completed}{1}{3} \\ \ganttbar[progress=50]{Half Done}{2}{6} \\ \ganttbar[progress=0]{Not Started}{7}{10} \\ % Automatic progress based on today marker \ganttbar[progress=today]{Auto Progress}{1}{10} \\ \ganttgroup[progress=45]{Overall}{1}{12} \end{ganttchart} ``` -------------------------------- ### \ganttlink Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Creates visual connections between chart elements to show dependencies. ```APIDOC ## \ganttlink ### Description Creates visual connections between chart elements to show dependencies. Supports automatic routing, straight links (s-s, s-f, f-s, f-f), and custom link types. ### Request Example \ganttlink[link type=s-s]{task2}{task3} ``` -------------------------------- ### Define Gantt Chart Links and Dependencies Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Establishes visual connections between chart elements to represent task dependencies. Supports various link types and custom styling. ```latex \begin{ganttchart}[ vgrid, hgrid, link/.style={-latex, rounded corners=2pt, thick} ]{1}{16} \gantttitlelist{1,...,16}{1} \\ \ganttbar[name=task1]{Task 1}{1}{4} \\ \ganttbar[name=task2]{Task 2}{5}{8} \\ \ganttbar[name=task3]{Task 3}{6}{10} \\ \ganttbar[name=task4]{Task 4}{11}{14} \\ \ganttmilestone[name=done]{Complete}{16} % Automatic finish-to-start link \ganttlink{task1}{task2} % Start-to-start dependency \ganttlink[link type=s-s]{task2}{task3} % Finish-to-finish dependency \ganttlink[link type=f-f]{task3}{task4} % Custom styled link \ganttlink[ link/.style={-latex, draw=red, thick} ]{task4}{done} \end{ganttchart} ``` -------------------------------- ### Configure Gantt Chart Time Slot Formats Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Utilizes various time slot formats for flexible date handling, including ISO dates, year-month, and different day-month-year orders. ```latex % ISO date format \begin{ganttchart}[ time slot format=isodate, x unit=5mm ]{2024-03-01}{2024-03-31} \gantttitlecalendar{month=name, day} \\ \ganttbar{March Tasks}{2024-03-05}{2024-03-25} \end{ganttchart} % European date format (little-endian) \begin{ganttchart}[ time slot format=little-endian, time slot format/base century=2000 ]{1.4.24}{30.4.24} \gantttitlecalendar{day} \\ \ganttbar{April Work}{5.4.24}{20.4.24} \end{ganttchart} % Month-based time slots \begin{ganttchart}[ time slot format=isodate-yearmonth, time slot unit=month ]{2024-01}{2024-12} \gantttitlecalendar{year, month=shortname} \\ \ganttbar{Annual Project}{2024-03}{2024-10} \end{ganttchart} ``` -------------------------------- ### ganttbar Element Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Creates a task bar within the Gantt chart representing a specific duration. ```APIDOC ## \ganttbar ### Description Creates a bar element representing a task with a specified duration. The bar spans from the start time slot to the end time slot and displays a label. ### Parameters - **label** (string) - Required - The text label for the task. - **start** (integer/date) - Required - The start time slot. - **end** (integer/date) - Required - The end time slot. ### Request Example \ganttbar[progress=60]{Task Name}{1}{5} ``` -------------------------------- ### \ganttmilestone Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Creates a diamond-shaped milestone marker at a specific time slot. ```APIDOC ## \ganttmilestone ### Description Creates a diamond-shaped milestone marker at a specific time slot, representing a significant event or deadline in the project timeline. ### Request Example \ganttmilestone{Alpha Release}{5} ``` -------------------------------- ### Customize Canvas and Grid Styling Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Apply styling to the chart canvas, grid lines, and dimensions for professional presentation. ```latex \begin{ganttchart}[ % Canvas styling canvas/.style={ fill=gray!10, draw=gray!50, line width=1pt }, % Horizontal grid hgrid={*1{dotted, gray}}, hgrid style/.style={draw=gray, dotted}, % Vertical grid with alternating styles vgrid={*2{draw=none}, *1{gray, dashed}}, % Dimensions x unit=0.6cm, y unit title=0.8cm, y unit chart=0.7cm, % Expand to text width expand chart=\textwidth ]{1}{24} \gantttitle{Q1 2024}{12} \gantttitle{Q2 2024}{12} \\ \gantttitlelist{1,...,24}{1} \\ \ganttgroup{Project}{1}{24} \\ \ganttbar{Phase 1}{1}{8} \\ \ganttbar{Phase 2}{9}{16} \\ \ganttbar{Phase 3}{17}{24} \end{ganttchart} ``` -------------------------------- ### \newgantttimeslotformat Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Defines custom time slot formats for specialized date handling. ```APIDOC ## \newgantttimeslotformat ### Description Defines custom time slot formats for specialized date handling requirements beyond the built-in formats. ### Request Example \newgantttimeslotformat{dayofyear}{...} ``` -------------------------------- ### Generate calendar-based titles Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Uses \gantttitlecalendar to automatically generate date-based headers and the starred version for explicit ranges. ```latex \begin{ganttchart}[ hgrid, vgrid, x unit=4mm, time slot format=isodate ]{2024-01-01}{2024-02-15} % Generate multiple calendar rows automatically \gantttitlecalendar{year, month=name, week=1, day} \\ \ganttbar{Sprint 1}{2024-01-01}{2024-01-14} \\ \ganttbar{Sprint 2}{2024-01-15}{2024-01-28} \\ \ganttbar{Sprint 3}{2024-01-29}{2024-02-11} \end{ganttchart} % Starred form with explicit date range \begin{ganttchart}[time slot format=isodate]{2024-01-01}{2024-03-31} \gantttitlecalendar*{2024-01-01}{2024-03-31}{year, month=shortname} \\ \ganttbar{Q1 Project}{2024-01-15}{2024-03-15} \end{ganttchart} ``` -------------------------------- ### Define Custom Chart Elements Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Extend built-in types by defining new chart elements with custom shapes and styles using newganttchartelement. ```latex \definecolor{customblue}{RGB}{0,120,200} \newganttchartelement{checkpoint}{ checkpoint/.style={ shape=star, star points=5, inner sep=2pt, draw=customblue, fill=customblue!30 }, checkpoint label font=\footnotesize\itshape, checkpoint height=0.4, checkpoint top shift=0.3 } \begin{ganttchart}[vgrid, hgrid]{1}{12} \gantttitlelist{1,...,12}{1} \\ \ganttbar{Task 1}{1}{4} \\ \ganttcheckpoint{Review 1}{4} \\ \ganttbar{Task 2}{5}{8} \\ \ganttcheckpoint{Review 2}{8} \\ \ganttbar{Task 3}{9}{12} \ganttlinkedcheckpoint{Final Review}{12} \end{ganttchart} ``` -------------------------------- ### ganttgroup Element Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Creates a group element to visually combine related tasks or phases. ```APIDOC ## \ganttgroup ### Description Creates a group element that visually combines related tasks. Groups typically have a distinctive appearance with peaks at both ends. ### Parameters - **label** (string) - Required - The group name. - **start** (integer/date) - Required - The start time slot. - **end** (integer/date) - Required - The end time slot. ### Request Example \ganttgroup{Phase 1}{1}{10} ``` -------------------------------- ### Position Inline Labels Source: https://context7.com/skafdasschaf/latex-pgfgantt/llms.txt Use the inline key to position labels inside or near chart elements instead of the default external labels. ```latex \begin{ganttchart}[ vgrid, hgrid, inline, bar label font=\small, bar label node/.append style={anchor=center}, milestone inline label node/.append style={above=2pt} ]{1}{16} \gantttitlelist{1,...,16}{1} \\ \ganttbar{Design Phase}{1}{4} \ganttbar{Development}{5}{10} \\ \ganttbar{Testing}{11}{14} \ganttmilestone{Release}{16} \end{ganttchart} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.