Hallo!

Bei diesem Kalender wird m.E. im Druck der Platz einer DIN A4 Seite (Querformat) nicht optimal ausgenutzt.

Lässt sich der Kreis ggf. in eine Ellipse verwandeln?

alt text

Open in Online-Editor
% arara: pdflatex
% arara: pdflatex

% A calendar of circles
% Author: Till Tantau (The PGF manual),
%   and Stefan Kottwitz (Modifications such as shaded circles and color)
\documentclass[landscape, ngerman]{article}

\usepackage{babel}
\usepackage{translator}

\usepackage{tikz}
\usetikzlibrary{calendar,shadings}
\renewcommand*{\familydefault}{\sfdefault}
\colorlet{winter}{blue}
\colorlet{spring}{green!60!black}
\colorlet{summer}{orange}
\colorlet{fall}{red}
% A counter, since TikZ is not clever enough (yet) to handle
% arbitrary angle systems.
\newcount\mycount
\begin{document}
\pagestyle{empty}

\year=2016      %Jahr festlegen

\begin{tikzpicture}[scale=1.375,
remember picture,overlay,shift={(current page.center)}, 
transform shape,
  every day/.style={anchor=mid,node font=\tiny,minimum width=1ex}]
  \node[draw, densely dashed, circle,shading=radial,outer color=lightgray,inner color=white,
    minimum width=15cm] {\textcolor{blue!80!black}{\Huge\the\year}};
  \foreach \month/\monthcolor in
    {1/winter,2/winter,3/spring,4/spring,5/spring,6/summer,
    7/summer,8/summer,9/fall,10/fall,11/fall,12/winter} {
      % Computer angle:
      \mycount=\month
      \advance\mycount by -1
      \multiply\mycount by 30
      \advance\mycount by -90
      \shadedraw[shading=radial,outer color=\monthcolor!30,middle color=white,
        inner color=white,draw=none] (\the\mycount:5.4cm) circle(1.4cm);
      % The actual calendar
      \calendar at (\the\mycount:5.4cm) [
          dates=\the\year-\month-01 to \the\year-\month-last,
          day code={%
            \path node[every day]{\tikzdaytext}+(180+\the\mycount:0.22)
              node[every day,scale=.75]{\pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday}};
          }
        ]
      if (day of month=1) {{\color{\monthcolor!50!black}\tikzmonthcode}}
      if (Sunday) [red]
      if (all) {
      % Again, compute angle
      \mycount=1
      \advance\mycount by -\pgfcalendarcurrentday
      \multiply\mycount by 11
      \advance\mycount by 90
      \pgftransformshift{\pgfpointpolar{\mycount}{1.23cm}}};
    }
\end{tikzpicture}
\end{document}

gefragt 16 Okt '15, 16:33

cis's gravatar image

cis
5.4k860168
Akzeptiert: 68%

bearbeitet 07 Feb, 05:41

saputello's gravatar image

saputello
18.4k22352


Die einfachste Methode, das ganze elliptisch zu bekommen, besteht darin, für die x- und die y-Richtung unterschiedliche Skalierungsfaktoren zu verwenden, beispielsweise:

Open in Online-Editor
\documentclass[ngerman]{article}

\usepackage{babel}
\usepackage{translator}

\usepackage{tikz}
\usetikzlibrary{calendar,shadings}
\renewcommand*{\familydefault}{\sfdefault}
\colorlet{winter}{blue}
\colorlet{spring}{green!60!black}
\colorlet{summer}{orange}
\colorlet{fall}{red}
% A counter, since TikZ is not clever enough (yet) to handle
% arbitrary angle systems.
\newcount\mycount
\begin{document}
\pagestyle{empty}

\year=2016      %Jahr festlegen

