Back to index

texmacs  1.0.7.15
Functions
env_length.cpp File Reference
#include "env.hpp"
#include "convert.hpp"
#include "page_type.hpp"
#include "typesetter.hpp"

Go to the source code of this file.

Functions

bool is_percentage (tree t, string s)
bool is_percentage (tree t)
double as_percentage (tree t)
bool is_magnification (string s)
double get_magnification (string s)

Function Documentation

double as_percentage ( tree  t)

Definition at line 286 of file env_length.cpp.

                       {
  return as_double (t->label (0, N (t->label) - 1)) / 100.0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

double get_magnification ( string  s)

Definition at line 303 of file env_length.cpp.

                             {
  int i=0;
  double magn= 1.0, result;
  while (i<N(s)) {
    if (s[i]=='*') { i++; read_double (s, i, result); magn *= result; }
    else if (s[i]=='/') { i++; read_double (s, i, result); magn /= result; }
    else return magn;
  }
  return magn;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_magnification ( string  s)

Definition at line 291 of file env_length.cpp.

                            {
  double result;
  if (N(s) == 0) return false;
  for (int i=0; i<N(s); /*nop*/) {
    if (s[i]=='*') { i++; read_double (s, i, result); }
    else if (s[i]=='/') { i++; read_double (s, i, result); }
    else return false;
  }
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_percentage ( tree  t,
string  s 
)

Definition at line 273 of file env_length.cpp.

                                 {
  return
    is_atomic (t) &&
    ends (t->label, s) &&
    is_double (t->label (0, N (t->label) - 1));
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_percentage ( tree  t)

Definition at line 281 of file env_length.cpp.

                       {
  return is_percentage (t, "%");
}

Here is the call graph for this function: