Re: How to insert a tabular array to LyX

2022-08-17 Thread Enrico Forestieri
On Sat, Jul 30, 2022 at 05:42:50PM +, tush via lyx-users wrote:
> 
> I want to insert a tblr environment (from the tabularray package) into my lyx 
> document.
> 
> I read that currently LyX supports only tabular environments for tables, and 
> not even tabularx.
> 
> But still I would like to get some thoughts or ideas from the members how to 
> insert (graphically, not through ERT) something like the following 
> environment:
> 
> >\begin{tblr}[t]{width=10cm,colspec={X[c]},rows={ht=2cm},hlines,vlines}
> >item 1
> >\\
> >item 2
> >\\
> >item 3
> >\end{tblr}
> 
> Thanks very much.

You could redefine the tabular environment used by LyX. However, you
cannot use the GUI for setting tabular properties. Another difficulty is
the fact that LyX uses \tabularnewline instead of \\ to end a line and,
seemingly, the tabularray package does not understand it. So you have
also to redefine \tabularnewline and remember to add \\ in ERT at the
end of each table line.

Arguments such as "width=10cm,colspec={X[c]},rows={ht=2cm},hlines,vlines"
can be passed through the "LaTeX argument" in the "Tabular Settings"
paying attention to avoid any space character.

See the attached example containing two examples in both ERT and a
somewhat LyXfied form as explained above. This last form is marginally
better than the ERT one.

-- 
Enrico
#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass article
\begin_preamble
\usepackage{tabularray,xcolor}
\renewenvironment{tabular}{\begin{tblr}[t]}{\end{tblr}}
\def\tabularnewline{\relax}
\end_preamble
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry true
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 1cm
\topmargin 2cm
\rightmargin 1cm
\bottommargin 2cm
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
begin{tblr}[t]{width=10cm,colspec={X[c]},rows={ht=2cm},hlines,vlines}
\end_layout

\begin_layout Plain Layout

item 1
\end_layout

\begin_layout Plain Layout


\backslash

\backslash

\end_layout

\begin_layout Plain Layout

item 2
\end_layout

\begin_layout Plain Layout


\backslash

\backslash

\end_layout

\begin_layout Plain Layout

item 3
\end_layout

\begin_layout Plain Layout


\backslash
end{tblr}
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset Tabular





\begin_inset Text

\begin_layout Plain Layout
item 1
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash

\backslash

\end_layout

\end_inset


\end_layout

\end_inset




\begin_inset Text

\begin_layout Plain Layout
item 2
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash

\backslash

\end_layout

\end_inset


\end_layout

\end_inset




\begin_inset Text

\begin_layout Plain Layout
item 3
\end_layout

\end_inset




\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
begin{tblr}{
\end_layout

\begin_layout Plain Layout

colspec = {rX}, colsep = 8mm, hlines = {2pt, white},
\end_layout

\begin_layout Plain Layout

row{odd} = {azure8}, row{even} = {gray8},
\end_layout

\begin_layout Plain Layout

row{1} = {6em,azure2,fg=white,font=
\backslash
LARGE
\backslash
bfseries
\backslash
sffamily},
\end_layout

\begin_layout Plain Layout

row{2-Z} = {3em,font=
\backslash
Large},
\end_layout

\begin_layout Plain Layout

}
\end_layout

\begin_layout Plain Layout

Tabularray & Typeset Tabulars and Arrays with 
\backslash
LaTeX3 
\backslash

\backslash

Re: How to set optional argument for aligned?

2019-03-30 Thread Enrico Forestieri
On Fri, Mar 29, 2019 at 10:20:54AM +0100, Daniel wrote:
> Is it possible to set an optional argument, e.g. [t] for aligned? For
> example, so that the equation aligns at the top with the equation number in
> the attachment.

Yes, it is possible as follows.

1. Copy the content of the math inset (not the inset itself) and
   paste it outside of any math inset.
2. Now add [t] at the proper place.
3. Select all the formula (which now should appear as
   \begin{aligned}[t]y & =x\cdot x\\ & =x^{2}\end{aligned})
   and hit Ctrl+M or paste it in a math inset.

See attached for the end result.

-- 
Enrico
#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass article
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Enumerate

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\strikeout off
\xout off
\uuline off
\uwave off
\noun off
\color none
\begin_inset Formula $\begin{aligned}[t]y & =x\cdot x\\
 & =x^{2}
\end{aligned}
$
\end_inset


\end_layout

\end_body
\end_document


LyX 2.2 cannot read a document from LyX 2.1?

2017-03-06 Thread Enrico Forestieri
Matěj Cepl wrote:
> Yes, this is not a minimal example, but I am hesitant to touch this
> document from LyX 2.1 so that I wouldn’t accidentally fixed it. When
> trying to open it with lyx-2.2.2-1.fc25.x86_64 I get this:
>
> matej@mitmanek: marketa$ lyx Ph.D.project-Brno1.lyx
> Error: Document format failure
> 
> /tmp/lyx_tmpdir.CLmZrzV11492/Buffer_convertLyXFormatk11492.lyx is not a
> readable LyX document.
> matej@mitmanek: marketa$
>
> Any ideas, what's wrong?

Your .lyx file starts with a byte order mark U+FEFF and lyx2lyx doesn't
expect it.
Use a binary editor to get rid of it. Alternatively, load it with lyx
2.2 and wait
for the failure. Then edit the problematic converted file (it would be
/tmp/lyx_tmpdir.CLmZrzV11492/Buffer_convertLyXFormatk11492.lyx
in your previous attempt) with a text editor, delete the *second* line and
save it with a new name. You should now be able to load it with lyx 2.2.


Re: Lyx doesn't compile but Export Tex then pdfLatex does

2015-07-15 Thread Enrico Forestieri
Gilles Moyse writes:

> Thank you Scott for your answer. Indeed, I forgot to remove the code
> from the preamble, sorry for that. Moreover, since you told me that ERT
> and relative paths could be the key, I removed the "\includegraphics"and
> replaced them include the graphics with its Lyx version through Insert /
> Graphics, and it worked under Windows.
> 
> To conclude, relative paths in ERT work correctly with Linux, not with
> Windows, which is somewhat related to the bug 
> http://www.lyx.org/trac/ticket/1751

I rather think that you are hit by http://www.lyx.org/trac/ticket/9453
which should be fixed in lyx 2.1.4.

-- 
Enrico



Re: Figure Float Placement: Many Figures, Many Small Subsections

2015-05-27 Thread Enrico Forestieri
Rich Shepard writes:
> 
> On Wed, 27 May 2015, Nikos Alexandris wrote:
> 
> > Do the
> >
> > Document > Settings > Float Placement > "Here if possible"  or  "Here
> > definitely"
> >
> > options help?
> 
> Nikos,
> 
>Not so far. I'm still playing with them, but I get the maximum number
> of figures allowed in a section, then no graphic is displayed. That's
> because they're all in the same section of the document. I suppose I can
> expand each portion into a section of its own. Maybe.

Note that latex allows only a fixed number of floats per page. By default,
this is 3 but this number is stored in a counter and it can be changed.
Try whether putting
\setcounter{totalnumber}{10}
in the preamble helps. It may or may not succeed, depending on the vertical
space occupied by the floats. There are also other style parameters that
may help:

topnumber: (counter) maximum number of floats allowed at the top of a page.
\topfraction: maximum fraction of the page that can be occupied by floats
  at the top of the page. A value of 0.25 means the top quarter.
bottomnumber: (counter) same as topnumber except for the bottom of the page.
\bottomfraction: same as \topfraction except for the bottom of the page.
\texfraction: the minimum fraction of a page the must be devoted to text.
  The other 1-\textfraction may be occupied by floats.

As an example:
\setcounter{totalnumber}{10}
\setcounter{topnumber}{5}
\setcounter{bottomnumber}{5}
\def\topfraction{1}
\def\bottomfraction{1}
\def\textfraction{0}

allows placing up to 10 floats on a page (if they fit), even at the cost
of not outputting any text on that page. There are also other parameters
that can be tuned, such the spacing between text and floats, but I don't
remember what they are. I think you can find them in a good latex book.

HTH

-- 
Enrico



Re: "Problem" environment

2015-05-21 Thread Enrico Forestieri
On Thu, May 21, 2015 at 09:24:13PM +0200, Jürgen Spitzmüller wrote:
> 2015-05-21 20:18 GMT+02:00 Enrico Forestieri :
> 
> > Richard Heck writes:
> > >
> > > Has someone put this in the docs? It's an improvement, for sure, but it
> > > will take some
> > > getting used to for us old-timers, I think.
> >
> > I did that.
> >
> 
> I also think a short note in the RELEASE-NOTES (with reference to this doc
> section) would be in order.

You're right. Done.

-- 
Enrico


Re: "Problem" environment

2015-05-21 Thread Enrico Forestieri
Richard Heck writes:
> 
> Has someone put this in the docs? It's an improvement, for sure, but it 
> will take some
> getting used to for us old-timers, I think.

I did that.

-- 
Enrico



Re: error in trying to archive a lyx file

2015-05-14 Thread Enrico Forestieri
Richard Heck  lyx.org> writes:
> 
> On 05/14/2015 08:00 AM, Wolfgang Engelmann wrote:
> >
> > is not a LyX document???
> > This is strange, since normal export to pdf works. And I had this 
> > error never before, although I worked with the file for quite some time.
> > What is lyxpak.py doing?
> 
> That is the script that makes archives. For some reason it is failing to 
> read your file.
> 
> > Has anybody an idea what went wrong?

Most probably you saved the file in compressed format and the script
does not expect that.

-- 
Enrico



Re: "Problem" environment

2015-05-13 Thread Enrico Forestieri
Scott Kostyshak writes:
> 
> For master branch, we have:
> "To split an existing list into two lists, set the cursor at the end
> of a list item, press Return and select –Separator– in the pull-down
> box for environments in LyX's main toolbar."
> 
> But I don't think we have --Separator-- in the pull-down box anymore.
> Can this be done with Edit > Start New Environment?

Yes.

> Note that there is still the LFUN separator-insert but I don't think
> we have a graphical way to insert it. Is that expected?

Yes.

> Actually, what
> is the use case for needing separator-insert? I'm sure there is one
> since it is called in LFUN_PARAGRAPH_BREAK, but I do not know it.

It is used to separate environments. You can do it using
Edit > Start New Environment, but you don't need using the menu.
You start a "Problem" environment and write something. If you want
to start a new "Problem" environment, hit the "Enter" key and go to a
standard environment, hit again the "Enter" key and LyX automatically
inserts a parbreak separator. Now you can start any other environment.

The parbreak separator will insert a blank line in the latex output.
If you don't want that, use the context menu to change it to a plain
separator. This kind of separators are automatically inserted when
needed in a hopefully intuitive way. If you hit "Enter" in a standard
environment after a non-standard one, you get a separator and you
are ready to insert again the same non-standard environment.

The small arrow you see, plays the same role of the old --Separator--
and behaves in the same way, because it leaves a blank line in the latex
output. However, now you can also avoid that blank line by turning the
parbreak into a plain separator.

> Also, in aqua.bind, we have a binding for "menu-separator-insert".
> This LFUN does not seem to exist. Can I remove it or should it be
> corrected to something else?

Don't know about this one.

-- 
Enrico

Re: Windows 7 - Where does Lyx stores my user interface configuration?