\begin{tikzpicture}[xscale=1.2,yscale=1.6,
remember picture,overlay,shift={(current page.center)}, 
transform shape,
  every day/.style={anchor=mid,node font=\tiny,minimum width=1ex}]
  \node[draw, densely dashed, circle,shading=radial,outer color=lightgray,inner color=white,
    minimum width=15cm] {\textcolor{blue!80!black}{\Huge\the\year}};
  \foreach \month/\monthcolor in
    {1/winter,2/winter,3/spring,4/spring,5/spring,6/summer,
    7/summer,8/summer,9/fall,10/fall,11/fall,12/winter} {
      % Computer angle:
      \mycount=\month
      \advance\mycount by -1
      \multiply\mycount by 30
      \advance\mycount by -90
      \shadedraw[shading=radial,outer color=\monthcolor!30,middle color=white,
        inner color=white,draw=none] (\the\mycount:5.4cm) circle(1.4cm);
      % The actual calendar
      \calendar at (\the\mycount:5.4cm) [
          dates=\the\year-\month-01 to \the\year-\month-last,
          day code={%
            \path node[every day]{\tikzdaytext}+(180+\the\mycount:0.22)
              node[every day,scale=.75]{\pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday}};
          }
        ]
      if (day of month=1) {{\color{\monthcolor!50!black}\tikzmonthcode}}
      if (Sunday) [red]
      if (all) {
      % Again, compute angle
      \mycount=1
      \advance\mycount by -\pgfcalendarcurrentday
      \multiply\mycount by 11
      \advance\mycount by 90
      \pgftransformshift{\pgfpointpolar{\mycount}{1.23cm}}};
    }
\end{tikzpicture}
\end{document}

Ellipse hochkant

oder

Open in Online-Editor
\documentclass[landscape,ngerman]{article}

\usepackage{babel}
\usepackage{translator}

\usepackage{tikz}
\usetikzlibrary{calendar,shadings}
\renewcommand*{\familydefault}{\sfdefault}
\colorlet{winter}{blue}
\colorlet{spring}{green!60!black}
\colorlet{summer}{orange}
\colorlet{fall}{red}
% A counter, since TikZ is not clever enough (yet) to handle
% arbitrary angle systems.
\newcount\mycount
\begin{document}
\pagestyle{empty}

\year=2016      %Jahr festlegen

\begin{tikzpicture}[yscale=1.2,xscale=1.6,
remember picture,overlay,shift={(current page.center)}, 
transform shape,
  every day/.style={anchor=mid,node font=\tiny,minimum width=1ex}]
  \node[draw, densely dashed, circle,shading=radial,outer color=lightgray,inner color=white,
    minimum width=15cm] {\textcolor{blue!80!black}{\Huge\the\year}};
  \foreach \month/\monthcolor in
    {1/winter,2/winter,3/spring,4/spring,5/spring,6/summer,
    7/summer,8/summer,9/fall,10/fall,11/fall,12/winter} {
      % Computer angle:
      \mycount=\month
      \advance\mycount by -1
      \multiply\mycount by 30
      \advance\mycount by -90
      \shadedraw[shading=radial,outer color=\monthcolor!30,middle color=white,
        inner color=white,draw=none] (\the\mycount:5.4cm) circle(1.4cm);
      % The actual calendar
      \calendar at (\the\mycount:5.4cm) [
          dates=\the\year-\month-01 to \the\year-\month-last,
          day code={%
            \path node[every day]{\tikzdaytext}+(180+\the\mycount:0.22)
              node[every day,scale=.75]{\pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday}};
          }
        ]
      if (day of month=1) {{\color{\monthcolor!50!black}\tikzmonthcode}}
      if (Sunday) [red]
      if (all) {
      % Again, compute angle
      \mycount=1
      \advance\mycount by -\pgfcalendarcurrentday
      \multiply\mycount by 11
      \advance\mycount by 90
      \pgftransformshift{\pgfpointpolar{\mycount}{1.23cm}}};
    }
\end{tikzpicture}
\end{document}

Ellipse quer

Will man hingegen für die Monate weiterhin Kreise verwenden und lediglich den Hintergrund elliptisch haben, so muss man einige zusätzliche Berechnungen anstellen:

Open in Online-Editor
\documentclass[landscape,ngerman]{article}

\usepackage{babel}
\usepackage{translator}

