Re: r40049 - lyx-devel/trunk/src/support

2012-01-14 Thread Enrico Forestieri
On Fri, Oct 28, 2011 at 01:51:49PM +0200, for...@lyx.org wrote:

 Author: forenr
 Date: Fri Oct 28 13:51:48 2011
 New Revision: 40049
 URL: http://www.lyx.org/trac/changeset/40049
 
 Log:
 Detect the correct version of python at runtime and store the result
 for later calls. The check is only performed on the major version
 number, such as to avoid using python 3.

What about branch?

 Modified:
lyx-devel/trunk/src/support/Systemcall.cpp
lyx-devel/trunk/src/support/os.cpp
 
 Modified: lyx-devel/trunk/src/support/Systemcall.cpp
 ==
 --- lyx-devel/trunk/src/support/Systemcall.cppFri Oct 28 10:41:43 
 2011(r40048)
 +++ lyx-devel/trunk/src/support/Systemcall.cppFri Oct 28 13:51:48 
 2011(r40049)
 @@ -100,8 +100,13 @@
  int Systemcall::startscript(Starttype how, string const  what,
   std::string const  path, bool /*process_events*/)
  {
 - string command =
 - to_filesystem8bit(from_utf8(latexEnvCmdPrefix(path))) + what;
 + string const python_call = python -tt;
 + string command = to_filesystem8bit(from_utf8(latexEnvCmdPrefix(path)));
 +
 + if (prefixIs(what, python_call))
 + command += os::python() + what.substr(python_call.length());
 + else
 + command += what;
  
   if (how == DontWait) {
   switch (os::shell()) {
 @@ -162,9 +167,16 @@
   bool in_single_quote = false;
   bool in_double_quote = false;
   bool escaped = false;
 + string const python_call = python -tt;
   string cmd;
 + int start = 0;
 +
 + if (prefixIs(inputcmd, python_call)) {
 + cmd = os::python();
 + start = python_call.length();
 + }
  
 - for (size_t i = 0; i  inputcmd.length(); ++i) {
 + for (size_t i = start; i  inputcmd.length(); ++i) {
   char c = inputcmd[i];
   if (c == '\'') {
   if (in_double_quote || escaped) {
 
 Modified: lyx-devel/trunk/src/support/os.cpp
 ==
 --- lyx-devel/trunk/src/support/os.cppFri Oct 28 10:41:43 2011
 (r40048)
 +++ lyx-devel/trunk/src/support/os.cppFri Oct 28 13:51:48 2011
 (r40049)
 @@ -4,13 +4,19 @@
   * Licence details can be found in the file COPYING.
   *
   * \author Ruurd A. Reitsma
 + * \author Enrico Forestieri
   *
   * Full author contact details are available in file CREDITS.
   */
  
  #include config.h
  
 -#if defined(__CYGWIN__) || defined(__CYGWIN32__)
 +#include filetools.h
 +#include qstring_helpers.h
 +
 +#include QDir
 +
 +#if defined(__CYGWIN__)
  #include support/os_cygwin.cpp
  #elif defined(_WIN32)
  #include support/os_win32.cpp
 @@ -31,11 +37,57 @@
  namespace support {
  namespace os {
  
 +static string const python2(string const  binary, bool verbose = false)
 +{
 + if (verbose)
 + lyxerr  Examining   binary  \n;
 +
 + // Check whether this is a python 2 binary.
 + cmd_ret const out = runCommand(binary +  -V 21);
 + if (out.first  0 || !prefixIs(out.second, Python 2))
 + return string();
 +
 + if (verbose)
 + lyxerr  Found   out.second  \n;
 + return binary;
 +}
 +
 +
  string const python()
  {
 - // Use the -tt switch so that mixed tab/whitespace indentation is
 - // an error
 - static string const command(python -tt);
 + // Check whether the first python in PATH is the right one.
 + static string command = python2(python -tt);
 +
 + if (command.empty()) {
 + // It was not, so check whether we can find it elsewhere in
 + // PATH, maybe with some suffix appended.
 + vectorstring const path = getEnvPath(PATH);
 + vectorstring::const_iterator it = path.begin();
 + vectorstring::const_iterator const end = path.end();
 + lyxerr  Looking for python v2.x ...\n;
 + for (; it != end; ++it) {
 + QString const dir = toqstr(*it);
 + string const localdir = dir.toLocal8Bit().constData();
 + QDir qdir(dir);
 + qdir.setFilter(QDir::Files | QDir::Executable);
 + QStringList list = 
 qdir.entryList(QStringList(python*));
 + for (int i = 0; i  list.size()  command.empty(); 
 ++i) {
 + string const binary = addName(localdir,
 + list.at(i).toLocal8Bit().constData());
 + command = python2(binary, true);
 + }
 + }
 +
 + // Default to python if no usable binary was found.
 + if (command.empty()) {
 + lyxerr  Warning: No python v2.x binary found.\n;
 + command = python;
 + }
 +
 + // 

Re: r40110 - lyx-devel/trunk/src/support

2012-01-14 Thread Enrico Forestieri
On Mon, Oct 31, 2011 at 03:02:28AM +0100, for...@lyx.org wrote:

 Author: forenr
 Date: Mon Oct 31 03:02:27 2011
 New Revision: 40110
 URL: http://www.lyx.org/trac/changeset/40110
 
 Log:
 Properly account for output redirection with QProcess.

This is also needed in branch.

 Modified:
lyx-devel/trunk/src/support/Systemcall.cpp
lyx-devel/trunk/src/support/SystemcallPrivate.h
 
 Modified: lyx-devel/trunk/src/support/Systemcall.cpp
 ==
 --- lyx-devel/trunk/src/support/Systemcall.cppMon Oct 31 02:58:58 
 2011(r40109)
 +++ lyx-devel/trunk/src/support/Systemcall.cppMon Oct 31 03:02:27 
 2011(r40110)
 @@ -128,8 +128,10 @@
  namespace {
  
  /*
 - * This is a parser that (mostly) mimics the behavior of a posix shell but
 - * its output is tailored for being processed by QProcess.
 + * This is a parser that (mostly) mimics the behavior of a posix shell as
 + * regards quoting, but its output is tailored for being processed by 
 QProcess.
 + * Note that shell metacharacters are not parsed and only output redirection
 + * is taken into account.
   *
   * The escape character is the backslash.
   * A backslash that is not quoted preserves the literal value of the 
 following
 @@ -162,58 +164,67 @@
   *\a   -  \a
   *a\b -  ab
   */
 -string const parsecmd(string const  inputcmd, string  outfile)
 +string const parsecmd(string const  incmd, string  outfile, string  
 errfile)
  {
   bool in_single_quote = false;
   bool in_double_quote = false;
   bool escaped = false;
   string const python_call = python -tt;
 - string cmd;
 - int start = 0;
 + vectorstring outcmd(3);
 + size_t start = 0;
  
 - if (prefixIs(inputcmd, python_call)) {
 - cmd = os::python();
 + if (prefixIs(incmd, python_call)) {
 + outcmd[0] = os::python();
   start = python_call.length();
   }
  
 - for (size_t i = start; i  inputcmd.length(); ++i) {
 - char c = inputcmd[i];
 + for (size_t i = start, o = 0; i  incmd.length(); ++i) {
 + char c = incmd[i];
   if (c == '\'') {
   if (in_double_quote || escaped) {
   if (in_double_quote  escaped)
 - cmd += '\\';
 - cmd += c;
 + outcmd[o] += '\\';
 + outcmd[o] += c;
   } else
   in_single_quote = !in_single_quote;
   escaped = false;
   continue;
   }
   if (in_single_quote) {
 - cmd += c;
 + outcmd[o] += c;
   continue;
   }
   if (c == '') {
   if (escaped) {
 - cmd += \\\;
 + // Don't triple double-quotes for redirection
 + // files as these won't be parsed by QProcess
 + outcmd[o] += string(o ? \ : \\\);
   escaped = false;
   } else {
 - cmd += c;
 + outcmd[o] += c;
   in_double_quote = !in_double_quote;
   }
   } else if (c == '\\'  !escaped) {
   escaped = !escaped;
   } else if (c == ''  !(in_double_quote || escaped)) {
 - outfile = trim(inputcmd.substr(i + 1),  \);
 - return trim(cmd);
 + if (suffixIs(outcmd[o],  2)) {
 + outcmd[o] = rtrim(outcmd[o], 2);
 + o = 2;
 + } else {
 + if (suffixIs(outcmd[o],  1))
 + outcmd[o] = rtrim(outcmd[o], 1);
 + o = 1;
 + }
   } else {
   if (escaped  in_double_quote)
 - cmd += '\\';
 - cmd += c;
 + outcmd[o] += '\\';
 + outcmd[o] += c;
   escaped = false;
   }
   }
 - outfile.erase();
 - return cmd;
 + outfile = trim(outcmd[1],  \);
 + errfile = trim(outcmd[2],  \);
 + return trim(outcmd[0]);
  }
  
  } // namespace anon
 @@ -223,10 +234,14 @@
  int Systemcall::startscript(Starttype how, string const  what,
   string const  path, bool process_events)
  {
 + lyxerr  \nRunning:   what  endl;
 +
   string outfile;
 - QString cmd = QString::fromLocal8Bit(parsecmd(what, outfile).c_str());
 + string errfile;
 + QString cmd = QString::fromLocal8Bit(
 + 

Re: problem in LYX

2012-01-14 Thread Paul A . Rubin
אור כדראוי or.kadrawi at gmail.com writes:

 I don't know why, but when i try to click on tools-perfences alert window
apears and write in it unable to find the bind file.

Raw guess: somewhere (not sure where) you preferences were changed to point to a
nonexisting bind file (the bind file maps key combinations to commands), or
alternatively the preferences are correct and the bind file was somehow deleted.

What I would suggest is to (1) make sure that the cua.bind file (I think is the
installation default) is present (in /usr/share/lyx/bind on Linux, typically
C:\Program Files\something like LyX\bind on Windows), and then with LyX not
running (2) delete your home directory (usually ~/.lyx on Linux, maybe
C:\Documents and Settings\you\lyx20 on Win XP, maybe
C:\Users\you\AppData\Roaming\LyX2.0 on Windows 7) and start LyX.  LyX will
reconstruct the home directory.  Note that step (2) deletes all customizations
you did, so if you have custom layouts, menu files etc. stored in your home
directory you'll want to back them up first.

Paul



Bounding box for pstricks graphics with LyX

2012-01-14 Thread Andrew Parsloe
LyX 2.0.2 with its View other formatsPDF(ps2pdf) allows a LyX document 
with pstricks graphics to be compiled to pdf. That's a plus over LyX 
1.6.10. But it has also come at a cost. In LyX 1.6.10 (and earlier 
versions) I could create a document containing only an ERT inset and 
pstricks code like so:


\begin{TeXtoEPS}
\pspicture*(4,3)
\pspolygon(.5,.5)(3.5,.5)(.5,2.5)
\endpspicture
\end{TeXtoEPS}

Provided the preamble included

\usepackage{pstricks}
\usepackage{pst-eps}

this would compile with the View PS button to a postscript graphic 
contained in a bounding box of just a few centimetres per side. In LyX 
2.0.2 the pst-eps package and its TeXtoEPS environment seem to be 
ignored. The graphic compiles okay but the bounding box is now the whole 
page.


It would be very nice, developers, if the 1.6.10 behaviour could be 
restored (without losing the ps2pdf ability of course). I've found it 
extremely valuable to be able to create postscript graphics in LyX like 
this which are no bigger than they need to be. I realise I can crop a 
whole page graphic (in IrfanView for instance) to its natural size, 
but this should really be done at source, as is possbile with 1.6.10.


Andrew


Re: Bounding box for pstricks graphics with LyX

2012-01-14 Thread Liviu Andronic
On Sat, Jan 14, 2012 at 10:44 PM, Andrew Parsloe apars...@clear.net.nz wrote:
 LyX 2.0.2 with its View other formatsPDF(ps2pdf) allows a LyX document with
 pstricks graphics to be compiled to pdf. That's a plus over LyX 1.6.10. But
 it has also come at a cost. In LyX 1.6.10 (and earlier versions) I could
 create a document containing only an ERT inset and pstricks code like so:

 \begin{TeXtoEPS}
 \pspicture*(4,3)
 \pspolygon(.5,.5)(3.5,.5)(.5,2.5)
 \endpspicture
 \end{TeXtoEPS}

 Provided the preamble included

 \usepackage{pstricks}
 \usepackage{pst-eps}

 this would compile with the View PS button to a postscript graphic contained
 in a bounding box of just a few centimetres per side. In LyX 2.0.2 the
 pst-eps package and its TeXtoEPS environment seem to be ignored. The graphic
 compiles okay but the bounding box is now the whole page.

Not exactly an answer to your question, but this may help you [1]: a
humble attempt to add 'standalone equation editor' capabilities in
LyX. The method allows to generate cropped EPS and PDF documents
containing just about anything that LyX can output.

Regards
Liviu

[1] http://www.lyx.org/trac/ticket/7839



 It would be very nice, developers, if the 1.6.10 behaviour could be restored
 (without losing the ps2pdf ability of course). I've found it extremely
 valuable to be able to create postscript graphics in LyX like this which are
 no bigger than they need to be. I realise I can crop a whole page graphic
 (in IrfanView for instance) to its natural size, but this should really be
 done at source, as is possbile with 1.6.10.

 Andrew



-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail


RE: Patch for lyx.org PayPal donate call

2012-01-14 Thread Scott Kostyshak
Comments? Can others reproduce?

From: Scott Kostyshak
Sent: Monday, December 12, 2011 3:40 AM
To: lyx-devel@lists.lyx.org
Subject: Patch for lyx.org PayPal donate call

The donate PayPal button, accessed on http://www.lyx.org/Donate gave me a 
PayPal page in Norwegian. I don't know if others will be able to reproduce this 
because I think that PayPal tries to find out your language. If it fails to, I 
guess it defaults to the language of the destination of the payment. I would 
suggest this patch for all of the languages that lyx.org supports. The list of 
countries and their codes that should be passed to PayPal are located here: 
https://cms.paypal.com/us/cgi-bin/?cmd=_render-contentcontent_ID=developer/e_howto_api_nvp_country_codes

For English, the current html code for the PayPal call is
form method=post action=https://www.paypal.com/cgi-bin/webscr;
p
input type=hidden value=_xclick name=cmd
input type=hidden value=donati...@lyx.org name=business
input type=hidden value=Optional Note name=cn
input type=hidden value=EUR name=currency_code
input type=image alt=Make payments with PayPal - it's fast, free and 
secure! name=submit src=https://www.paypal.com/images/x-click-but04.gif;
/p
/form

I propose adding the following line:
input type=hidden value=US name=lc

so that the complete PayPal call would be
form method=post action=https://www.paypal.com/cgi-bin/webscr;
p
input type=hidden value=_xclick name=cmd
input type=hidden value=donati...@lyx.org name=business
input type=hidden value=Optional Note name=cn
input type=hidden value=EUR name=currency_code
input type=hidden value=US name=lc
input type=image alt=Make payments with PayPal - it's fast, free and 
secure! name=submit src=https://www.paypal.com/images/x-click-but04.gif;
/p
/form


Best,

Scott Kostyshak


Re: r40049 - lyx-devel/trunk/src/support

2012-01-14 Thread Enrico Forestieri
On Fri, Oct 28, 2011 at 01:51:49PM +0200, for...@lyx.org wrote:

> Author: forenr
> Date: Fri Oct 28 13:51:48 2011
> New Revision: 40049
> URL: http://www.lyx.org/trac/changeset/40049
> 
> Log:
> Detect the correct version of python at runtime and store the result
> for later calls. The check is only performed on the major version
> number, such as to avoid using python 3.

What about branch?

> Modified:
>lyx-devel/trunk/src/support/Systemcall.cpp
>lyx-devel/trunk/src/support/os.cpp
> 
> Modified: lyx-devel/trunk/src/support/Systemcall.cpp
> ==
> --- lyx-devel/trunk/src/support/Systemcall.cppFri Oct 28 10:41:43 
> 2011(r40048)
> +++ lyx-devel/trunk/src/support/Systemcall.cppFri Oct 28 13:51:48 
> 2011(r40049)
> @@ -100,8 +100,13 @@
>  int Systemcall::startscript(Starttype how, string const & what,
>   std::string const & path, bool /*process_events*/)
>  {
> - string command =
> - to_filesystem8bit(from_utf8(latexEnvCmdPrefix(path))) + what;
> + string const python_call = "python -tt";
> + string command = to_filesystem8bit(from_utf8(latexEnvCmdPrefix(path)));
> +
> + if (prefixIs(what, python_call))
> + command += os::python() + what.substr(python_call.length());
> + else
> + command += what;
>  
>   if (how == DontWait) {
>   switch (os::shell()) {
> @@ -162,9 +167,16 @@
>   bool in_single_quote = false;
>   bool in_double_quote = false;
>   bool escaped = false;
> + string const python_call = "python -tt";
>   string cmd;
> + int start = 0;
> +
> + if (prefixIs(inputcmd, python_call)) {
> + cmd = os::python();
> + start = python_call.length();
> + }
>  
> - for (size_t i = 0; i < inputcmd.length(); ++i) {
> + for (size_t i = start; i < inputcmd.length(); ++i) {
>   char c = inputcmd[i];
>   if (c == '\'') {
>   if (in_double_quote || escaped) {
> 
> Modified: lyx-devel/trunk/src/support/os.cpp
> ==
> --- lyx-devel/trunk/src/support/os.cppFri Oct 28 10:41:43 2011
> (r40048)
> +++ lyx-devel/trunk/src/support/os.cppFri Oct 28 13:51:48 2011
> (r40049)
> @@ -4,13 +4,19 @@
>   * Licence details can be found in the file COPYING.
>   *
>   * \author Ruurd A. Reitsma
> + * \author Enrico Forestieri
>   *
>   * Full author contact details are available in file CREDITS.
>   */
>  
>  #include 
>  
> -#if defined(__CYGWIN__) || defined(__CYGWIN32__)
> +#include "filetools.h"
> +#include "qstring_helpers.h"
> +
> +#include 
> +
> +#if defined(__CYGWIN__)
>  #include "support/os_cygwin.cpp"
>  #elif defined(_WIN32)
>  #include "support/os_win32.cpp"
> @@ -31,11 +37,57 @@
>  namespace support {
>  namespace os {
>  
> +static string const python2(string const & binary, bool verbose = false)
> +{
> + if (verbose)
> + lyxerr << "Examining " << binary << "\n";
> +
> + // Check whether this is a python 2 binary.
> + cmd_ret const out = runCommand(binary + " -V 2>&1");
> + if (out.first < 0 || !prefixIs(out.second, "Python 2"))
> + return string();
> +
> + if (verbose)
> + lyxerr << "Found " << out.second << "\n";
> + return binary;
> +}
> +
> +
>  string const python()
>  {
> - // Use the -tt switch so that mixed tab/whitespace indentation is
> - // an error
> - static string const command("python -tt");
> + // Check whether the first python in PATH is the right one.
> + static string command = python2("python -tt");
> +
> + if (command.empty()) {
> + // It was not, so check whether we can find it elsewhere in
> + // PATH, maybe with some suffix appended.
> + vector const path = getEnvPath("PATH");
> + vector::const_iterator it = path.begin();
> + vector::const_iterator const end = path.end();
> + lyxerr << "Looking for python v2.x ...\n";
> + for (; it != end; ++it) {
> + QString const dir = toqstr(*it);
> + string const localdir = dir.toLocal8Bit().constData();
> + QDir qdir(dir);
> + qdir.setFilter(QDir::Files | QDir::Executable);
> + QStringList list = 
> qdir.entryList(QStringList("python*"));
> + for (int i = 0; i < list.size() && command.empty(); 
> ++i) {
> + string const binary = addName(localdir,
> + list.at(i).toLocal8Bit().constData());
> + command = python2(binary, true);
> + }
> + }
> +
> + // Default to "python" if no usable binary was found.
> + if 

Re: r40110 - lyx-devel/trunk/src/support

2012-01-14 Thread Enrico Forestieri
On Mon, Oct 31, 2011 at 03:02:28AM +0100, for...@lyx.org wrote:

> Author: forenr
> Date: Mon Oct 31 03:02:27 2011
> New Revision: 40110
> URL: http://www.lyx.org/trac/changeset/40110
> 
> Log:
> Properly account for output redirection with QProcess.

This is also needed in branch.

> Modified:
>lyx-devel/trunk/src/support/Systemcall.cpp
>lyx-devel/trunk/src/support/SystemcallPrivate.h
> 
> Modified: lyx-devel/trunk/src/support/Systemcall.cpp
> ==
> --- lyx-devel/trunk/src/support/Systemcall.cppMon Oct 31 02:58:58 
> 2011(r40109)
> +++ lyx-devel/trunk/src/support/Systemcall.cppMon Oct 31 03:02:27 
> 2011(r40110)
> @@ -128,8 +128,10 @@
>  namespace {
>  
>  /*
> - * This is a parser that (mostly) mimics the behavior of a posix shell but
> - * its output is tailored for being processed by QProcess.
> + * This is a parser that (mostly) mimics the behavior of a posix shell as
> + * regards quoting, but its output is tailored for being processed by 
> QProcess.
> + * Note that shell metacharacters are not parsed and only output redirection
> + * is taken into account.
>   *
>   * The escape character is the backslash.
>   * A backslash that is not quoted preserves the literal value of the 
> following
> @@ -162,58 +164,67 @@
>   *"\a"   ->  "\a"
>   *"a\"b" ->  "a"""b"
>   */
> -string const parsecmd(string const & inputcmd, string & outfile)
> +string const parsecmd(string const & incmd, string & outfile, string & 
> errfile)
>  {
>   bool in_single_quote = false;
>   bool in_double_quote = false;
>   bool escaped = false;
>   string const python_call = "python -tt";
> - string cmd;
> - int start = 0;
> + vector outcmd(3);
> + size_t start = 0;
>  
> - if (prefixIs(inputcmd, python_call)) {
> - cmd = os::python();
> + if (prefixIs(incmd, python_call)) {
> + outcmd[0] = os::python();
>   start = python_call.length();
>   }
>  
> - for (size_t i = start; i < inputcmd.length(); ++i) {
> - char c = inputcmd[i];
> + for (size_t i = start, o = 0; i < incmd.length(); ++i) {
> + char c = incmd[i];
>   if (c == '\'') {
>   if (in_double_quote || escaped) {
>   if (in_double_quote && escaped)
> - cmd += '\\';
> - cmd += c;
> + outcmd[o] += '\\';
> + outcmd[o] += c;
>   } else
>   in_single_quote = !in_single_quote;
>   escaped = false;
>   continue;
>   }
>   if (in_single_quote) {
> - cmd += c;
> + outcmd[o] += c;
>   continue;
>   }
>   if (c == '"') {
>   if (escaped) {
> - cmd += "\"\"\"";
> + // Don't triple double-quotes for redirection
> + // files as these won't be parsed by QProcess
> + outcmd[o] += string(o ? "\"" : "\"\"\"");
>   escaped = false;
>   } else {
> - cmd += c;
> + outcmd[o] += c;
>   in_double_quote = !in_double_quote;
>   }
>   } else if (c == '\\' && !escaped) {
>   escaped = !escaped;
>   } else if (c == '>' && !(in_double_quote || escaped)) {
> - outfile = trim(inputcmd.substr(i + 1), " \"");
> - return trim(cmd);
> + if (suffixIs(outcmd[o], " 2")) {
> + outcmd[o] = rtrim(outcmd[o], "2");
> + o = 2;
> + } else {
> + if (suffixIs(outcmd[o], " 1"))
> + outcmd[o] = rtrim(outcmd[o], "1");
> + o = 1;
> + }
>   } else {
>   if (escaped && in_double_quote)
> - cmd += '\\';
> - cmd += c;
> + outcmd[o] += '\\';
> + outcmd[o] += c;
>   escaped = false;
>   }
>   }
> - outfile.erase();
> - return cmd;
> + outfile = trim(outcmd[1], " \"");
> + errfile = trim(outcmd[2], " \"");
> + return trim(outcmd[0]);
>  }
>  
>  } // namespace anon
> @@ -223,10 +234,14 @@
>  int Systemcall::startscript(Starttype how, string const & what,
>   string const & path, bool process_events)
>  {
> + lyxerr << "\nRunning: " << what << endl;
> +

Re: problem in LYX

2012-01-14 Thread Paul A . Rubin
אור כדראוי  gmail.com> writes:

> I don't know why, but when i try to click on tools->perfences alert window
apears and write in it "unable to find the bind file".

Raw guess: somewhere (not sure where) you preferences were changed to point to a
nonexisting bind file (the bind file maps key combinations to commands), or
alternatively the preferences are correct and the bind file was somehow deleted.

What I would suggest is to (1) make sure that the cua.bind file (I think is the
installation default) is present (in /usr/share/lyx/bind on Linux, typically
C:\Program Files\\bind on Windows), and then with LyX not
running (2) delete your home directory (usually ~/.lyx on Linux, maybe
C:\Documents and Settings\\lyx20 on Win XP, maybe
C:\Users\\AppData\Roaming\LyX2.0 on Windows 7) and start LyX.  LyX will
reconstruct the home directory.  Note that step (2) deletes all customizations
you did, so if you have custom layouts, menu files etc. stored in your home
directory you'll want to back them up first.

Paul



Bounding box for pstricks graphics with LyX

2012-01-14 Thread Andrew Parsloe
LyX 2.0.2 with its View other formats>PDF(ps2pdf) allows a LyX document 
with pstricks graphics to be compiled to pdf. That's a plus over LyX 
1.6.10. But it has also come at a cost. In LyX 1.6.10 (and earlier 
versions) I could create a document containing only an ERT inset and 
pstricks code like so:


\begin{TeXtoEPS}
\pspicture*(4,3)
\pspolygon(.5,.5)(3.5,.5)(.5,2.5)
\endpspicture
\end{TeXtoEPS}

Provided the preamble included

\usepackage{pstricks}
\usepackage{pst-eps}

this would compile with the View PS button to a postscript graphic 
contained in a bounding box of just a few centimetres per side. In LyX 
2.0.2 the pst-eps package and its TeXtoEPS environment seem to be 
ignored. The graphic compiles okay but the bounding box is now the whole 
page.


It would be very nice, developers, if the 1.6.10 behaviour could be 
restored (without losing the ps2pdf ability of course). I've found it 
extremely valuable to be able to create postscript graphics in LyX like 
this which are no bigger than they need to be. I realise I can crop a 
whole page graphic (in IrfanView for instance) to its "natural" size, 
but this should really be done at source, as is possbile with 1.6.10.


Andrew


Re: Bounding box for pstricks graphics with LyX

2012-01-14 Thread Liviu Andronic
On Sat, Jan 14, 2012 at 10:44 PM, Andrew Parsloe  wrote:
> LyX 2.0.2 with its View other formats>PDF(ps2pdf) allows a LyX document with
> pstricks graphics to be compiled to pdf. That's a plus over LyX 1.6.10. But
> it has also come at a cost. In LyX 1.6.10 (and earlier versions) I could
> create a document containing only an ERT inset and pstricks code like so:
>
> \begin{TeXtoEPS}
> \pspicture*(4,3)
> \pspolygon(.5,.5)(3.5,.5)(.5,2.5)
> \endpspicture
> \end{TeXtoEPS}
>
> Provided the preamble included
>
> \usepackage{pstricks}
> \usepackage{pst-eps}
>
> this would compile with the View PS button to a postscript graphic contained
> in a bounding box of just a few centimetres per side. In LyX 2.0.2 the
> pst-eps package and its TeXtoEPS environment seem to be ignored. The graphic
> compiles okay but the bounding box is now the whole page.
>
Not exactly an answer to your question, but this may help you [1]: a
humble attempt to add 'standalone equation editor' capabilities in
LyX. The method allows to generate cropped EPS and PDF documents
containing just about anything that LyX can output.

Regards
Liviu

[1] http://www.lyx.org/trac/ticket/7839



> It would be very nice, developers, if the 1.6.10 behaviour could be restored
> (without losing the ps2pdf ability of course). I've found it extremely
> valuable to be able to create postscript graphics in LyX like this which are
> no bigger than they need to be. I realise I can crop a whole page graphic
> (in IrfanView for instance) to its "natural" size, but this should really be
> done at source, as is possbile with 1.6.10.
>
> Andrew



-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail


RE: Patch for lyx.org PayPal donate call

2012-01-14 Thread Scott Kostyshak
Comments? Can others reproduce?

From: Scott Kostyshak
Sent: Monday, December 12, 2011 3:40 AM
To: lyx-devel@lists.lyx.org
Subject: Patch for lyx.org PayPal donate call

The donate PayPal button, accessed on http://www.lyx.org/Donate gave me a 
PayPal page in Norwegian. I don't know if others will be able to reproduce this 
because I think that PayPal tries to find out your language. If it fails to, I 
guess it defaults to the language of the destination of the payment. I would 
suggest this patch for all of the languages that lyx.org supports. The list of 
countries and their codes that should be passed to PayPal are located here: 
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content_ID=developer/e_howto_api_nvp_country_codes

For English, the current html code for the PayPal call is
https://www.paypal.com/cgi-bin/webscr;>





https://www.paypal.com/images/x-click-but04.gif;>



I propose adding the following line:


so that the complete PayPal call would be
https://www.paypal.com/cgi-bin/webscr;>






https://www.paypal.com/images/x-click-but04.gif;>




Best,

Scott Kostyshak