2015-05-06 Thread Enrico Forestieri
Richard Heck writes:
> 
> On 05/06/2015 05:36 PM, Gilles Moyse wrote:
> > Hi.
> >
> > Following this post 
> > (http://article.gmane.org/gmane.editors.lyx.general/84619), I am 
> > looking for the location of the file where Lyx stores my user 
> > interface configuration under Windows 7.
> 
> Try Help> About LyX. The dialog will tell you where the user directory is.

I think he is talking about the GUI settings. Their location is OS
dependent. On Windows, the settings are stored in the system registry
in HKCU\Software\LyX, while on cygwin and unix systems in the user home dir
in ~/.config/LyX/lyx.conf. Not sure about Macs.

-- 
Enrico



Re: lyx archive

2015-04-12 Thread Enrico Forestieri
Wolfgang Engelmann writes:
> 
> Is there a better way of getting all figures/tables in the same folder 
> so that the tar.gz has no subtrees?
> I often get figures from other folders/subfolders (e.g. by a colleague) 
> which especially with larger documents I notice not before I have 
> archived (>file>export>lyx archive) the document.
> If so, I copy these files in the main folder. However, lyx remembers the 
> former path(es) and does not find the copied one. What I do is to open 
> the lyx file with an editor and remove the (now wrong) paths, which is 
> easier than going through the individual items changing paths in lyx.
> I just wonder, whether there is a lyx way of doing it (so to speak, 
> resetting the paths to a default - the figure only).

No, there is currently no way to do that within LyX. Note that this is
not a problem with a lyx archive only. If you have figures outside the
document dir and you try to export to latex, if a figure needs to be
converted to a format the particular latex flavor can handle, the
converted figure is placed alongside the original one. So, for example,
if you reference a figure in a directory where you don't have write
permission, the export fails. All of this could be handled by adding a
submenu entry (maybe in the "Document" menu) "Copy files to document dir"
(or something along that line). This would cause LyX to scan all used
files and copy those outside the document dir to a common subdir named
-files, updating also the internal paths. In this way, both
export and archive will produce a self-contained subtree.
Please, feel free to file an enhancement request at
http://www.lyx.org/trac/wiki/BugTrackerHome.



Re: Compiling and creating thesis template

2015-04-11 Thread Enrico Forestieri
Steve Burnham writes:
> 
> For whatever reason it seems that my installation of LyX on Windows won’t
> use local .sty files and only ones that are in the MiKTeX folders where as
> on Unix based operating systems it will. I don’t know if this is the case
> for all of Windows or not.  All the more reason to use Linux or OS X.

This is a known bug in 2.1.3 (see http://www.lyx.org/trac/ticket/9453)
and will be fixed in the next release.

-- 
Enrico

Re: Reference Problem Redux

2015-03-05 Thread Enrico Forestieri
Enrico Forestieri writes:
> 
> If so, you can try applying the patch at
> http://www.lyx.org/trac/changeset/417c233d/lyxgit
> 
> In this case, it is very easy. You only need editing the configure.py file
> in your LyX installation (it is a text file) and change the lines marked
> in red as shown in the lines marked in green (they are only two lines and
> there may be a slight mismatch in the line numbers, as that patch refers
> to the development version).

It just occurred to me that a simpler option exists. After navigating to
the temporary directory, click on the .tex file but don't hit the "Open"
button or the "Enter" key. Rather, go to the location where the filename
was copied in the file browser, change the extension from .tex to .bbl
and then hit "Open". Even if you cannot see it, the file is there (if you
followed the previous steps) and will be opened.

-- 
Enrico






Re: Reference Problem Redux

2015-03-05 Thread Enrico Forestieri
Scott Kostyshak writes:
> 
> On Wed, Mar 4, 2015 at 11:26 PM, William Hanson wrote:
> > Enrico,
> >
> > I can get through step 4 of your instructions, but I'm stymied at step 5.
> > If I'm doing things correctly, at the end of step 4 I'm in LyX looking
> > at my
> > document. But there is no "Show all files" option under the File menu in
> > LyX.  Or do you mean something other than the File menu by "the file
> > dialog"?
> 
> Hi William,
> 
> I don't use Windows, but I believe he means using your file browser.

Yes, exactly. More precisely, the file browser opened by LyX. I now tried
it on a native Windows version of LyX and that option exists. However,
I was not able to perform step 6, because I am apparently hit by
http://www.lyx.org/trac/ticket/9235, even though that bug was only
reported against the development version. If this is also the case for you
(I am not sure this is something affecting only my own build and usage of
LyX on a mixed cygwin/windows environment), please report it at that ticket.

If so, you can try applying the patch at
http://www.lyx.org/trac/changeset/417c233d/lyxgit

In this case, it is very easy. You only need editing the configure.py file
in your LyX installation (it is a text file) and change the lines marked
in red as shown in the lines marked in green (they are only two lines and
there may be a slight mismatch in the line numbers, as that patch refers
to the development version).

-- 
Enrico




Re: Reference Problem Redux

2015-03-03 Thread Enrico Forestieri
William Hanson writes:
> 
> Dear All,  Last summer Stefano Franchi did something  for me that I was
> unable do.  He created a tex file out of a lyx file and a bib file.
> I'm in the same bind again.  The problem, then and now, is that when I try
> to create a tex file of my LyX document, the resulting tex file does not
> contain the References that are in the original LyX document.  (All the
> references are from BiBtex.  Following Stefano's instructions, I have the
> document itself (a lyx file) and my Bibtex database (a bib file) in the
> same folder--under My Documents in Windows 7).
> 
> When I use LyX to create a tex file (by selecting File -> Export -> LaTeX
> (plain)),  I get an error message saying that the filename "... can cause
> troubles when running the exported file through LaTeX and opening the
> resulting DVI".  If I ignore this warning and press on, I get another error
> message that says, "There are spaces in the paths to your BibTeX database.
> BibTeX will be unable to find them".  (The only space in the path in
> question is between "My" and "Documents" in "My Documents".  I've tried
> closing this space by renaming "My Documents" in Windows 7 as
> "MyDocuments", but it doesn't help.  I still get the same two error
> messages.)  If I ignore this second warning and continue I get a tex file
> of the document itself but without any of the references.
>
> What should I do?

Try the following procedure:
1) Start LyX and preview your document (generate a pdf).
2) Go to Tools->Preferences->Paths and take note of the
   "Temporary directory" location.
3) Select File->Import->LaTeX (plain) and navigate to the
   "Temporary directory" location.
4) Enter the directory whose name starts with "lyx_tmpdir" and then
   the subdirectory named lyx_tmpbuf0 (you may have more than one,
   lyx_tmpbuf1, lyx_tmpbuf2, etc., each one corresponding to a different
   document).
5) Select "Show all files" in the file dialog and choose the file whose
   name is the same as that of your document but with extension .bbl.
6) If tex2lyx does its job, you will now have your bibliography in LyX
   format in another tab. Copy everything and paste it in place of
   the "BibTeX Generated Bibliography" inset in your document.
7) You can now export to latex with complete references.

HTH

-- 
Enrico


Re: Update DVI (lyx v 2.0.6 in Win 7 x64 )

2014-09-28 Thread Enrico Forestieri
Josh McSorley writes:
> 
> Yes I see tons of posts you are right!
> I am guessing yap locking is my problem.
> Do you know a solution to this (could not see one in any of the threads I
> read), or should I simply be using another previewer?

If you really need dvi output, you are pretty much stuck, unless you
are willing to try TeXLive and its dvi previewer. Otherwise, I suggest
using SumatraPDF and previewing the documents as pdf.

-- 
Enrico




Re: Update DVI (lyx v 2.0.6 in Win 7 x64 )

2014-09-25 Thread Enrico Forestieri
Josh McSorley writes:
> 
> Additional note:
> I do not have spaces in folder or file names so this is not the source of
> the problem (some folks in earlier trheads have discussed this
> 
> If this is known problem with LyX (or MikTex), even if there is no solution
> (or it requires an update), if someone can let me know that would be great.

The problem is that yap locks the dvi file and the script cannot access it.
If you google for "yap locks dvi file" you'll get tons of hits.

-- 
Enrico





Re: KOMA-script article does not compile

2014-09-16 Thread Enrico Forestieri
Annaert Jan writes:

> When I try to compile a KOMA-script article document with numbered
> sections, I always get the errors
> 
> Extra \else. 
> Extra \fi.

This is a known bug in KOMA-script:
http://tex.stackexchange.com/questions/166779/koma-script-throws-extra-else-error

-- 
Enrico



Re: LyX 2.1.1 and Cygwin64?

2014-09-16 Thread Enrico Forestieri
On Tue, Sep 16, 2014 at 02:46:03PM -0400, Bert Lloyd wrote:
> On Tue, Sep 16, 2014 at 12:03 PM, Richard Heck  wrote:
> > On 09/14/2014 08:29 AM, Bert Lloyd wrote:
> >>
> >> Hi all,
> >>
> >> Will the current Cygwin binary (link below) work with Cygwin64? Any
> >> tweaks to the installation process?
> >
> >
> > There was some sort of compatibility issue with 64-bit Cygwin that has been
> > fixed for 2.1.2,
> > which should be released in a few days.
> >
> > Enrico will know more, so I'll cc him.
> >
> > Richard
> >
> 
> Thanks, this is great to hear. I can certainly wait for 2.1.2.

Actually, that binary should also work with Cygwin64. You have to use
the setup-x86_64.exe installation tool to get the 64bit version.

-- 
Enrico


Re: defective rendering of table in PDF

2014-08-07 Thread Enrico Forestieri
Will Parsons writes:

> Thanks for the suggestion, but I have managed to solve the problem as
> I've described above.  I am curious, though, why you think it mightn't
> be a LyX bug?  Or are you suggesting that even if I'd created the
> table using LaTeX directly I might have gotten the same result?

Yes, I meant the last thing. If it was documented that \hline does not
work in a tabular* environment when using the multirow package and that
in this case one should always use \cline, then it would have been a
LyX bug. Since I cannot see such a statement in the multirow docs, I
don't think it is a LyX bug, because LyX is doing the right thing here
(directly working with LaTeX, I would have written the table exactly
like LyX does and I would have incurred in the exact same problem).

-- 
Enrico



Re: defective rendering of table in PDF

2014-08-04 Thread Enrico Forestieri
Benedict Holland writes:
> 
> I really do not typically recommend that you learn Latex this but in
> this specific situation, I have not found a great way to use Lyx.
> Tables in Latex are trivial to set up. They are also fully customizable
> and once you get use to them, they are really easy to write well.
> Tables is the single thing I can only recommend that you just learn
> how to write in Latex. It removes lots of problems. 

I don't think this holds in this specific case. In LaTeX, I would have
written the table exactly as LyX does (which is similar to many examples
in the multirow package documentation) and would have incurred in the
exact same problem. You should learn LaTeX well above what is necessary
for using it with LyX to be able to solve such issues.

-- 
Enrico



Re: defective rendering of table in PDF

2014-08-04 Thread Enrico Forestieri
Will Parsons writes:
> 
> Scott Kostyshak wrote:
> >
> > Hi Will,
> >
> > Thanks for the report. This does indeed seem like a LyX bug. Borders
> > are tricky to get right. Can you write instructions for how to
> > reproduce the table? Did you do it in LyX or did you import a .tex
> > file?
> 
> I created it in LyX.  I don't know if I can recreate the steps I took,
> but I'll see if I can.
> 

I don't know whether this is really a LyX bug or not, but you can
workaround the issue as follows:

1) Put the cursor just before the table and enter in ERT the following:
   {\def\hline{\cline{1-4}}
2) Put the cursor just after the table and again enter in ERT:
   }
   i.e., a single closing brace that pairs with the first one above.
3) The table should now typeset correctly.

The opening and closing braces limit the scope of the redefintion
of \hline to that single table. If you have other tables, you will
have to repeate the procedure for each one of them, maybe adjusting
the argument of \cline if they have a different number of columns.