\usepackage{tikz}
\usetikzlibrary{calendar,shadings}
\renewcommand*{\familydefault}{\sfdefault}
\colorlet{winter}{blue}
\colorlet{spring}{green!60!black}
\colorlet{summer}{orange}
\colorlet{fall}{red}
% A counter, since TikZ is not clever enough (yet) to handle
% arbitrary angle systems.
\newcount\mycount
\newlength\mylength
\begin{document}
\pagestyle{empty}

\year=2016      %Jahr festlegen

\begin{tikzpicture}[scale=1.35,
remember picture,overlay,shift={(current page.center)}, 
transform shape,
  every day/.style={anchor=mid,node font=\tiny,minimum width=1ex}]
  \node[xscale=1.2,draw, densely dashed, circle,shading=radial,outer color=lightgray,inner color=white,
    minimum width=15cm] {\textcolor{blue!80!black}{\Huge\the\year}};
  \foreach \month/\monthcolor in
    {1/winter,2/winter,3/spring,4/spring,5/spring,6/summer,
    7/summer,8/summer,9/fall,10/fall,11/fall,12/winter} {
      % Computer angle:
      \mycount=\month
      \advance\mycount by -1
      \multiply\mycount by 30
      \advance\mycount by -90
      \pgfmathparse{(abs(sin((\month-1)*30))*0.2+1}
      \shadedraw[shading=radial,outer color=\monthcolor!30,middle color=white,
        inner color=white,draw=none] (\the\mycount:\pgfmathresult*5.4) circle(1.4cm);
      % The actual calendar
      \setlength{\mylength}{\pgfmathresult\dimexpr 5.4cm\relax}
      \calendar at (\the\mycount:\mylength) [
          dates=\the\year-\month-01 to \the\year-\month-last,
          day code={%
            \path node[every day]{\tikzdaytext}+(180+\the\mycount:0.22)
              node[every day,scale=.75]{\pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday}};
          }
        ]
      if (day of month=1) {{\color{\monthcolor!50!black}\tikzmonthcode}}
      if (Sunday) [red]
      if (all) {
      % Again, compute angle
      \mycount=1
      \advance\mycount by -\pgfcalendarcurrentday
      \multiply\mycount by 11
      \advance\mycount by 90
      \pgftransformshift{\pgfpointpolar{\mycount}{1.23cm}}};
    }
\end{tikzpicture}
\end{document}

Kreise in einer Ellipse

Permanenter link

beantwortet 17 Okt '15, 03:48

saputello's gravatar image

saputello
18.4k22352

bearbeitet 17 Okt '15, 04:23

Wow! Einfach die Skalierung ändern, ist natürlich schlau und simpel gelöst ;)

(17 Okt '15, 08:29) cis

Anwendungsbeispiel:

alt text

(17 Okt '15, 20:28) cis
Deine Antwort auf die Frage (nicht auf andere Antworten)
Knebel-Vorschau

Folge dieser Frage

Per E-Mail:

Wenn Du Dich anmeldest, kannst Du Updates hier abonnieren

Per RSS:

Antworten

Antworten und Kommentare

Aktuelle Buch-Infos

LaTeX Cookbook

LaTeX Beginners Guide

Limitierter Rabatt ebook
50% Coupon code tDRet6Y

Markdown-Grundlagen

  • *kursiv* oder _kursiv_
  • **Fett** oder __Fett__
  • Link:[Text](http://url.com/ "Titel")
  • Bild?![alt Text](/path/img.jpg "Titel")
  • nummerierte Liste: 1. Foo 2. Bar
  • zum Hinzufügen ein Zeilenumbruchs füge einfach zwei Leerzeichen an die Stelle ein, an der die neue Zeile sein soll.
  • grundlegende HTML-Tags werden ebenfalls unterstützt

Zugeordnete Themen:

×492
×12
×8

Frage gestellt: 16 Okt '15, 16:33

Frage wurde angeschaut: 1,439 Mal

Zuletzt aktualisiert: 07 Feb, 05:41