Giter Club home page Giter Club logo

optex-minim's People

Contributors

vlasakm avatar

Stargazers

 avatar

Watchers

 avatar

optex-minim's Issues

using optex color definitions in minim - not an issue - but help needed, thanks

Hi, thanks for creating optex-minim - I am doing my first baby steps with optex + minim (your optex-minim i.e.) + metapost (while also looking at the context docs) etc. - having some experience with latex/context, but less so with plain tex - i.e. I am learning all these at the same time - so bear with me, please.

I can (partly) set the background of some pages in optex with metapost in color, like so:

\pgbackground={
  \directmetapost{
    beginfig(1);
    numeric w ; w := 210mm ;
    numeric h ; h := 297mm ;
    fill unitsquare xscaled .3w yscaled .122h withcolor (0.655, 0.741, 0.690);
    fill unitsquare xscaled .3w yscaled .878h yshifted .122h  withcolor (0.745, 0.855, 0.690) ;
    % and so on
    endfig;
  }
}

i.e. I want to use slightly more complicated colors - than the usual red/green/blue...

Now, ideally I would use my optex color definitions - there are various ways to do them:
(with \setrgbcolor, \setHEXcolor etc. - you know the optex docs)

\def \CornerDarkGreen {\setrgbcolor{0.655 0.741 0.690}}
\def \SideGreen {\setHEXColor{bedab0}}

etc. - now, I am having a hard time accessing / using such definitions in metapost
(and I am not sure: do I need to write a macro to do so? Can I directly access
optex definitions within minim - the minim docs seem to suggest so:
there is a mention of \mpcolor - well for latex, not optex - and then: a (very general)
section "running tex from within metapost" - but there are not really any examples given.

note that this works (but sets only a certain red level):

\def\mycolor{.625red}

\pgbackground={
  \directmetapost{
    beginfig(1);
    numeric w ; w := 210mm ;
    numeric h ; h := 297mm ;
    fill unitsquare xscaled .7w yscaled .122h xshifted .3w withcolor \mycolor ;
    endfig;
  }
}

I don't really know: maybe this is general TeX knowledge - but I am not aware: where does this syntax come from:
{.625red} - and more importantly: how to use it a little more generally:
this does not work

% not working!!
\def \myothercolor{.625red .8blue}

maybe I need a comma in between red and blue, maybe + - I think I have tried everything.

maybe I can just use \mpcolor{\CornerDarkGreen} in the metapost above - I think I have tried this, without success!

Maybe you could provide some hints - or ideally even add an example (to your examples directory)? Thanks!

Does it work with MMTeX?

Hi! I've tried compiling a copy of optex-minim-mp-test.tex using this package and MMTeX, but it complains about \newcount being undefined. The log is quite long, but these are the first lines, being the next ones similar:

! Undefined control sequence.
<recently read> \newcount 
          
<to be read again> 
\e@alloc@attribute@count 
\alloc:makenew ... \newcount \csname #3\endcsname 
                                                  \csname #3\endcsname 0\fi ...

l.141 ... \attributedef    {e@alloc@attribute@count}
                                                  
! Undefined control sequence.
<recently read> \newcount 
          
<to be read again> 
\e@alloc@whatsit@count 
\alloc:makenew ... \newcount \csname #3\endcsname 
                                                  \csname #3\endcsname 0\fi ...

l.142 ...   \chardef         {e@alloc@whatsit@count}
                                                  
! Undefined control sequence.
<recently read> \newcount 
          
<to be read again> 
\e@alloc@bytecode@count 
\alloc:makenew ... \newcount \csname #3\endcsname 
                                                  \csname #3\endcsname 0\fi ...


I've added files from minim, as well as ltluatex.lua, ltluatex.lua, and etex.src, to ls-R, so files seem to be found. What could be happening? IMHO a self-contained optex-minim would be easier to handle with.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.