HTH

-- 
Enrico





Re: date format

2014-07-19 Thread Enrico Forestieri
Will Parsons writes:
> 
> Will Parsons wrote:
> > In a document I'm writing, I would like to print the date of the last
> > edit in the title page.  I've discovered [Insert => Date], which looks
> > like it might be what I want (does it update when I save the document
> > again?), but the format is "07/16/14", which is a common format for
> > North America (which is where I am), but I would prefer a different
> > format, preferably "14 June 2014", or even the ISO standard
> > "2014-07-14", but I can't figure out how to adjust this.  Is this
> > configurable via LyX, or do I have to do some LaTeX magic?
> 
> Of course, what I meant was '"16 June 2014", or even the ISO standard
> "2014-07-16"', (which I guess illustrates that even *I* find the
> format "07/16/14" confusing, used to it though I am...

The format of the date is fully configurable through conversion specifiers in
Tools->Preferences->Output->General->Date format.
The default conversion spec is %x, which gives the locale's representation.
If you are on linux, you can access the conversion specifiers through
"man strftime", otherwise you can read them online at
http://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html

In your case, you want either "%e %b %Y" or "%Y-%m-%d".

-- 
Enrico



Re: multiple paragraphs in a table cell

2014-07-15 Thread Enrico Forestieri
Will Parsons  nodomain.invalid> writes:
> 
> Enrico Forestieri wrote:
> > Scott Kostyshak writes:
> >> 
> >> Another idea is to use a minipage. Go to Insert > Box > Frameless.
> >> Then try putting vertical space in (Insert > Formatting > Vertical
> >> Space).
> >
> > No, this will not work because in a tabular environment \parskip is
> > reset (actually, even \par is redefined). You have to insert
> > \setlength{\parskip}{\bigskipamount}
> > in ERT at the start of the cell.
> 
> I can't say I'm delighted at this solution, since it seems like a bit
> of magic (I didn't even know what ERT was), but it *does* work.  So,
> thank you - I think my problem is solved (even if in not quite the
> straightforward way I would have liked).

If you are concerned about the open ERT, you could close it or, if you
don't want to even see it, I can suggest some other dark magic ;)
Place the cursor in the cell and open the table settings.
In the text field of the "LaTeX argument" entry, insert
  >{\setlength{\parskip}{\bigskipamount}}p{4in}
and then apply.
Change \bigskipamount and 4in (this is the cell width) as you like.
This has the added advantage that you paragraphs will also be justified.

-- 
Enrico





Re: multiple paragraphs in a table cell

2014-07-15 Thread Enrico Forestieri
Scott Kostyshak writes:
> 
> Thanks for the correction, Enrico.

Actually, it's me who should stand corrected ;)

-- 
Enrico





Re: multiple paragraphs in a table cell

2014-07-15 Thread Enrico Forestieri
Enrico Forestieri writes:
> 
> Scott Kostyshak writes:
> > 
> > Another idea is to use a minipage. Go to Insert > Box > Frameless.
> > Then try putting vertical space in (Insert > Formatting > Vertical
> > Space).
> 
> No, this will not work because in a tabular environment \parskip is
> reset (actually, even \par is redefined). You have to insert
> \setlength{\parskip}{\bigskipamount}
> in ERT at the start of the cell.
> 

Sorry, I should have read until the end and not simply stopping at the
minipage suggestion. Yes, that would be another way, but reestablishing
the parskip is more handy.

-- 
Enrico



Re: multiple paragraphs in a table cell

2014-07-15 Thread Enrico Forestieri
Will Parsons writes:
> 
> Yes, it does succeed in separating the paragraphs, but the text of the
> paragraph in the box spills out of the bounds of the table when
> converted to PDF.  Ouch!

You have to adjust the width of the minipage.

-- 
Enrico



Re: multiple paragraphs in a table cell

2014-07-15 Thread Enrico Forestieri
Scott Kostyshak writes:
> 
> Another idea is to use a minipage. Go to Insert > Box > Frameless.
> Then try putting vertical space in (Insert > Formatting > Vertical
> Space).

No, this will not work because in a tabular environment \parskip is
reset (actually, even \par is redefined). You have to insert
\setlength{\parskip}{\bigskipamount}
in ERT at the start of the cell.

-- 
Enrico




Trouble reading EMF and EPS graphic files

2014-06-14 Thread Enrico Forestieri
On Thu, Jun 12, 2014 at 11:34 AM, Samuel Gamtessa wrote:
> Hello,
>
> I have encountered a strange problem that I never did before.
>
> The graphic files in .eps and .emf files are not properly read anymore,
> showing a message "error connecting to a readable format"
>
> I have never encountered this previously except that on a mac, I needed a
> separate software called "eps to pdf." I am working on a pc currently
and I
> did not face this trouble previously.
>
> What might cause such a problem?

If you use LyX 2.1.0, then this is a known problem. Specifically, LyX is not
able anymore to show a preview for certain kind of EPS and other file
formats, including EMF. The fix for this issue will be included in
version 2.1.2,
unless there are explicit requests for including it in 2.1.1, I presume.
See http://www.lyx.org/trac/ticket/9146

-- 
Enrico


Re: How to tell LyX to add empty line after paragraphs of my style?

2014-05-22 Thread Enrico Forestieri
On Thu, May 22, 2014 at 01:44:44PM -0400, Richard Heck wrote:
> On 05/21/2014 05:46 PM, Enrico Forestieri wrote:
> >> (For display maths, the presence of white space
> >> around it is almost invisible in the LyX window while it has a profound
> >> effect in the output.)
> >
> >Yes, this is really a bugger and the only way to recognize it is activating
> >the end of paragraph marker in the preferences. If you see a pilcrow mark
> >before the math inset it means that a blank line will be output. Placing the
> >cursor just before the math inset and hitting the backspace key gets rid of 
> >it.
> >It's easier to get aware of a blank line after the math inset by the fact the
> >following text is indented.
> 
> Would it be worth our outputting a pilcrow in such cases? or some other
> visual indication? Maybe more vertical space, as one will get in the PDF?

I don't think that increasing the vertical space is a clear indicator
and that would also be a waste of screen space. On the other hand, it
seems odd outputting a pilcrow only in this case. Maybe a *small* vertical
double arrow like those used for inserting a vertical space is more
eye catching, or, perhaps, an arrow like the parbreak separator.

-- 
Enrico


Re: How to tell LyX to add empty line after paragraphs of my style?

2014-05-21 Thread Enrico Forestieri
 
<http://www.mail-archive.com/search?l=lyx-users@lists.lyx.org&q=from:%22Guenter+Milde%22>Guenter
 Milde writes:
> On 2014-05-17, Enrico Forestieri wrote:
> > Roman Inflianskas writes:
> 
> >> Thank you, it works and looks better, than -separator-.
> 
> > Just for information. This issue is solved for the next major release (2.2).
> > To achieve your goal you can either simply hit  after an environment
> > or use a local layout with NextNoIndent set to false, as you already did
> > (but now it will work).
> 
> Thanks a lot. This solves a long standing problem.
> 
> How is the visual feedback?

You get a small arrow, similar to the one obtained with Ctrl+Enter but
blue instead of red, standing on its own line. This will also be one way
to separate environments: a double  gets you out of an environment
and a third one introduces this new "separator", after which you can repeat
the same environment as the previous one. You will have a blank line in the
output but, if this is not wanted, with a right click you can change this to
a "plain" separator. Visually, the blue arrow will change to a small red
line segment which produces nothing in the output (you will actually have
the blank line commented out by '%' sign, so this is really equivalent
to a space).

This cannot be backported because it is a file format change, but the
NextNoIndent glitch has been fixed also for LyX 2.1.1, so the example
of the OP will also work.

> (For display maths, the presence of white space
> around it is almost invisible in the LyX window while it has a profound
> effect in the output.)

Yes, this is really a bugger and the only way to recognize it is activating
the end of paragraph marker in the preferences. If you see a pilcrow mark
before the math inset it means that a blank line will be output. Placing the
cursor just before the math inset and hitting the backspace key gets rid of it.
It's easier to get aware of a blank line after the math inset by the fact the
following text is indented.

-- 
Enrico



Re: How to tell LyX to add empty line after paragraphs of my style?

2014-05-17 Thread Enrico Forestieri
Roman Inflianskas writes:
> 
> Thank you, it works and looks better, than -separator-.

Just for information. This issue is solved for the next major release (2.2).
To achieve your goal you can either simply hit  after an environment
or use a local layout with NextNoIndent set to false, as you already did
(but now it will work).

-- 
Enrico



Re: LyX and Cygwin

2014-05-05 Thread Enrico Forestieri
On Mon, May 05, 2014 at 11:13:18AM -0400, Bert Lloyd wrote:

> Thanks again for your advice.
> 
> I am having a few issues with installation:
> 
> In step 4 of the installation instructions ("In the "Select Packages"
> view...") I did not initially see lyx and related packages. After
> clicking "View" a few times until "Not Installed" was displayed, the
> relevant packages were displayed (lyx, lyxdict, etc, although not
> LyXwin as stated in step 4).
> 
> When installing, I then got popup messages from Cygwin setup "Can't
> open (null) for reading: No such file" while setup was installing
> cygspawn-1.0.0-2-src, dtltools-0.6.2-src, dvipost-1.1-4-src,
> latex2rtf-1.9.17-2.src, lyxsupport-2.0-src.
> 
> Finally, lyx still finds my windows installation rather than the new
> cygwin version:
> $ lyx -version
> LyX 2.0.8 (2014-04-14)
> Built on Apr 15 2014, 23:03:32
> CMake Build
> 
> 
> I'm assuming I need to edit the cygwin PATH variable, since this still 
> includes
> /cygdrive/c/Program Files (x86)/LyX 2.0/bin
> however, I can't find the right directory in cygwin, i.e.
> /usr/local/share/lyx/ does not exist, nor can I find lyx.exe,
> lyxwin.exe, or any lyx directory in my cygwin installation. I'm not
> sure that I've looked everywhere, but I have looked everywhere I can
> think of, including
> C:\cygwin64\bin
> C:\cygwin64\etc
> C:\cygwin64\lib
> C:\cygwin64\usr
> C:\cygwin64\usr\local
> C:\cygwin64\usr\share
> 
> which leads me to suspect my installation was not successful after all.
> 
> Any suggestions?

>From what you write above, I suspect that you installed the 64 bit version
of Cygwin, while that package was built for the 32 bit version.
If you don't have a specific need for the 64 bit version, you can try
installing the 32 bit version. I am sorry but I don't have cygwin64
and can't build a 64 bit version of the package ATM, because I still
use an old 32 bit laptop for working in Windows.

-- 
Enrico


Re: LyX and Cygwin

2014-05-03 Thread Enrico Forestieri
On Sat, May 03, 2014 at 10:42:12AM -0400, Bert Lloyd wrote:
> 
> On Fri, May 2, 2014 at 10:40 PM, Enrico Forestieri  wrote:
> > Bert Lloyd writes:
> >>
> >> 1. Add my current Windows installation of LyX and MikTeX to my Cygwin
> >> PATH variable, so cygwin can find lyx.exe, etc.
> >
> > This works provided that you take into account that a native version
> > of LyX cannot use neither scripts nor commands that are symlinks.
> > If you need one of such commands you have to write a wrapper batch
> > file. Often, they can be one liners of the kind
> >
> > @bash -c 'script_or_symlink_name %*'
> >
> 
> Do you mean
> 
> "a native version of LyX (a) cannot use scripts and (b) cannot use
> commands that are symlinks"

Yes, scripts and symlinks cannot be directly executed by a native program.

> I'm just doing very simple things in these script: lyx -e to export to
> tex, ultra-simple sed commands to change a couple of lines in the
> tex-file (e.g. notes=show to notes=hide in beamer), then pdflatex to
> compile pdfs.
> 
> My belief was that these were simple enough to be consistent between
> native LyX and Cygwin LyX (indeed, only the first is a lyx command).
> Is this belief reasonable?

Yes, for these simple things both versions are suitable. However, I
think that the official native LyX is compiled as a GUI application.
If so, you will not get any output on the terminal and thus will not
see any error message. Also, a GUI application launched from a terminal
(or script) generally returns immediately and this may be a problem.
Your calling script should be prepared for this. For example, the
command "lyx -e pdf document.lyx" may return before document.pdf is
produced. Thus, you have to check that document.pdf actually is created
before continuing with other commands. But you are not notified if an
error occurs and your script may wait forever for the result...
Well, native GUI commands are not comfortable for scripting.

-- 
Enrico


Re: LyX and Cygwin

2014-05-02 Thread Enrico Forestieri
Bert Lloyd writes:
> 
> Dear LyX-users,
> 
> I am writing some scripts to create PDFs from a number of LyX files. I
> use Windows, but to maximize cross-platform portability, I'm writing
> the scripts for Cygwin so that they can run on unix and MacOS. I would
> like to know whether one of the following three options is preferable:
> 
> 1. Add my current Windows installation of LyX and MikTeX to my Cygwin
> PATH variable, so cygwin can find lyx.exe, etc.

This works provided that you take into account that a native version
of LyX cannot use neither scripts nor commands that are symlinks.
If you need one of such commands you have to write a wrapper batch
file. Often, they can be one liners of the kind

@bash -c 'script_or_symlink_name %*'

> 2. In Cygwin, install the most recent version of LyX (and, presumably,
> texlive or some other latex engine) and run the cygwin scripts using
> these.

While there can be some issues using a Cygwin TeX engine with a native
LyX version (but it can be done), a Cygwin version of LyX can use
without problems a native TeX engine. So, if you install LyX/Cygwin
and already have, say MikTeX, you don't need installing texlive in Cygwin.

> 3. Download the tar.gz Cygwin binary directly from
> http://www.lyx.org/Download and [install? compile?] it. This is
> currently a bit beyond my ability, although I could learn.

That tar.gz contains a Cygwin package to be installed through the
setup.exe installation tool. Simply untar it (using the Cygwin tar
version, not a native one) and follow the instructions in the README
file. This version does not use an X server and is visually identical
to the native version.

> Any other general tips for Cygwin and LyX are of course appreciated.

If you already use Cygwin, then install the Cygwin version of LyX.
If you only sporadically need Cygwin, then install the native version
of LyX and use wrapper batch files to call the commands you need.
If you need interoperability with unix and MacOS, then definitely
install the Cygwin version of LyX.

-- 
Enrico



Re: How to tell LyX to add empty line after paragraphs of my style?

2014-04-28 Thread Enrico Forestieri
Richard Heck  lyx.org> writes:
> If you DO want to indent the next paragraph, then put a
> "--Separator--" enviroment after your list.

I advice against doing that. The "--Separator--" environment should only
be used to separate *same* environments and not different ones. The fact
that this layout generates a blank line in the output is a by-product
that was not thoughtfully considered at the time, IMHO.
It is better to explicitly introduce a blank line in ERT.
Hit the "TeX" button, press return and then close the inset.
Now you have a blank line without relying on the ugly "--Separator--".
Hopefully, this will be possible without using ERT for the next major
release.

-- 
Enrico




Re: bst file not in tar.gz archive

2014-03-22 Thread Enrico Forestieri
William Seager writes:
> 
> On Wednesday, March 19, 2014 15:47:47 Wolfgang Engelmann wrote:
> > I regard export>Lyx Archive tar.gz as a very handy feature of lyx.
> 
> Hi - I agree IF it worked. I find that nothing but the .lyx file is
> included in the archive - no images, no bibs, no bst, no
> nothing.

Most probably you didn't save the file before exporting. If this is
not so, you are kindly requested to provide a minimal test case.

-- 
Enrico




Re: bst file not in tar.gz archive

2014-03-22 Thread Enrico Forestieri
Wolfgang Engelmann writes:
>  
> Thanks, Enrico for pointing to the culprit.
>  
> When I changed 
> Add bibliography to TOC
> to NOT,
> the archive still did not export the .bst file.
> I had to export the lyx file using another name. Now it works.

Note that lyxpak.py scans the .lyx file on disk. So, you have to save
the file before exporting (no need to give it another name).
 
> Where and how do I file a bug?

I did it for you:
http://www.lyx.org/trac/ticket/9044

-- 
Enrico





Re: bst file not in tar.gz archive

2014-03-21 Thread Enrico Forestieri
Wolfgang Engelmann writes:

> Here are the two archives. AA-PBR contains the spbasic.bst, after
> having archived the AA-PBR.lyx file, AA-SP.tar.gz does not, after
> having archived the AA-SP.lyx file.
>  
> I have tried to adjust the document- and tool settings in both lyx
> files.

The different behavior is triggered by the "Add bibliography to TOC"
checkbox (it is checked in AA-SP.lyx but not in AA-PBR.lyx).

> exporting both files to .tex gives these differences:

You should rather look at the differences in the .lyx files.
This is the relevant hunk:

diff -u AA-PBR.lyx AA-SP.lyx
[...]
@@ -100,7 +99,7 @@
 \begin_inset CommandInset bibtex
 LatexCommand bibtex
 bibfiles "A-Test"
-options "spbasic"
+options "bibtotoc,spbasic"

As you can see, checking "Add bibliography to TOC" changes the
options field. However, lyxpak.py is not expecting more than one
bst file and thus does not try to split the options field at commas.
It simply checks whether the file "bibtotoc,spbasic.bst" exists.
As that file does not exist, it is not added to the archive.

The fix is trivial and simply consists in replicating what is
already done for bib files (which are expected to be a comma
separated list).

Please, file a bug about this issue.

-- 
Enrico



Re: Problem forward/inverse searching with Sumatrapdf 2.4

2014-02-19 Thread Enrico Forestieri
On Wed, Feb 19, 2014 at 10:05:07AM +0100, Andrew White wrote:

> Works like a charm. Thanks!

You're welcome :)

-- 
Enrico


Re: Problem forward/inverse searching with Sumatrapdf 2.4

2014-02-18 Thread Enrico Forestieri
Andy writes:

> I am unable to get forward inverse searching working. Have followed
> instructions at http://wiki.lyx.org/LyX/SyncTeX, and have tried
> reinstalling the Lyx+miktex bundle
> 
> Generating the PDF is no problem. When I attempt to forward search,
> the Lyx status bar reports "(forward-search)", no error is thrown,
> and focus shifts to sumatrapdf, however, no highlighting appears. 

For some reason, miktex does not understand/obey the command lyx inserts
into the preamble when you check the "Enable Forward/Reverse Search"
button in the toolbar and does not generate the necessary info.

The generation of the required info can be forced by changing the
converter "LaTeX (pdflatex) -> PDF (pdflatex)" in
Preferences->File handling->Converters from the default "pdflatex $$i"
to "pdflatex -synctex=1 $$i" (i.e., by adding the -synctex=1 switch).
After that it should work (supposing that you performed the necessary
configuration as explained in the above link).

-- 
Enrico



Re: Connecting Lyx to Jabref and Zotero

2014-02-12 Thread Enrico Forestieri
Enrico Forestieri writes:

> 
> Note that \\.\pipe is a special object that does not correspond to
> any real directory, so you can't really check that any file is created.
> To see whether it worked, supposing you use \\.\pipe\lyxserver, then
> launch lyx and then open a cmd terminal. From the terminal issue the
> following command at the prompt:
> 
> echo LYXCMD:test:file-open > \\.\pipe\lyxpipe.in

Sorry, this should have been

echo LYXCMD:test:file-open > \\.\pipe\lyxserver.in

if you set \\.\pipe\lyxserver as the LyXserver path.

-- 
Enrico





Re: Connecting Lyx to Jabref and Zotero

2014-02-12 Thread Enrico Forestieri
Christopher Kan writes:

> 
> Hello!
> 
> I am running LyX 2.0.7 on a Windows x64, Jabref 2.9.2 and Zotero Standalone 
> 4.0.17 with the LyZ 2.1.7 plugin. 
> 
> I am having trouble with the LyXServer pipe settings. From what I have read 
> whatever directory I am set the path to should create a pipe file allowing 
> Jabref and Zotero to communicate with LyZ. I have set a path 
> "F:\\pipe\lyxserver" but it didn't create any files in the directory. I have 
> tried restarting the program and its still empty. I have set the same path in 
> Jabref and Zotero, neither have been able to communicate with LyZ.
> 
> Does anyone have any suggestions to this issue? 

Please, have a look at the Additional Features manual, sec. 5.2
(Starting the LyX Server). In essence, you can use a generic path
on Windows but only a path that starts with \\.\pipe. Thus, either
\\.\pipe\lyxserver or \\.\pipe\foo\bar will do.

Note that \\.\pipe is a special object that does not correspond to
any real directory, so you can't really check that any file is created.
To see whether it worked, supposing you use \\.\pipe\lyxserver, then
launch lyx and then open a cmd terminal. From the terminal issue the
following command at the prompt:

echo LYXCMD:test:file-open > \\.\pipe\lyxpipe.in

After that, lyx should open a file dialog. If not, something went wrong.

-- 
Enrico



Re: Footnotes in titles

2013-11-02 Thread Enrico Forestieri
Sebastien writes:

> Thanks for your remarks. I'll look into the latex commands to tweak
> this and see if there is anything possible. The solution
> suggested by Stefano provides a good starting point. The documentation
> on this seems slim, though, despite it being what would appear
> to be a fairly common occurrence (footnotes in titles).

Try the following line in the preamble:

\def\@makefnmark{\hbox{\@textsuperscript{\small\@thefnmark}}}

-- 
Enrico




Re: lyxpipe (LyX / Jabref)

2012-05-15 Thread Enrico Forestieri
On Tue, May 15, 2012 at 05:37:39PM +0200, Bernd Kappenberg wrote:

> Thanks, that did it!
> 
> Bernd :)
> 

You're welcome :)

-- 
Enrico


Re: lyxpipe (LyX / Jabref)

2012-05-03 Thread Enrico Forestieri

Bernd Kappenberg wrote:

Hello,

I am using LyX 2.0.3 / Jabref 2.7.2 / Windows 7.

I want to push data directly from Jabref to LyX.

I entered "\\.\pipe\lyxpipe" under LyX...paths and
"\\.\pipe\lyxpipe.in" in Jabref  (external programmes/LyX-Kile).

However, I still get the answer "check if LyX is running and if the
lyxpipe settings are correct".

What went wrong?


Use \\.\pipe\lyxpipe for both LyX and Jabref.



Re: LyX export to RTF

2012-04-21 Thread Enrico Forestieri
  Janwillem van Dijk writes:
  Just managed to get something workable straight to docx.


  File Export LyX → HTML (MSWORD) 
  pandoc -f html mypaper.html -t docx -o mypaper.docx


  Only a few tweaks like
  1) change all .png into .eps as I want the original eps in the docx
  2) change font to TimesNewRoman
  3) change alignment to Justify

  All in all very workable 
  Cheers, Janwillem


