Tag Info

Hot answers tagged

14

Here's a Metapost effort. The shapes above are all scaled to the same desired length, and show increasing levels of randomness from black to red. Here's the code: prologues := 3; outputtemplate := "%j%c.eps"; beginfig(1); desired_length = 500; N = 30; r = 50; path shape; for s=0 step 1 until 11: shape := (r,0) for i=1 upto N-1: .. ...


10

If I got the sums right then this calculates the length of each curve, given the length it then redraws the path, scaling everything so the length equals your target length. /getpathlength {flattenpath {exch dup /startx exch def exch dup /starty exch def /currentx startx def /currenty starty def /currentlength 0 def moveto} {exch dup /newx exch def ...


6

This might not be the simplest way of doing things and the positioning of the days on the second row probably needs tidying up, but hopefully shows how to proceed to get the required output. \documentclass[tikz,border=5]{standalone} \usetikzlibrary{calendar,backgrounds} \newcount\daycount \begin{document} \begin{tikzpicture}[background ...


5

\documentclass[pstricks,border=0pt,12pt]{standalone} \usepackage{pst-eucl} \psset{PointName=none,PointSymbol=none} \begin{document} \begin{pspicture}(-4,-1)(5,5) \pstGeonode(0,0){O}(4;0){A}(4;60){B} \pstMiddleAB{O}{A}{M} \pstMiddleAB{O}{B}{N} \pscustom[fillstyle=solid,fillcolor=cyan!50] { \psarcAB(N)(B)(O) ...


5

Indeed, \psStep uses only the left and right values and uses the larger one for the step. Here is a modified version of \psStep, which divides each interval in 20 subintervals to compute the supremum: \documentclass[margin=12pt,pstricks]{standalone} \usepackage{pstricks-add} \makeatletter \def\psStepSupremum{\def\pst@par{}\pst@object{psStepSupremum}} ...


5

Please find a not perfect solution with Asymptote. Since the points are randomly generated it is not easy to have a non-intersecting path. So I remember some hull computation with some parameters. You can find it http://git.piprime.fr/?p=asymptote/pi-packages.git;a=blob;f=hull_pi.asy;hb=HEAD and some examples are on ...


4

With the updated version: \documentclass[pstricks,border=10pt]{standalone} \usepackage{pstricks-add} \psset{algebraic,plotpoints=100} \begin{document} \def\f(x){-x^2 + 10} \begin{pspicture}(-5,-3)(5,12) \psStep[StepType=sup,linewidth=1.5pt,linecolor=red](-3,3){3}{\f(x)} \psplot[linewidth=1.5pt]{-3}{3}{\f(x)} ...


4

pdfcrop needs an installed Perl language. Do you have one installed on your system? I suppose not. Then install one from http://www.activestate.com/activeperl or http://strawberryperl.com/ The crop=on should work. For a test open a terminal (DOS window) go into the documents directory and run by hand: pdflatex -shell-escape <file>


3

Use it this way: \documentclass[UKenglish]{lipics} %\documentclass{article} \usepackage{auto-pst-pdf} \ifpdf\usepackage{pstricks}\fi \begin{document} aaaa \begin{pspicture}(25mm,25mm) \psset{unit=1mm} \psframe(0,0)(20,20) \end{pspicture} bbbb \end{document}


3

Use pst-eucl syntax for arcs. \documentclass[12pt, x11names, pdf]{standalone} \usepackage{pst-eucl} \psset{PointName=none,PointSymbol=none} \begin{document} \begin{pspicture}(-4,-1)(5,5) \pstGeonode(0,0){O}(4;0){A}(4;60){B} \pstMiddleAB{O}{A}{M} \pstMiddleAB{O}{B}{N} ...


3

Here is a solution, which uses pst-intersect's ability to save a generic path. So, first a random path is generated (how is pretty much arbitrary), then it is loaded, its path length is calculated and then it is redrawn with scaled coordinates: \documentclass[margin=5pt, pstricks]{standalone} \usepackage{pst-intersect} \makeatletter \def\SaveRandomPath{% ...


3

I worked on @percusse example and I managed to fix the circle issues. I might be perfectible but I guess the idea is there. \documentclass[border=1cm]{standalone} \RequirePackage{tikz} \usepackage{ifthen} \usetikzlibrary{calc,patterns,decorations,plotmarks} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} ...


2

Use it this way: packages which uses PSTricks should not be loaded when running pdflatex and, of course, tikz and todonotes should not be loaded when running latex. My example use the postscript environment: \documentclass[a4paper,11pt]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage{eurosym} ...


2

Here's a similar function for Metapost that uses the built-in path bounding box features to find the maximum or minimum of each part of a function curve. prologues := 3; outputtemplate := "%j%c.eps"; vardef steps_over(expr p, k) = steps(p,k,true) enddef; vardef steps_under(expr p, k) = steps(p,k,false) enddef; vardef steps(expr p, k, over) = save xmin, ...


2

Use it this way: \documentclass[a4paper]{scrartcl} \usepackage[absolute]{pst-abspos} \begin{document} \section{one} \pstPutAbs(5,-5){Hi} \newpage \section{two} \pstPutAbs(6,-5){Hi} \end{document} With [absolute] it is internally already set at the beginning of the first page. And with \newpage it is set on the following page.


2

This answer is a bit late, but here it is for future users. The code is provided at Github and is based on LuaLaTeX. Firstly a word about calendars. Most calendars will display a 42 day calendar for a given month and not as shown in the OP's image. They look more like the image below. The advantage of this type of calendar is that it is easy to see a few ...


1

You can make this calendar easily without need to the packages you mentioned. Here is my solution: %pdflatex \documentclass[12pt,a4paper]{article} \usepackage{xcolor} \color{white} \pagecolor{black} \begin{document} \noindent \textbf{JANUARY} \\ \noindent\makebox[\linewidth]{\rule{\textwidth}{0.4pt}} \\ 1 \hfill 2 \hfill 3 \hfill 4 \hfill 5 \hfill 6 ...


1

This is one possible solution via tikz-3dplot. Here numbers are used for labeling for ease of programming. Explanatory comments are added in the code. The right angles on the xy plane are found via intersections of grid lines notion, that is, finding intersection points of parellel lines that are parallel to d5-d6 and d7-d8. Code ...



Only top voted, non community-wiki answers of a minimum length are eligible