Skip to Content.
Sympa Menu

texmacs-users - [TeXmacs] DrGeo plugin

Subject: mailing-list for TeXmacs Users

List archive

[TeXmacs] DrGeo plugin


Chronological Thread 
  • From: "Adrian S." <address@hidden>
  • To: address@hidden
  • Subject: [TeXmacs] DrGeo plugin
  • Date: Wed, 7 Mar 2012 21:04:22 -0700

I resurrected some code I had from almost 6 years ago, and, along with some cleaning, updated the DrGeo plugin to learn more about plugins in TeXmacs, how to document them, and to have a little fun with it.

Simply decompress DrGeo.tar.gz, drop the resulting DrGeo directory inside of .TeXmacs/plugins/, and type make inside that directory  to compile the file DrGeo_filter.  Next time you run TeXmacs, the plugin should be available.


In the hope that it might be useful to someone, here are the novelties from the other, ancient, version:

*Tries to follow TeXmacs guidelines to document plugins, and hence provides help "out of the box"
*It takes the idea of the prompt example plugin to insert output (I modified the headers of prompt.cpp to let it compile; I attach the resulting file)
*Now DrGeo is killed nicely without user interaction
*Inserted some interesting code
*The menu now has also some Scheme constructions to ease the remembering of the constructs


Here are the problems:
*The qt version of TeXmacs is more picky about the postscript generated by DrGeo1.1, and renders it cropping.  I wonder about this problem, since qtTeXmacs displays correctly the postscript generated by Geogebra.  It could be that the postscript generated by DrGeo is corrupted, or that qt does not render correctly older versions postscript.
*The X version displays them correctly, if only a bit small, though it is convenient, and can be resized by hand
*DrGeo is in version 11.12, and this is version 1.1, so it does not do justice to DrGeo, and  might be a bad investment, since
  DrGeo with Scheme is possibly Dead

Here are the nice possibilities:
*The language is not that different from the TeXmacs primities, and thus the examples can be translated  into TeXmacs drawing markup for a "Look what TeXmacs can do" presentation

I might make a video of it some day, though I understand that there might be very little interest in the scheme version of DrGeo, since, unlike the Smalltalk version of it, the Scheme version of DrGeo is no longer developed.

If someone has some day some time to try it, let me know what you think.  I hope someone will like it.

Peace to you all.


Attachment: DrGeo.tar.gz
Description: GNU Zip compressed data

/******************************************************************************
* MODULE     : prompt.cpp
* DESCRIPTION: Shows how to produce prompts
* COPYRIGHT  : (C) 2003  Joris van der Hoeven
*******************************************************************************
* This software falls under the GNU general public license version 3 or later.
* It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
* in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
******************************************************************************/


#include <stdio.h>
#include <iostream>
using namespace std;


#define DATA_BEGIN   ((char) 2)
#define DATA_END     ((char) 5)
#define DATA_ESCAPE  ((char) 27)

static int counter= 0;

void
next_input () {
  counter++;
  cout << DATA_BEGIN << "prompt#";
  cout << "Input " << counter << "] ";
  cout << DATA_END;
}

int
main () {
  cout << DATA_BEGIN << "verbatim:";
  cout << "A LaTeX -> TeXmacs converter";
  next_input ();
  cout << DATA_BEGIN << "input#";
  cout << "f (x)=\\int_0^x \\cos (x\\*t)\\mathrm{d}t ";
  cout << DATA_END;

  cout << DATA_END;
  fflush (stdout);

  while (true) {
    char buffer[100];
    cin.getline (buffer, 100, '\n');
    cout << DATA_BEGIN << "verbatim:";
    cout << DATA_BEGIN;
    cout << "latex:$" << buffer << "$";
    cout << DATA_END;
    next_input ();
    cout << DATA_END;
    fflush (stdout);
  }
  return 0;
}


  • [TeXmacs] DrGeo plugin, Adrian S., 03/08/2012

Archive powered by MHonArc 2.6.19.

Top of Page