I think that something fishy is occurring with your latex2rtf installation.
Of course, if you are fine with pandoc or something else, then use it.
However, latex2rtf is capable of managing things that other conversion tools
are not able to manage. As an example, I attach here a LyX document using
the bibentry package and the result I obtain with latex2rtf 1.9.17.




bibentry-natbib.lyx
Description: Binary data


bibentry-natbib.bib
Description: Binary data


bibentry-natbib.rtf
Description: MS-Word document


Re: LyX export to RTF

2012-04-20 Thread Enrico Forestieri
Janwillem van Dijk writes:

>   Use operational quantities defined in
> ICRU51: H\s\do5(p)\(0.07\),
>   H\s\do5(p)\(3\)
> and H\s\do5(p)\(10\)
>   where it should be Hp(0.07) etcetra with H italic and p roman
> subscript coming from $H_{\mathrm{p}}(0.07)$

Please have a look at
http://wiki.lyx.org/Tips/ExportingRichTextFormatWithLaTeX2rtf

Note that starting with latex2rtf 1.9.19 the meaning of the -p option
has been reversed, so you may need to remove this option from the
converter automatically setup by LyX.

I am still using 1.9.17 and everything works fine for me. Equations,
crossreferences, bibliography, and figures are all perfectly converted.
I tried any other way discussed in this list to get a msword readable
file, but all of them are much inferior to the results I obtain with
latex2rtf. YMMV, of course.

