I use this command to draw some text along a circular path. But this text overlaps a vertical line (for example). Will I wish that the text appear “in front of” and what is behind the text is thus not visible? How to do that knowing that I use the following code to draw the text?
\path [postaction={ decoration={text along path, text={|\fontsize{9pt}{9pt}\selectfont|THIS END TO NORTH WHEN NORTH OF EQUATOR},text align=center},decorate}] { (118:\RHorizon-.35) arc (118:60:\RHorizon-.35) } ;
\path [postaction={decoration={text along path, text={|\fontsize{9pt}{9pt}\selectfont|THIS END TO NORTH WHEN |\fontsize{9pt}{9pt}\color{red}\selectfont|SOUTH |\fontsize{9pt}{9pt}\selectfont|OF EQUATOR},text align=center},decorate}] { (295:\RHorizon-.35) arc (295:243:\RHorizon-.35) } ;
The complete code which draws the whole figure is here. One can realize that the text along the path and the vertical line overlap…
% Tracé complet du tympan d'un astrolabe horizontal d'OUGHTRED
% Author: Dominique COLLIN
%==============================================================================================
% MATERIEL :
% COMPILATION : nécessite un système Tex complet installé sur le disque dur.
% Tex Live 2012 pour macintosh intel. (http://www.tug.org/mactex/)
% pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
% LaTeX2e version < 2011/06/27 >
% TikZ and PGF sont des packages TeX pour la création de graphiques et dessins programmables.
% PGF 2012-05-18 CVS build.
% GNUPLOT version 4.4 patchlevel 3 pour macintoh intel
% Manuel TikZ = http://www.texample.net/media/pgf/builds/pgfmanualCVS2012-05-18.pdf
% TeXample.net is a web site dedicated to the wonderful world of TeX and friends.
% EDITEUR DE TEXTE = TexShop Version 3.11 pour macintosh Intel. (http://www.texshop.org)
% ==============================================================================================
\documentclass[ landscape, a3paper]{memoir}
% ==============================================
\usepackage{etex}%
\usepackage[T1]{fontenc}
\usepackage[utf8,applemac]{inputenc}
\usepackage{cmbright}
% \usepackage{lmodern, textcomp}
\usepackage{mathrsfs,bm}
\usepackage{amsmath,amssymb,amscd}
\usepackage{comment}
\usepackage[frenchb]{babel}
\usepackage[margin=2cm]{geometry}
% ==============================================
\usepackage[babel=true,kerning=true]{microtype}%pour le package tikZ et les deux points``:''
% ------- TikZ packages.
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{arrows,calc,fit,through,intersections}
\usetikzlibrary{decorations} % LATEX and plain TEX when using TikZ
\usetikzlibrary{decorations.text}% texte le long d'un chemin....
%
\pagestyle{empty}
\usepackage{xifthen}
% ==============================================
\begin{comment}
:Title: Tracé du tympan d'un Astrolabe horizontal d'Oughtred
:Tags: mathematical engine;geometry;mathematics;ancient astronomy
:Author: Dominique COLLIN
:Slug: astrolabe horizontal d'Oughtred
\end{comment}
% -- -- -- -- -- -- -- -- -- --
\begin{document}
% -- -- -- -- -- -- -- -- -- --
\begin{tikzpicture}[line cap=round,line join=round, scale=1]
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
% DEFINITIONS DES CONSTANTES / PARAMETRES MODIFIABLES
% (Define a few constants for easy configuration and computation)
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
\pgfmathparse{ 43 + 0/60 + 0/3600 }
\let\latitude\pgfmathresult% Latitude du lieu
% --
\pgfmathparse{ 23 + 26/60 }
\let\epsilon\pgfmathresult% Déclinaison du soleil au solstice d'été
% --
\pgfmathparse{ 19.07/2) }
\let\RHorizon\pgfmathresult% Rayon du cercle horizon dans l'astrolabe d'Oughtred
\pgfmathparse{ 21.315/2) }
\let\RExterieur\pgfmathresult% Rayon du cercle horizon dans l'astrolabe d'Oughtred
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
% CALCULS INITIAUX ET DIVERS
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
% -- Les rayons des cercles principaux, des colures des solstices, longueur des divers segments...
\pgfmathparse{ -cot(\latitude) }
\let\K\pgfmathresult% Constante pour le calcul de l'arc semi-diurne
\pgfmathparse{ \RHorizon*tan((90-\latitude)/2) }
\let\yPole\pgfmathresult% ordonnée du pole nord céleste.
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
% TRACEE DES CERCLES HORAIRES (méridiens célestes)
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
\begin{scope}
% -- -- -- -- -- -- -- -- -- --
\clip circle(\RHorizon+1/150); % limitations de tous les tracés à l'intérieur du cercle de l'HORIZON
% -- -- --
\pgfmathparse{ (\RHorizon*cos(\latitude)/( sin(\latitude)+sin(-\epsilon) ) }
\let\zCh\pgfmathresult% Pour le centre du cercle de déclinaison hiver.
\pgfmathparse{\zCh+ \RHorizon*tan((\latitude-(-\epsilon))/2) }
\let\RCercleddh\pgfmathresult% Rayon du cercle de déclinaison hiver.
% --
\pgfmathparse{ (\RHorizon*cos(\latitude)/( sin(\latitude)+sin(\epsilon) ) }
\let\zCe\pgfmathresult% Pour le centre du cercle de déclinaison ete.
\pgfmathparse{ \zCe+\RHorizon*tan((\latitude-(\epsilon))/2) }
\let\RCercledde\pgfmathresult% Rayon du cercle de déclinaison été.
% --
\coordinate (Centreddh) at ( 0, \zCh );% position des différents centres des cercles de déclinaison
\coordinate (Centredde) at ( 0, \zCe );% position des différents centres des cercles de déclinaison
% -- -- -- afin de limiter les cercles horaires aux solstices d'été et d'hiver :
\clip (Centreddh) circle(\RCercleddh); % limitations de tous les tracés à l'intérieur du solstice hiver
% -- -- --
\draw [color=red, line width=.4pt] (Centreddh) circle (\RCercleddh ) ;% Solstice Hiver.
\draw [color=red, line width=.8pt] (Centredde) circle (\RCercledde ) ;% Solstice Ete.
% -- -- --
\pgfmathparse{ \RHorizon*tan(\latitude) }
\let\zi\pgfmathresult% Ordonnée du point par où passe la droite contenant les centres des cercles horaires
\pgfmathparse{ \RHorizon/cos(\latitude) }
\let\ipole\pgfmathresult% distance du point i au pôle P
% -- -- --
\foreach \H in {0,2.5,5,7.5,...,120}% CERCLES HORAIRES PM (toutes les 10 minutes))
{%
\ifthenelse{\NOT 0 = \H \AND \NOT 90 = \H}{%
\pgfmathparse{ \ipole*tan(\H/2) }
\let\iH\pgfmathresult% point de passage du cercle horaire H sur la droite passant par i
\pgfmathparse{ \ipole/tan(\H) }
\let\xiC\pgfmathresult% abscisses des centres des cercles horaires sur la droite passant par i située à la distance zi ou pi.
\pgfmathparse{ \xiC + \iH }
\let\RcercleH\pgfmathresult% abscisses des centres des cercles horaires sur la droite passant par i située à la distance zi.
%
\coordinate (CentreH) at ( \xiC, -\zi );% position des différents centres des cercles de déclinaison
\draw [color=black, line width=0.1pt] (CentreH) circle (\RcercleH ) ;% Cercle HORAIRE d'angle horaire H.
}{ }%
}% fin de boucle
\foreach \H in {0,-2.5,-5,-7.5,...,-120}% CERCLES HORAIRES AM (toutes les 10 minutes))
{%
\ifthenelse{\NOT 0 = \H \AND \NOT -90 = \H}{%
\pgfmathparse{ \ipole*tan(\H/2) }
\let\iH\pgfmathresult% point de passage du cercle horaire H sur la droite passant par i
\pgfmathparse{ \ipole/tan(\H) }
\let\xiC\pgfmathresult% abscisses des centres des cercles horaires sur la droite passant par i située à la distance zi ou pi.
\pgfmathparse{ \xiC + \iH }
\let\RcercleH\pgfmathresult% abscisses des centres des cercles horaires sur la droite passant par i située à la distance zi.
%
\coordinate (CentreH) at ( \xiC, -\zi );% position des différents centres des cercles de déclinaison
\draw [color=black, line width=0.1pt] (CentreH) circle (\RcercleH ) ;% Cercle HORAIRE d'angle horaire H.
}%
}% fin de boucle
% -- Tracé de 10 en 10 degrés : (traits forts)
\foreach \H in {-120,-105,...,+105,+120}% CERCLES HORAIRES AM & PM (toutes les heures pleines)
{%
\ifthenelse{\NOT 0=\H \AND \NOT 90 = \H \AND \NOT -90 = \H}{%
\pgfmathparse{ \ipole*tan(\H/2) }
\let\iH\pgfmathresult% point de passage du cercle horaire H sur la droite passant par i
\pgfmathparse{ \ipole*cot(\H) }
\let\xiC\pgfmathresult% abscisses des centres des cercles horaires sur la droite passant par i située à la distance zi ou pi.
\pgfmathparse{ \xiC + \iH }
\let\RcercleH\pgfmathresult% rayons des cercles horaires sur la droite passant par i située à la distance zi ou pi.
%
\coordinate (CentreH) at ( \xiC, -\zi );% position des différents centres des cercles de déclinaison
\draw [color=black, line width=0.4pt] (CentreH) circle(\RcercleH );% Cercle HORAIRE d'angle horaire H.
}{ }%
}% fin de boucle
% -- -- -- --
% pour le cercle horaire de 90°
\pgfmathparse{ \ipole*tan(90/2) }
\let\iH\pgfmathresult% point de passage du cercle horaire 90° sur la droite passant par i
\coordinate (CentreH90) at ( 0, -\zi );%
\draw [color=black, line width=0.5pt] (CentreH90) circle(\iH );% Cercle HORAIRE d'angle horaire 90°.
% -- -- -- afin de limiter les cercles horaires aux solstices d'été :
\filldraw[white] (Centredde) circle(\RCercledde); % pour masquer les cercles horaires compris dans le cercle d'été
% Si quelqu'un a une meilleure méthode pour limiter un tracé (ou un ensemble de chemins) entre deux chemins donnés,
% alors cela serait le bienvenu et certainement plus propre que ce procédé...
% -- -- --
\end{scope}
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
% TRACEE DES PARALLELES CELESTES (CERCLES DE DECLINAISON)
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
\begin{scope}
% -- -- -- -- -- -- -- -- -- --
\clip circle(\RHorizon+1/150); % limitations de tous les tracés à l'intérieur du cercle du tropique du Capricorne (Hiver)
% -- -- --
\foreach \dd in {-24,-22,..., 24}% CERCLES de DECLINAISON
{ \pgfmathparse{ (\RHorizon*cos(\latitude)/( sin(\latitude)+sin(\dd) ) }
\let\zC\pgfmathresult% Pour le centre du cercle de déclinaison dd.
\pgfmathparse{ \zC+\RHorizon*tan((\latitude-\dd)/2) }
\let\RCercledd\pgfmathresult% Rayon des cercles de déclinaison
%
\coordinate (Centredd) at ( 0, \zC );% position des différents centres des cercles de déclinaison
%\fill [black] (CentreAz) circle (1.5pt); %
\draw [color=black, line width=0.1pt] (Centredd) circle(\RCercledd); % Tracé du cercle de déclinaison 'dd'
}% fin de boucle
% -- Tracé de 4 en 4 degrés : (traits forts)
\foreach \dd in {-24,-20,..., 24}%
{ \pgfmathparse{ (\RHorizon*cos(\latitude)/( sin(\latitude)+sin(\dd) ) }
\let\zC\pgfmathresult% Pour le centre du cercle de déclinaison dd.
\pgfmathparse{ \zC+\RHorizon*tan((\latitude-\dd)/2) }
\let\RCercledd\pgfmathresult% Rayon des cercles de déclinaison
%
\coordinate (Centredd) at ( 0, \zC );% position des différents centres des cercles de déclinaison
\draw [color=black, line width=0.3pt] (Centredd) circle(\RCercledd); % Tracé du cercle de déclinaison 'dd'
}% fin de boucle
% -- -- --
\end{scope}
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
% TRACES DE CERCLE, DES COURBES ET DES SEGMENTS, des REPERES et QUELQUES POINTS
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
\begin{scope}
% -- -- -- -- -- -- -- -- -- --
\draw [color=black] ( 0, 0 ) circle(\RHorizon); % Cercle de l'horizon du lieu
% -- -- --
\draw [ ] (0,-\RHorizon)--(0,\RHorizon);% Méridien (ligne nord-sud)
\draw [ ] (-\RHorizon,0)--(\RHorizon,0);% ligne Est-Ouest
% -- -- --
\coordinate (z) at (0, 0); % Centre du cercle horizon
\coordinate (P) at (0, \yPole);% Position du pôle nord céleste sur l'axe Nord-Sud
% -- -- --
\fill [black] (z) circle (1.5pt); % Marquage de l'origine, centre de l'astrolabe
\draw[ line width=.005mm] (-0.375 ,\yPole)--(-0.125,\yPole);
\draw[ line width=.005mm] (0.375 ,\yPole)--(0.125,\yPole) ;
\fill [red] (P) circle (1.5pt); % Marquage du Pole nord céleste
% -- -- -- -- -- Repères des trous de fixation
\draw [color=black] ( 0, 0 ) circle (0.8); % Trou central
\fill[color=black] (0,9.9) circle (2pt); % Trou pour la fixation du tympan au nord.
\draw [color=black, line width=0.1pt] (0,9.9) circle (0.25);
\fill[color=black] (0,-9.9) circle (2pt); % Trou pour la fixation du tympan au Sud.
\draw [color=black, line width=0.1pt] (0,-9.9) circle (0.25);
% -- -- -- -- -- Cercles
\draw [color=black, line width=4pt] ( 0, 0 ) circle(\RHorizon+1/10); % Cercle de l'horizon du lieu épais
\draw [color=black, line width=0.01pt] ( 0, 0 ) circle(\RExterieur); % Cercle de l'horizon du lieu épais
% --- --- --- --- --- QUELQUES TEXTES / LEGENDES
\draw [ ] (0,8) node [fill=white] {\fontsize{11.5pt}{11.5pt}\selectfont LATITUDE} ;
\draw [ ] (0,7.15) node [fill=white] { \fontsize{38pt}{38pt}\selectfont \textbf{\textsf{43}} } ;
%\draw [ ] (0,7.1) node [fill=white] { \fontsize{38pt}{38pt}\selectfont \textbf{\textsf{43\degres 43$^\prime$}} } ;
%\draw [ ] (0,7.1) node [fill=white] { \fontsize{38pt}{38pt}\selectfont \textbf{\textsf{48\degres 52$^\prime$10$^{\prime\prime}$}} } ;
%\draw [ ] (0, 6.3) node [fill=white] { \fontsize{9pt}{9pt}\selectfont Palais de la D{\'e}couverte} ;
\draw [ ] (0, 5.3) node [fill=white] {\fontsize{13pt}{13pt}\selectfont MAREAN-KIELHORN} ;
\draw [ ] (0, 4.825) node [fill=white] {\fontsize{13pt}{13pt}\selectfont DIRECTOR} ;
\draw [ ] (0, 4.475) node[ fill=white] {\fontsize{4pt}{4pt}\selectfont Ajout{\'e} par D. COLLIN} ;
% -- -- --
\draw[ thick,-stealth ] (2.85 ,1.25)--(4.05,1.25);
\draw[ ] (2.4 ,1.25) node [rotate=180] {\LARGE PM};
\draw[ thick,-stealth ] (-2.8 ,1.25)--(-4,1.25);
\draw[ ] (-2.3 ,1.25) node [rotate=180] {\LARGE AM};
%
\draw[ thick,-stealth ] (2.25 ,-7.6)--(3.35,-7.6);
\draw[ ] (1.7 ,-7.6) node [ ] {\LARGE AM};
\draw[ thick,-stealth ] (-2.25 ,-7.6)--(-3.35,-7.6);
\draw[ ] (-1.7 ,-7.6) node [ ] {\LARGE PM};
%
\path [postaction={ decoration={text along path, text={|\fontsize{9pt}{9pt}\selectfont|THIS END TO NORTH WHEN NORTH OF EQUATOR},text align=center},decorate}] { (118:\RHorizon-.35) arc (118:60:\RHorizon-.35) } ;
\path [postaction={decoration={text along path, text={|\fontsize{9pt}{9pt}\selectfont|THIS END TO NORTH WHEN |\fontsize{9pt}{9pt}\color{red}\selectfont|SOUTH |\fontsize{9pt}{9pt}\selectfont|OF EQUATOR},text align=center},decorate}] { (295:\RHorizon-.35) arc (295:243:\RHorizon-.35) } ;
% -- -- -- -- --
\end{scope}
% -- -- -- -- --
%\begin{comment}
%:Title: Degree wheel
%:Tags: Foreach
%A degree wheel inspired by `an example`_ on the `PSTricks website`_.
%.. _an example: http://tug.org/PSTricks/main.cgi?file=examples#compass
%.. _pstricks website: http://tug.org/PSTricks/main.cgi
%:Author: Dario Orescanin.
%\end{comment}
%
\begin{scope}% Tracé des graduations des azimuts le long de la circonférence extérieure
% -- --
% -- --
\def\radius{\RExterieur}
\pgfmathparse{ \radius - 0.25) }
\let\onedegrad\pgfmathresult % pour les 1 deg.
\pgfmathparse{ \radius - 0.35) }
\let\fivedegrad\pgfmathresult % pour les 5 deg.
\pgfmathparse{ \radius - 0.5) }
\let\tendegrad\pgfmathresult % pour les 10 deg.
\pgfmathparse{ \radius - 0.9) }
\let\labelrad\pgfmathresult % pour la position des étiquettes... / Elles sont désactivées ici.
% -- --
% main lines
\foreach \x in {0,...,359} { \draw (\x:\onedegrad) -- (\x:\radius);}
\foreach \x in {0.5,1.5,...,359.5} { \fill (\x:\onedegrad+.15) circle (0.25pt);}
% labels and longer lines at every 10 degrees
\foreach \x in {0,10,...,350}
{
%\node[scale=1, rotate=\x*-1] at (360-\x+90:\labelrad) {\x};
\draw (\x:\tendegrad) -- (\x:\radius);
};
% lines at every 5 degrees
\foreach \x in {0,5,...,355} { \draw (\x:\fivedegrad) -- (\x:\radius);}
% -- -- -- -- --
\end{scope}
% -- -- -- -- -- -- -- -- --
\begin{scope}[xshift=15cm] % ECHELLE DES HAUTEURS AU-DESSUS DE L'HORIZON
% -- -- -- -- --
\pgfmathparse{ \RHorizon*tan(45) ) }
\let\Zh\pgfmathresult % ordonnée de l'échelle des hauteurs pour h=0°
\draw [very thin ] (0,0) -- (0, -\RExterieur);
\fill [color=black] (0,0) circle (0.5pt);
\draw [color=black] ( 0, 0 ) circle (0.8); % Trou pour le positionnement du cercle cartonné et de l'échelle des hauteurs
\clip [draw] (-1.25,1.25) rectangle (1.25,-\RExterieur);
%
\foreach \h in {0,1,2,...,90}%
{ \pgfmathparse{ \RHorizon*tan(45-\h/2) ) }
\let\yZh\pgfmathresult % ordonnée de l'échelle des hauteurs tous les 1°
%
\draw [ very thin] (-0.05,-\yZh)--(+0.05,-\yZh);
}% fin boucle
\foreach \h in {0,5,10,...,90}%
{ \pgfmathparse{ \RHorizon*tan(45-\h/2) ) }
\let\yZh\pgfmathresult % ordonnée de l'échelle des hauteurs de 5° en 5°
%
\draw [ ] (-0.065,-\yZh)--(+0.065,-\yZh) node [ right] {\tiny \h};
}% fin boucle
\path [postaction={ decoration={text along path, text={|\fontsize{6pt}{6pt}\selectfont|ALTITUDE SCALE},text align=center},decorate}] { (-.625,-\Zh)--(-0.625,0) } ;
% -- -- -- -- --
\end{scope}
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
\end{tikzpicture}
%
\end{document}
% --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---


\pgfmathparse{...}\let\xxx\pagmathresult. Instead of this syntax, you can use\pgfmathsetmacro{\xxx}{...}. It is simpler and more readable. – Paul Gaborit Sep 7 '12 at 17:45