-- 
Enrico



Re: Global find and replace of straight quotes with proper curly quotes?

2012-04-16 Thread Enrico Forestieri
stefano franchi writes:
> 1. I can insert a space back in with  empty ERT+space, but then I have
> my file littered with all these empty ERT boxes. They are ignored in
> the pdf output, as they should, but there are still very annoying. Is
> there any way to get rid of them?

I think you can simply fool LyX and insert a space at the very beginning
even if the stupid thing would not let you do so. You can do this both
in the find and replace area. Simply input any character followed by a
space and what else you need, then delete the first character you inserted.
You now have an initial space in both areas...

-- 
Enrico



Re: Global find and replace of straight quotes with proper curly quotes?

2012-04-15 Thread Enrico Forestieri
stefano franchi writes:
> sorry for not being clear. I can match a space with a regex in the
> find field (I did it with /s), but how do I put the space back in? The
> replace field does not allow regexes nor spaces.

Try inserting an empty ERT (Ctrl+L) and then a space.

-- 
Enrico





Re: lyx archive error

2012-02-20 Thread Enrico Forestieri
On Fri, Feb 17, 2012 at 04:49:58PM +0100, Pavel Sanda wrote:

> Waluyo Adi Siswanto wrote:
> > I have found the cause. It could be a bug?
> > ANY file using SPACE in its filename will fail to export archive.
> > I tried in Ubuntu 11.10 and Windows 7, both fail.
> 
> Yes, the problem is due to spacing in path. Enrico may know whether
> is it easy to fix..

The lyxpak.py script has no problem with spaces in filenames. It is LyX
that is passing a mangled filename. Specifically, LyX calls lyxpak.py
using the mangled name meant for latex processing in the temporary dir.

The attached patch fixes the problem for me.

-- 
Enrico
Index: src/Converter.cpp
===
--- src/Converter.cpp   (revisione 40771)
+++ src/Converter.cpp   (copia locale)
@@ -50,6 +50,7 @@ string const token_base("$$b");
 string const token_to("$$o");
 string const token_path("$$p");
 string const token_orig_path("$$r");
+string const token_orig_from("$$f");
 string const token_encoding("$$e");
 string const token_latex_encoding("$$E");
 
@@ -412,6 +413,7 @@ bool Converters::convert(Buffer const *
command = subst(command, token_to, quoteName(outfile2));
command = subst(command, token_path, 
quoteName(onlyPath(infile.absFileName(;
command = subst(command, token_orig_path, 
quoteName(onlyPath(orig_from.absFileName(;
+   command = subst(command, token_orig_from, 
quoteName(onlyFileName(orig_from.absFileName(;
command = subst(command, token_encoding, buffer ? 
buffer->params().encoding().iconvName() : string());
command = libScriptSearch(command);
 
Index: lib/configure.py
===
--- lib/configure.py(revisione 40771)
+++ lib/configure.py(copia locale)
@@ -920,7 +920,7 @@ def checkConverterEntries():
 # Currently, lyxpak outputs a gzip compressed tar archive on *nix
 # and a zip archive on Windows.
 # So, we configure the appropriate version according to the platform.
-cmd = r'\converter lyx %s "python -tt $$s/scripts/lyxpak.py $$r/$$i" ""'
+cmd = r'\converter lyx %s "python -tt $$s/scripts/lyxpak.py $$r/$$f" ""'
 if os.name == 'nt':
 addToRC(r'\Format lyxzip zip"LyX Archive (zip)" "" "" ""  
"document,menu=export"')
 addToRC(cmd % "lyxzip")


Re: Mac-specific: tex2lyx won't run

2012-02-14 Thread Enrico Forestieri
Eric Weir writes:
> I'm attempting to use the workaround suggested by Stefano to get LyX to
> recognize a Unicoded document as Unicoded. The workaround  involves use
> of the tex2lyx command. 
> 
> I'm on a Mac. When I run the command I get a command not found message.
> When I do locate tex2lyx, however, the file  shows up in two locations:
> /Applications/LyX.app/Contents/MacOS and
> /Applications/TeX/LyX.app/Contents/MacOS
> 
> How do I get the command to run?

Why don't you simply modify the converter in
Tools->Preferences->File Handling->Converters->LaTeX (plain) -> LyX
and then use File->Import->LaTeX (plain) ?

-- 
Enrico



Re: Long Math Equation in Table Column

2012-01-12 Thread Enrico Forestieri
Rich Shepard writes:

>Er, ... according to the detailed Math manual, "Only inline formulas are
> allowed inside tables." So, that's that.

Nonsense. Simply set the column width or put the formula in a minipage.

-- 
Enrico



Re: reverse search sumatra xetex...maybe I am almost there...

2011-11-08 Thread Enrico Forestieri
dc writes:
> 
> Enrico Forestieri writes:
> 
> > 
> > dc writes:
> > 
> > > I have synchronize with output set to: \synctex=-1
> > 
> > Maybe miktex doesn't understand that? Please, try modifying the converter
> > from "xelatex $$i" to "xelatex --synctex=-1 $$i" and see whether forward
> > search works after that.
> > 
> 
> In document-settings-output under synchronize with output/custom macro,
> I get 
> 
> "x
>   elatex --synctex=-1 $$i

No, don't do that. Even leave it unchecked. Instead, go to
Tools->Preferences->File Handling->Converters
find the "LaTeX (XeTeX) -> PDF (XeTeX)" entry and select it.
In the "Converter:" field you should see "xelatex $$i".
Change that to "xelatex --synctex=-1 $$i", hit the Modify button
and then Save or Apply.

-- 
Enrico



Re: Drawing with Pgfplots from file

2011-11-08 Thread Enrico Forestieri
Churilov Sergey writes:

> What could be the problem here?

Maybe you are using an old LyX version. You need LyX 2.0.1 for that to
work. You have only to make sure that the path to the file is not
explicitly relative, i.e., it doesn't start with ./ or ../

For example, any of the following will work:

\addplot file {data.dat};
\addplot file {subdir/data.dat};

but the following will fail:

\addplot file {./data.dat};
\addplot file {../data.dat};
\addplot file {./subdir/data.dat};

This is a known (mis)feature of the kpathsea library used by TeX
for file searching.

-- 
Enrico



Re: reverse search sumatra xetex...maybe I am almost there...

2011-10-07 Thread Enrico Forestieri
dc writes:

> I have synchronize with output set to: \synctex=-1

Maybe miktex doesn't understand that? Please, try modifying the converter
from "xelatex $$i" to "xelatex --synctex=-1 $$i" and see whether forward
search works after that.

-- 
Enrico



Re: biblatex showing neither bibliography nor cites in PDF

2011-10-06 Thread Enrico Forestieri
Jürgen Spitzmüller writes:
> 
> Thanks. Could you check if the attached also does the trick? This test is 
> more reliable. Please also check if biber is run after the bib file has been 
> modified (works here on Unix).

Yes, this also works and biber is also run after modifying the bib file.

-- 
Enrico



Re: biblatex showing neither bibliography nor cites in PDF

2011-10-05 Thread Enrico Forestieri
Jürgen Spitzmüller writes:
> 
> To those who see the problem and can compile: Could you check if the 
> following fixes the issue?

Yes, that does the trick and biber is run.

-- 
Enrico



Re: biblatex showing neither bibliography nor cites in PDF

2011-10-05 Thread Enrico Forestieri
Jürgen Spitzmüller writes:
> 
> Enrico Forestieri wrote:
> 
> > Seemingly, LyX is not running biber. Remember that you also have to
> > specify biber (see http://wiki.lyx.org/BibTeX/Biblatex#using-biber) as the
> > bibtex processor when using backend=biber. However, I just verified that
> > even when doing that, biber is still not run by LyX.
> 
> Can we have more information? Biber runs fine here via LyX.

biblatex version: 1.6
biber version: 0.9.2

There's no mention of the bcf file in the latex log, however the .bcf
file is produced and the latex log contains the following hints:

Package biblatex Info: ... file 'docname.bbl' not found.
...
Package biblatex Warning: Please (re)run Biber on the file:
(biblatex)docname
(biblatex)and rerun LaTeX afterwards.

Adding \typeout{File: \jobname.bcf} to the preamble works and biber is run.

-- 
Enrico



Re: biblatex showing neither bibliography nor cites in PDF

2011-10-04 Thread Enrico Forestieri
Thomas Strausz writes:

> 2. As a backend to biblatex I use biber.

Seemingly, LyX is not running biber. Remember that you also have to specify
biber (see http://wiki.lyx.org/BibTeX/Biblatex#using-biber) as the bibtex
processor when using backend=biber. However, I just verified that even when
doing that, biber is still not run by LyX.

Please check the latex log file and, if you find some lines like these ones:

Package biblatex Warning: Please (re)run Biber on the file:
(biblatex)mydocument
(biblatex)and rerun LaTeX afterwards.

right near the end, open a terminal, go to the temporary directory created by
LyX and run "biber mydocument". Afterwards, make any change in your document
and try to preview it again. The bibliography should be there, now.

Also consider filing a bug report here:
http://www.lyx.org/trac/wiki/BugTrackerHome

-- 
Enrico



Re: LyX 2.0.1 (OS X): file with relative path name not found

2011-09-29 Thread Enrico Forestieri
Patrick De Visschere writes:
> 
> I normally use pathnames relative to the current directory and since . is
> automatically included in the TEXINPUTS prefix, this should still work I
> guess without making any modifications. But it doesn't.
> The problematic paths start with ../ and it looks there is still a problem
> with that.

Yes, it seems that this a (wanted) Kpathsea feature(?):
http://www.chemie.fu-berlin.de/chemnet/use/info/kpathsea/kpathsea_4.html#IDX118

If the filename being searched for is absolute or explicitly relative, i.e.,
starts with `/' or `./' or `../', Kpathsea simply checks if that file exists;
it is not looked for along any paths.

:(

-- 
Enrico



Re: Lyx 2.0 Forward Search Problem Windows

2011-08-02 Thread Enrico Forestieri
Joern writes:
> 
> Hello,
> 
> after reading a couple of pages considering forward search in LyX 2.0
> on Windows I have not been able to set it up for either SumatraPDF or Yap.

Thanks for the report. This will be fixed in the next release (2.0.1).

-- 
Enrico






Re: lyx math autocorrection

2011-06-16 Thread Enrico Forestieri
John Horsemoon writes:
> 
> There is an option in Lyx Preferences/Editing/Input Completion for
> Autocorrection in Math. Does anyone know how this works? Checking or 
> unchecking
> this option makes no visible difference, and I can't seem to find any
> documentation about it in the help files or on lyx webpage. Sound like a 
> useful
> thing, if only I knew how it worked!

It is a method for entering symbols. For example, you type << and get \ll.
However, I see that it is unusable, because a necessary file is not ditributed
with the sources. You can get that file from here:
http://www.lyx.org/trac/browser/lyx-devel/trunk/lib/autocorrect

After you copy it to the LyX directory (~/.lyx on *nix), in mathed hit ! to
enter autocorrect mode.

-- 
Enrico






Re: Forward/reverse searching problems under Windows (The Sequel)

2011-05-25 Thread Enrico Forestieri
Enrico Forestieri writes:

> So, can anyone compiling LyX with MSVC perform that check?

It turned out to be an issue with the MSVC compiler and should be fixed
in the next release. In the meantime, Windows users needing to perform a
dvi forward search can workaround it by first generating a pdf and *then*
previewing as dvi.

-- 
Enrico



Re: Forward/reverse searching problems under Windows (The Sequel)

2011-05-24 Thread Enrico Forestieri
Christopher Menzel writes:
> 
> On May 23, 2011, at 3:33 PM, Enrico Forestieri wrote:
> > Christopher Menzel writes:
> >> 
> >> That is, LyX is calling the appropriate forward search command for a PDF
> >> preview document, not DVI.
> > 
> > LyX performs a forward search for the last generated format, so it means
> > that you generated a pdf after the dvi, even if you quitted the pdf viewer
> > and are now previewing the dvi.
> 
> Sorry, I guess I'm confused about the semantics of "generating a format"
> versus "previewing". What more do I have to do to "generate a format"
> beyond previewing?

If you hit the "update" button, a given format is generated (produced)
in the temp dir, but a previewer is not started.

>  From the documentation it appears that all I should
> have to do is generate a dvi preview:
> 
>Forward search works both with DVI and PDF output. LyX simply
>checks which preview format you have used before (i.e., which
>format is already there in the temporary directory) and chooses
>the appropriate configuration for the respective format.
> 
> I have done that; the only thing in the Temp directory is a DVI file
> for my document. There is no sign of any PDF. 

So, let's see whether we can solve this mystery by looking at the code.
The following is the relevant snippet in src/frontends/qt4/GuiView.cpp:

if (!dviname.exists() && !pdfname.exists()) {
dr.setMessage(_("Please, preview the document first."));
break;
}
string outname = dviname.onlyFileName();
string command = lyxrc.forward_search_dvi;
if (!dviname.exists() ||
pdfname.lastModified() > dviname.lastModified()) {
outname = pdfname.onlyFileName();
command = lyxrc.forward_search_pdf;
}

Firstly, LyX checks whether a dvi or pdf was generated. If not, the message
"Please, preview the document first." is issued.
Then, LyX assumes that you generated a dvi, but if no dvi exists or the
pdf is newer than the dvi, a pdf format is assumed.
Note that if no pdf exists, pdfname.lastModified() returns -1 and the
check pdfname.lastModified() > dviname.lastModified() is never true.
Thus, if no pdf exists a dvi forward search is always attempted.

Anyway, you say that a pdf search is tried, even if no pdf is in sight.
Let's se how that could happen. The lastModified() method returns a time_t
type, which is a signed type on all machines and compilers I have access to.
However, I don't have access to the MSVC compiler, which is the one used
for the Windows version you are using, most probably. I am able to compile
a Windows version with the MinGW compiler, and there it works.

So, the only way that a pdf search could be attempted is if the time_t type
is an unsigned type for the MSVC compiler. Indeed, in that case, the -1
would be interpreted as the greatest possible value and the check
pdfname.lastModified() > dviname.lastModified() would be always true.
I have no way to check that and someone building LyX with MSVC should
perform that test. It would suffice adding the line

   lyxerr << "pdf: " << pdfname.lastModified() << endl;

just before that snippet, trying a forward search with only a dvi generated
and looking at what is printed. If the result is

pdf: -1

the mystery remains unsolved (I always get that), but if it prints something
like

pdf: 2147483647

we found the bug.

So, can anyone compiling LyX with MSVC perform that check?

-- 
Enrico



Re: Forward/reverse searching problems under Windows (The Sequel)

2011-05-23 Thread Enrico Forestieri
Christopher Menzel writes:
> 
> That is, LyX is calling the appropriate forward search command for a PDF
> preview document, not DVI.

LyX performs a forward search for the last generated format, so it means
that you generated a pdf after the dvi, even if you quitted the pdf viewer
and are now previewing the dvi.

-- 
Enrico



Re: Forward/reverse searching problems under Windows

2011-05-22 Thread Enrico Forestieri
Christopher Menzel writes:
> 
> Well, as I noted, I followed the instructions in the Additional
> Features document assiduously, so one of the first things I did
> was to choose the default command for the Yap previewer under
> Preferences->Output->General.  The default setting -- yap -1
> -s "$$n $$t" $$o -- leads to the "Couldn't proceed" message. And,
> although the MiKTeX bin directory is in my PATH, I have also tried
> using a fully qualified path to yap.exe and I still get the
> message in question. Any other possibilities you can think of?

That message is only printed either if the forward search command is
not defined or LyX is not able to map the cursor position to a row in
the LaTeX file. The relevant code is the following:

int row = doc_buffer->texrow().getRowFromIdPos(
   bv->cursor().paragraph().id(), bv->cursor().pos());
LYXERR(Debug::ACTION, "Forward search: row:" << row
<< " id:" << bv->cursor().paragraph().id());
if (!row || command.empty()) {
dr.setMessage(_("Couldn't proceed."));
break;
}

So, if your command is not empty, we are left with the second option.
As you can see, using "-dbg action", one is also informed about what
row in the LaTeX file is mapped to the paragraph where the cursor in
LyX currently is. Thus, the next thing to try is using -dbg action
and look in the output for the "Forward search: row: ... id: ..."
message. If row turns out to be zero, then that's the reason for the
failure.

> And, again, is there anything analogous to the Unix /var/log
> directory under Windows where I might be able to examine a log
> file for clues?

I don't think something similar exists in Windows.

> Oh, also, can you (or anyone) tell me how to run
> LyX under Windows from the command line with debugging on?  I
> figure that might yield a clue or two as well but I haven't been
> able to figure out how to do that; it doesn't seem to be a simple
> matter of calling the .exe file with the -dbg option.

If you are using one of the installers and not compiling LyX by yourself,
that is not going to work because I think that they compile LyX as a GUI
application, such that there's no standard input and output.
However, you can use the messages window (View->View messages) and set
there the wanted debug level (I think that "-dbg action" corresponds to
the "User commands" debug level).
If you are familiar with the Unix world, maybe you could try the Cygwin
version, which behaves as one expects when using the command line.




Re: Forward/reverse searching problems under Windows

2011-05-21 Thread Enrico Forestieri
Christopher Menzel writes:
> 
> Unfortunately, forward search is still not functioning, although I
> do see a small message at the bottom of the screen that reports
> "Couldn't proceed" when I invoke the Forward Search command, in case
> that's a clue;

Yes, it is. Most probably, you don't defined a command for performing the
forward search. This depends on the viewer you use and you can find a
predefined list for some most used viewers in Preferences->Output->General.
Pick the one for your viewer and you should be fine. If your viewer is
not listed, you will have to discover whether it supports forward search
and what command should be used.

-- 
Enrico






Re: Forward/reverse searching problems under Windows

2011-05-20 Thread Enrico Forestieri
Christopher Menzel writes:
> 
> I have followed all the
> instructions assiduously in the Additional Features document -- path to
> LyXserver pipe is set to \\.\pipe\lyxpipe, I've created the batch file
> lyxeditor.bat, have configured Yap properly, etc.  But when I
> double-click in my DVI preview document, a command window pops up
> quickly with the message "The system cannot find the file specified".

Make sure you use the full path to lyxeditor.bat in yap.

> I've seen a couple of reports of problems with inverse search and MikTeX
> 2.9 but no solutions.

Uh? It works just fine for me.

-- 
Enrico



Re: LyX+Maxima

2011-05-20 Thread Enrico Forestieri
Francesco Menoncin writes:
> 
> I am not able to make LyX and Maxima interact.
> I have put the Maxima path (C:\Program Files\Maxima-5.24.0\bin) in
> LyX (Tools->Prefereces->Paths) and reconfigure LyX.
> Nevertheless, when I try to compute something (like 2+2) I just
> obtain an empty space after the formula.
> Any suggestion?

The problem here is that LyX is invoking the command "maxima" but there's
only a batch file (maxima.bat) to be executed on Windows. Now, LyX 2.0 on
Windows is not able to execute batch files anymore. You may have better
luck trying the Cygwin version of LyX , as a bash script "maxima" is also
supplied and the Cygwin version is able to execute it.

-- 
Enrico



Re: Anybody helps about img path

2011-05-11 Thread Enrico Forestieri
Julien Rioux writes:
> 
> It's possible that there have been some changes in the 2.0 development 
> that broke a call to a .bat script, I'll let someone more knowledgeable 
> answer.

Yes, batch files do not work anymore on Windows. You have to invoke your
batch file as "cmd /c file.bat".

-- 
Enrico





Re: RC1: Why there is no binary for Winsows

2011-03-13 Thread Enrico Forestieri
Jürgen Spitzmüller writes:

> Guofeng Zhang wrote:
> > I found that there is not any binary for Windows in Beta 4 and RC 1.
> 
> Uwe who prepares the Alternative Installers (and used to provide also beta 
> versions) is on a longer journey. I think we never provided "official" 
> installers for development releases.

For those not scared by Cygwin and willing to try RC1, a Cygwin version
of LyX is available here:
ftp://ftp.lyx.org/pub/lyx/devel/lyx-2.0/rc1/lyx-2.0.0rc1-cygwin.tar.gz

You have to unpack the archive using the cygwin tar command (native tools
may corrupt the archive content) as "tar zxvf lyx-2.0.0rc1-cygwin.tar.gz".
Go to the directory which is created and read the README.txt and INSTALL.txt
files for instructions on how to install the package using the cygwin
setup.exe installation tool.

-- 
Enrico



Re: Change between latex distributions

2011-02-08 Thread Enrico Forestieri
Max Funk writes:

> I installed the new lyx 1.6.9 and texlive 2010 in
> cygwin.
> 
> However, lyx uses always the old tetex-distribution.contained
> in cygwin.
> 
> Is there a possibility to change between distributions?
> 
> AFAIK, there must be a setting “path to latex.exe”
> or similar... But I absolutely didn’t find it…

You have to add that path to Tools->Preferences->Paths->PATH prefix,
such that it appears before /usr/bin. Pay attention to use posix paths,
i.e., use /cygdrive/c/whatever instead of C:/whatever, as the colon is
the path separator in cygwin.

-- 
Enrico



Re: PDF (pdflatex) View Missing

2011-02-01 Thread Enrico Forestieri
Rainer Dorsch web.de> writes:

> \format "pdf2" "pdf" "PDF (pdflatex)" "F" "okular" "" ""
> \format "pdf4" "pdf" "PDF (tex2pdf)" "" "acroread" "" ""

Here is your problem. Those lines should read

\format "pdf2" "pdf" "PDF (pdflatex)" "F" "okular" "" "document,vector"
\format "pdf4" "pdf" "PDF (tex2pdf)" "" "acroread" "" "document,vector"

Most probably you unchecked the "Document" and "Vector graphics" check boxes
in Preferences->File Handling->File formats.

-- 
Enrico



Re: Vertical space before and after equations

2011-01-06 Thread Enrico Forestieri
Barak Shoshany writes:

> The equations are in display mode. All I need is some global command to
> make the vertical spacing before and after the equations smaller.

Put the following in the latex preamble:

\AtBeginDocument{
\addtolength{\abovedisplayskip}{-2ex}
\addtolength{\abovedisplayshortskip}{-2ex}
\addtolength{\belowdisplayskip}{-2ex}
\addtolength{\belowdisplayshortskip}{-2ex}
}

Adjust the spacing as needed. You can use any length, not only "ex".

-- 
Enrico



Re: OT: LaTeX Help

2010-11-23 Thread Enrico Forestieri
Richard Heck writes:
> \raisebox{-0.5\baselineskip}{\ensuremath{\stackrel{\stackrel{{\textstyle 
> \gamma}}{{\textstyle \sim}}}{\delta}}}
> Ugly, to be sure, and I'm worried the -0.5 will go wrong in some cases.
> 
> Any other ideas?

If you are satisfied about how that looks and your only concern is about the
right amount by which to lower the whole thing, simply lower it by the right
amount:

\setbox0=\hbox{$\delta$}
\raisebox{-\ht0}{\ensuremath{\stackrel{\stackrel{{%
\textstyle\gamma}}{{\textstyle\sim}}}{\delta}}}

If you like something more customizable, say you want to easily adjust
vertical spaces and the likes, then you could use the following:

\newbox\mybox
\newdimen\boxwd
\setbox\mybox=\hbox{$\sim$}
\boxwd=\wd\mybox
\setbox\mybox=\hbox{\vbox{\hsize=\boxwd
\parskip=0pt\offinterlineskip\parindent0pt
\hbox to \boxwd {\hfil$\gamma$\hfil}
\vskip2pt
\hbox{$\sim$}
\vskip1pt
\hbox to \boxwd {\hfil$\delta$\hfil}
}}
\def\mysymbol{\raisebox{-0.4\ht\mybox}{\copy\mybox}}

After that, you get your strange looking symbol by the macro \mysymbol

-- 
Enrico



Re: No printing of any files

2010-11-21 Thread Enrico Forestieri
Anthony Campbell writes:
> Can someone kindly point to where this printing issue is documented?

http://wiki.lyx.org/Windows/LyXWinTips#printing

-- 
Enrico



Re: AW: AW: [LyX2.0beta1] side bar always closed

2010-11-19 Thread Enrico Forestieri
Jannick Asmus writes:
> 
> Vincent van Ravesteijn wrote:
> 
> > Can you please remove your userdir and try again.
> 
> I would if I only knew where to find it on my WinVista machine (sorry 
> for this newbie question).

Open an explorer window, replace the current directory path with
%APPDATA% and hit return. Now look for a directory name LyX.

-- 
Enrico



Re: image not centered

2010-10-08 Thread Enrico Forestieri
Guenter Milde writes:
> However, this method inserts additional vertical space before and
> after the image, as it creates a LaTeX environment. See the Source:
> 
>\begin{figure}
>\begin{centering}
>\includegraphics[width=0.9\textwidth]{E-to-T}
>\par\end{centering}
> 
> The LaTeX FAQ recommends using the \centering macro instead:
> 
>\begin{figure}
>\centering
>\includegraphics[width=0.9\textwidth]{E-to-T}

This is equivalent to what LyX uses and no extra vertical space is added.
What you say would be true for \begin{center}...\end{center}, but LyX
is using "centering" here.

-- 
Enrico



Re: Lines is array

2010-09-20 Thread Enrico Forestieri
Julio Rojas writes:
> The question is, how can I add the double slash in math environment?
> Everytime I try to do it, a regular slash is rendered.

LyX is able to handle that case but there is currently no way to enter
the extra vertical space specification \\[0.3em] through the GUI.

Simply write as latex the array outside mathed (with the \\[0.3em])
then select it and press Control-M. After that, you can copy&paste
the array inside mathed and the \\[0.3em] will be retained.

If you need to change the spacing, copy the array in mathed (only the
array and not the math hull) and paste it outside of mathed, then change
the spacing and apply again the above procedure. A little cumbersome but
it works.

-- 
Enrico



Re: I can´ t to compile lyx

2010-03-21 Thread Enrico Forestieri
On Sat, Mar 20, 2010 at 05:37:36PM -0700, Marcelo Acuña wrote:

> > > > > This file was generated using the moc from
> > 4.5.1. It
> > > > 
> > > > inside lyx tree:
> > > > find . -name '*moc*' | xargs rm 
> > > 
> > > Before compiler error I found only one *moc*.
> > > I run make clean and is deleted.
> > > I run configure and make produces the error again.
> > 
> > In case you compiled Qt by yourself and you also have the
> > system Qt installed,
> > then, most probably, the wrong moc is being picked up by
> > the configure script.
> > Supposing that you installed Qt in /usr/local/qt, try the
> > following:
> > $ cd /usr/local/qt/bin
> > $ ln -s moc moc-qt4
> > $ ln -s uic uic-qt4
> > and then try to configure again. If I guessed right, it
> > should now work.
> 
>  Thanks Enrico. This solved the problem.
>  I gave a look to output of the configure and I noticed that also it find for
> 
>  rcc-qt4
> 
>  without finding it.
>  It will be necessary to also make a link to that file?

That doesn't hurt but should not be necessary. The configure script looks
in the PATH first for xxx-qt4 and then xxx. This is because you can also
have Qt3 installed and it has to be sure to pick up the Qt4 version.
For this reason, distributions rename the Qt4 xxx compilers as xxx-qt4.
This is done for moc and uic, but not for rcc (as Qt3 doesn't have it).
What happens is that when looking for moc-qt4 and uic-qt4, they are not
found in the bin dir of the specified Qt4 location (which is prepended to
the PATH) but they are found in the system Qt4 bin dir. So, the check for
moc and uic (without '-qt4') is not performed. Instead, rcc-qt4 is not
found neither in the system Qt4 bin dir nor in the specified Qt4 dir, so
configure now looks for rcc and finds it in the right place.

-- 
Enrico


Re: I can´t to compile lyx

2010-03-19 Thread Enrico Forestieri
Marcelo Acuña writes:
> 
> > > This file was generated using the moc from 4.5.1. It
> > 
> > inside lyx tree:
> > find . -name '*moc*' | xargs rm 
> 
> Before compiler error I found only one *moc*.
> I run make clean and is deleted.
> I run configure and make produces the error again.

In case you compiled Qt by yourself and you also have the system Qt installed,
then, most probably, the wrong moc is being picked up by the configure script.
Supposing that you installed Qt in /usr/local/qt, try the following:
$ cd /usr/local/qt/bin
$ ln -s moc moc-qt4
$ ln -s uic uic-qt4
and then try to configure again. If I guessed right, it should now work.

-- 
Enrico



Re: summary

2010-02-03 Thread Enrico Forestieri
Jürgen Spitzmüller writes:

> Should this be documented on the wiki?

I did it here: http://wiki.lyx.org/Tools/LyX2OpenOffice#sTools.LyX2OpenOffice_5

-- 
Enrico



Re: summary

2010-02-02 Thread Enrico Forestieri
0 writes:

> Sounds like that the "view - opendocument" command is really not in
> its proper place in Windows installation of LyX - it fails to work
> and should be absent

A quick search in the archives would have revealed the solution to
your problem:
http://www.mail-archive.com/lyx-users%40lists.lyx.org/msg69928.html

Instead of copying the tex4ht folder as suggested there, another
option is using the junction program you find here:
http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx
for creating a reparse point to the MikTeX folder by opening cmd.exe
and issuing the following two commands:
md c:/tex4ht
junction c:/tex4ht/texmf "c:/Program Files/MiKTeX 2.7"

-- 
Enrico



Re: LyX + JabRef

2009-12-08 Thread Enrico Forestieri
Ken writes:

> I set the LyXserver pipe to:
> C:\Documents and Settings\Ken\Application Data\lyx16\lyxpipe

This does not work on Windows. As explained in a footnote in Section 4.2
of the Additional Features manual, on Windows, local named pipes are special
objects located in \\.\pipe. Maybe this info should be made more explicit.
So, any of the following paths will work:

\\.\pipe\lyxpipe
\\.\pipe\something\thelyxpipe
\\.\pipe\first dir\second dir\mypipe
\\.\pipe\Documents and Settings\Ken\Application Data\lyx16\lyxpipe

I think you now get the idea.

-- 
Enrico



Re: CAS exposure in LyX (was Re: Importing Lyx files in SWP)

2009-11-24 Thread Enrico Forestieri
Ken writes:

> It does appear to be quite simple in its capabilities and not able to
> handle even moderately complex formulas (exp(2)*exp(3)) in either
> octave or maxima.

Note that if you type exp(2) literally, LyX has to use some heuristics in
order to know what you meant. Actually, it interprets "exp(2)" as "ex p(2)",
i.e., "e" times "x" times "p(2)". You can help interpretation in several ways.

1. use \mathrm to tell LyX what the function name is:
   \mathrm{exp}(2)*\mathrm{exp}(3)

2. use a small space to separate the argument of the function:
   exp\,(2)*exp\,(3)

3. use the LaTeX function names:
   \exp(2)*\exp(3)

4. use standard math:
   e^2*e^3

Nevertheless, this could be improved, of course, but heuristics can always
fail. That said, failure or success also depends on the CAS used. Your
particular example (without the corrective steps outlined above) works with
both octave and maxima, but fails with Mathematica (I don't know what happens
with maple).

-- 
Enrico



Re: greek characters in index?

2009-11-19 Thread Enrico Forestieri
Vincent van Ravesteijn writes:

> I think you've found a bug. Can you report it to
> http://www.lyx.org/trac/wiki/BugTrackerHome ?

It's already reported:
http://www.lyx.org/trac/ticket/2342



Re: generating {|} in math mode

2009-10-24 Thread Enrico Forestieri
Micha Feigin writes:
> 
> how do I generate a group definition such as
> { x | x > 0 }
> with variable height braces? I can create the outside braces using left\{
> and right\} (or matching braces from the braces menu) but the central one
> doesn't fit it, and if I add a | with a matching empty left or right
> element the sizes don't match

If you have a recent TeX engine, \middle| should do what you want.
LyX doesn't support it yet, so you will simply see \middle in red,
but it will work on output.

-- 
Enrico



Re: problem with graphics in beamerlyxexample1.lyx

2009-10-08 Thread Enrico Forestieri
BigG writes:

> The patch is defunct, as the source has now moved on somewhat.

According to the comments attached to the bug, the patch still works
when using \IfFileExists instead of \pgfu...@iffileexists. Indeed,
this patch:

--- pgfcoreimage.code.tex.orig  2008-01-15 11:27:34.0 +0100
+++ pgfcoreimage.code.tex   2009-10-08 22:51:29.281129400 +0200
@@ -81,8 +81,11 @@


 \def\...@findfile#1:#2+#3{%
-  \pgfu...@iffileexists{#3#1}%
-  {\xdef\...@filename{#3#1}}%
+  \edef\...@tempa{%
+\def\noexpa...@tempa1\space{%
+  \xdef\noexpand\...@filename{1}}}
+  \IfFileExists{#3#1}%
+  {\...@tempa\expandafter\@tem...@filef@und}%
   {\def\...@mightbeempty{#2}%
 \ifx\...@mightbeempty\pgfutil@empty\else%
 \...@findfile#2+{#3}%


works for me.

-- 
Enrico



Re: problem with graphics in beamerlyxexample1.lyx

2009-10-04 Thread Enrico Forestieri
BigG writes:
> 
> I have LyX 1.6.4 installed in cygwin on W2K, and LyXWindows 1.6.4 on W2K on
> another box. When I 
> use beamerlyxexample1.lyx, warnings about missing graphics are generated.
[...]
> The PDF generated is fine, but missing the four knight images, and the ICSI
> logo. This is what I
> would expect. However, the relevant image files are actually there in the
> same directory as
> beamerlyxexample1.lyx. For example,
> 
> $ ls -w 80 /usr/local/share/lyx/examples/beam*
> /usr/local/share/lyx/examples/beamer-g4-mask.jpg*
> /usr/local/share/lyx/examples/beamer-g4.jpg*
> /usr/local/share/lyx/examples/beamer-icsi-logo.pdf*
> /usr/local/share/lyx/examples/beamer-knight1-mask.png*
> /usr/local/share/lyx/examples/beamer-knight1.png*
> /usr/local/share/lyx/examples/beamer-knight2-mask.png*
> /usr/local/share/lyx/examples/beamer-knight2.png*
> /usr/local/share/lyx/examples/beamer-knight3-mask.png*
> /usr/local/share/lyx/examples/beamer-knight3.png*
> /usr/local/share/lyx/examples/beamer-knight4-mask.png*
> /usr/local/share/lyx/examples/beamer-knight4.png*
> /usr/local/share/lyx/examples/beamerlyxexample1.lyx*
> 
> Why can't pdflatex find them?

This is a known pgf bug:
http://sourceforge.net/tracker/index.php?func=detail&aid=1336165&group_id=92412&atid=600660

A patch has been proposed, but it has not still been applied:
http://sourceforge.net/tracker/index.php?func=detail&aid=1447974&group_id=92412&atid=600662

-- 
Enrico




Re: problem with PDF generation on cygwin

2009-10-03 Thread Enrico Forestieri
BigG writes:
> 
> I have LyX 1.6.4 installed in cygwin on W2K. I have an odd problem when
> generating PDF. Take, for
> example, "doc/Customization.lyx". If I "View->PDF (pdflatex)", I get the
> latex errors window after
> Latex run number 1. The errors window actually contains just 2 warnings,
> no errors, but LyX does
> not continue with the further Latex runs, and the PDF viewer is not invoked.
> 
> I have another box with LyXWindows 1.6.4 installed on W2K (and MiKTex, no
> cygwin this time). If I
> try the same thing, I don't get the latex errors window, the further Latex
> runs occur, and the PDF
> viewer is invoked. However, if I look at "Document->LaTeX Log", exactly the
> same warnings have been
> generated as before.
> 
> I've tried this with other LyX files; if they cause 'pdflatex' to generate
> warnings, the cygwin
> version of LyX throws up the latex error window and does not continue with
> further latex runs; the
> 'LyXWindows' version works just fine, even though the log shows the same
> warnings are generated.
> 
> This is really frustrating, since I'm sure the cygwin version used to
> behave properly. I've tried
> re-installing both LyX and tetex on cygwin, but to no avail. Anybody know
> what's happening here?

On cygwin, tetex uses file:line:error style and LyX is fooled to think
that the warning is a fatal one. This doesn't happen with MikTeX because
of the different way the log file is formatted.

This is a bug, please report it here:
http://www.lyx.org/trac/wiki/BugTrackerHome

Until the bug is fixed, you can workaround it as follows.
1) In Tools->Preferences->File Handling->Converters modify the
"LaTeX (pdflatex)->PDF (pdflatex)" converter by adding -no-file-line-error,
such that the converter reads "pdflatex -no-file-line-error $$i"
2) Alternatively, edit the file /usr/share/texmf/web2c/texmf.cnf and change
the line "file_line_error_style = t" to "file_line_error_style = f". In this
way, you don't need to modify the preferences in LyX.

-- 
Enrico



Re: lyx make error on ubuntu feisty 7.04

2009-09-23 Thread Enrico Forestieri
BuZZ-dEE writes:

> Hello, I want to install lyx-1.6.4.1 from source but i get an error 
> during make. configure before was successfull. i want to install lyx in 
> a non-standard directory. further i have the newest qt version installed 
> from source in a non-standard directory.
> 
> what can i do now?
[...]
> checking for QT4_CORE... yes
> checking for QT4_FRONTEND... yes
> checking for moc-qt4... /usr/bin/moc-qt4
> checking for uic-qt4... /usr/bin/uic-qt4
> checking for rcc-qt4... no
> checking for rcc... /home/schlatow/Programme/bin/rcc

The configure script is using the system moc and uic. This is because
moc-qt4 and uic-qt4 are tried first and I bet they are the Qt 4.2 versions.
In the /home/schlatow/Programme/bin directory you should have moc and uic,
so try renaming them as moc-qt4 and uic-qt4 and reconfigure. If that does
not help, try using --with-qt4-dir=/home/schlatow/Programme with the
configure command. If it still fails, rename /usr/bin/moc-qt4 and
/usr/bin/uic-qt4 as /usr/bin/moc-qt4.old and /usr/bin/uic-qt4.old,
for example. Now it should definitely work.

-- 
Enrico



Re: Inserting a bibliography into a Lyx file

2009-08-07 Thread Enrico Forestieri
Ehud Kaplan writes:

> Is there a convenient way of inserting a bibliography into a Lyx file 
> without using a bibtex database,
> and without going through Latex with the .bbl file?
> What I am looking for is something like:
> Insert/file/.bbl
> where Lyx will convert the .bbl material to its own representation.
> This will save me (and others, I assume) much time and frustration.

Simply import the .bbl file as a latex file using File->Import->LaTeX,
then copy&paste where you need it.

-- 
Enrico



Re: Re: AW: Yap: Inverse dvi search

2009-08-04 Thread Enrico Forestieri
On Tue, Aug 04, 2009 at 01:33:44PM +0200, Vincent van Ravesteijn - TNW wrote:

> >Maybe other native means could be used, but I am a *nix fellow
> >and don't know Windows well enough to judge.
> 
> A very simple approach is to just use command-line parameters. If we can
> manage to make LyX a single instance application (I mean that if you try
> to start LyX when it's already running it will open the existance LyX
> instance and open a possibly specified LyX file in the same instance),
> then we can also just call "LyX.exe %f -goto-row %l".
> 
> Would this be a possible solution ? At least it would be a pretty simple
> solution.

Well, if you are able to do that, you could use the same mechanism for
passing the needed info. I mean, when you launch LyX, you have to detect
that an instance is already running and then pass the parameters specified
on the command line to the running instance.
Isn't this the same problem that has to be solved?

-- 
Enrico


Re: Re: AW: Yap: Inverse dvi search

2009-08-04 Thread Enrico Forestieri
On Tue, Aug 04, 2009 at 12:41:48PM +0200, Vincent van Ravesteijn - TNW wrote:

>  
> >Jannick Asmus writes:
> >
> >> Is there any chance that this feature is included in the Windows 
> >> installers in the future?
> >
> >You can always hope that someone contributes the necessary code.
> 
> Enrico, 
> 
> Do you have an idea how to do this ? I've some experience with DDE, but
> I'm not sure whether that's what we want.

LyX uses two mechanisms for IPC. One of them is a named pipe, and currently
the code for dealing with named pipes only takes into account the *nix
implementation (which is what cygwin uses). However, named pipes also
exist on Windows, but thy are implemented differently. I am not familiar
with the Windows way, but I think that the necessary info can be found here:
http://msdn.microsoft.com/en-us/library/aa365590(VS.85).aspx

The other mechanism is a unix domain socket, which has no equivalent on
Windows. However, given that cygwin can also emulate that, it should be
possible to use this kind of IPC, too. Cygwin is open source, so if one
is sufficiently motivated, he could look at those sources for borrowing
the necessary code.

Maybe other native means could be used, but I am a *nix fellow and don't
know Windows well enough to judge.

-- 
Enrico


Re: AW: Yap: Inverse dvi search

2009-08-04 Thread Enrico Forestieri
Jannick Asmus writes:

> Is there any chance that this feature is included in the Windows 
> installers in the future?

You can always hope that someone contributes the necessary code.

> Sorry for being a bit insisting here. I believe that I am not pretty
> much skilled to follow the instruction in the ReadMe mentioned below. :(

Too bad :(

-- 
Enrico



Re: Yap: Inverse dvi search

2009-08-03 Thread Enrico Forestieri
Jannick Asmus writes:

> I am trying to configure LyX 1.6.3 on my WinVista machine for the 
> inverse dvi search as described in http://wiki.lyx.org/LyX/LyXOnCygwin.
[...]
> Q1: There are no files "lyxeditor.sh" and "lyxclient" in my LyX16 
> program folder. Am I missing something here? The files do not seem to 
> be shipped with the installation file.

The inverse dvi search is not possible with the native Windows version
of LyX, so those files are not shipped with the Windows installers.

> Q2: How can the compilation avoided - but without paying the price of 
> some a flashing console window.

You have to first install cygwin from http://cygwin.com and then the cygwin
version of LyX (ftp://ftp.lyx.org/pub/lyx/bin/1.6.3/lyx-1.6.3-cygwin.tar.gz).
After you download lyx-1.6.3-cygwin.tar.gz, you have to un-tar it by
typing "tar -zxvf lyx-1.6.3-cygwin.tar.gz" in cygwin terminal, and then
follow the instructions in the README.txt file.

-- 
Enrico



Re: Creating New Layout Help

2009-06-21 Thread Enrico Forestieri
Enrico Forestieri writes:

> I suggest that you file a bug report.

I did it: http://www.lyx.org/trac/ticket/6030






Re: Creating New Layout Help

2009-06-19 Thread Enrico Forestieri
Danny Parker writes:

> That is the best I can track it down too.  I'm including two files.
> msuthesis.layout was done with notepad++ and msuthesis2 was done with
> windows notepad.  I don't know if it makes a difference but I'm using
> XPx64.

Notepad is writing a BOM (http://en.wikipedia.org/wiki/Byte-order_mark) at
the start of your file. You cannot see it in an editor but od reveals it:

$ od -c msuthesis2.layout | head -3
000 357 273 277   #   %   D   o   n   o   t   d   e   l
020   e   t   e   t   h   e   l   i   n   e   b   e   l
040   o   w   ;   c   o   n   f   i   g   u   r   e   d   e

The octal values 357 273 277 correspond to ef bb bf in hexadecimal, i.e.,
the BOM. This confuses LyX, apparently. Even if a BOM is not necessary
for UTF8, it is allowed by the standard and thus LyX should take it into
account. I suggest that you file a bug report.

-- 
Enrico



Re: [Fwd: FancyBox - Shadowbox - Page Border]

2009-06-08 Thread Enrico Forestieri
On Mon, Jun 08, 2009 at 04:13:03PM -0300, Marcelo Reis wrote:

> Not at all. Just put an asterisk after \AddToShipoutPicture, i.e.,
> > use \AddToShipoutPicture* and only the first produced page will have
> > the border.
> >
> >   
> >> Regards, and I don't want to bother you,
> >> 
> >
> > You're welcome.
> >
> >   
> It Worked like a charm...Thanks Again
> :-)
> Does the asterisk have a special meaning?!
> Cause I know that with Part and Subsection the asterisk means that it 
> will or will not be numbered parts or sections.

The asterix has no default meaning, it is up to the command itself how
to interpret it. Not all commands interpret the asterix in a special way.
In general, you have to check the command documentation.

> What would be the best way of discovering what the asterisk would do in 
> this specific command? (It is just for information, learn about LATEX 
> and LYX).

Try "texdoc eso-pic" in a terminal and, if the documentation for the eso-pic
package is installed, it will be shown. Otherwise you can read it here:
http://www.ctan.org/get/macros/latex/contrib/eso-pic/eso-pic.pdf

-- 
Enrico


  1   2   3   4   >