Where does LyX store "Window layouts and geometries" on Windows?

2019-01-23 Thread Klaus-Dieter Bauer
Hello!

I was wondering, where LyX stores information used when using the option
"Restore Window Layouts and Geometries" in Preferences > Look & Feel >
Document Handling. I am using Windows 10 and Lyx2.3.2-2.

I noticed that this data isn't stored in "%APPDATA%/Lyx2.3", because
syncing this folder across machines ended up syncing other session
information (cursor positions, opened files, ...) but not window layouts.
Likewise, resetting this directory didn't fix the fullscreen bug #9703
, which is preserved across sessions.
And indeed, nothing in the %APPDATA%/Lyx2.3/session file indicates layouts
or geometries.

- Klaus


Get notifications on a trac ticket without commenting?

2018-12-18 Thread Klaus-Dieter Bauer
Hello!

I have just added myself to the CC list of a ticket, which I am interested
in but have no comments to give on. This probably has prompted a
notifications to the people already involved.

Is there some way to follow tickets, without raising a notification to
everyone? Or is this intentional?

- Klaus


UI-customization: No "bookmark-save" in "context-toc-tableofcontents"?

2018-11-29 Thread Klaus-Dieter Bauer
Hello!

I am trying to customize the user interface to allow easily viewing
different parts of the same document, without changing the cursor position
in the current view. I have already overridden menu-entries for "New
Window" and "Split Vertically" by surrounding the usual command with
``bookmark-save 9`` and ``bookmark-goto 9``, such that new split views or
new windows are opened at the current cursor position.

I was trying to the the same with the Outline pane, but I have found that
for the context-menu `` Menu "context-toc-tableofcontents" `` the command
``bookmark-save`` is disabled.

Is anyone aware of a workaround for this?

regards, Klaus


Re: Option for displaying equation labels less obstrusively?

2018-10-04 Thread Klaus-Dieter Bauer
Insets cannot be used inside LyX equations sadly.

On Thu, Oct 4, 2018 at 2:31 AM John Kane  wrote:

> Try the ShortInsetNames module. I have never used it with equations but it
> works well with Chapter and Section names, tables and figures.
>
> Insert the Short label  from Custom Inserts and then insert the label.
> Repeat procedure with Short Ref + label to have a short label in the text
> or wherever
>
> Thanks Andrew.
>
> On Wed, 3 Oct 2018 at 17:58, Joel Kulesza  wrote:
>
>> On Wed, Oct 3, 2018 at 3:36 PM Klaus-Dieter Bauer <
>> bauer.klaus.die...@gmail.com> wrote:
>>
>>> Hello!
>>>
>>> As it is currently implemented, equation labels are displayed as part of
>>> the equation number in LyX's editor. Sadly, for longer, semantically
>>> meaningful label names (e.g. "eq:maxwell-equations-in-vacuum"), this throws
>>> off the formatting in the editor buffer: Instead of centering the equation,
>>> the combination of label and equation is centered. A similar problem
>>> occurs, when left-aligned equations with left-aligned numbering are used.
>>>
>>> Is there some setting in LyX, that allows getting better alignment,
>>> without sacrifizing the ability to use long label names?
>>>
>>> - Klaus
>>>
>>
>> I do not know of such a method, but would be thrilled if such were
>> created (or explained).  I wonder if mouseover tooltips could be used
>> here...
>>
>> - Joel
>>
>>
>
>
> --
> John Kane
> Kingston ON Canada
>


Option for displaying equation labels less obstrusively?

2018-10-03 Thread Klaus-Dieter Bauer
Hello!

As it is currently implemented, equation labels are displayed as part of
the equation number in LyX's editor. Sadly, for longer, semantically
meaningful label names (e.g. "eq:maxwell-equations-in-vacuum"), this throws
off the formatting in the editor buffer: Instead of centering the equation,
the combination of label and equation is centered. A similar problem
occurs, when left-aligned equations with left-aligned numbering are used.


Screenshot (if not displayed inline: https://imgur.com/a/Y1rDmgE)
Made in full-screen mode with limited text-width.

Is there some setting in LyX, that allows getting better alignment, without
sacrifizing the ability to use long label names?

- Klaus


Re: Supporting the cleverref package?

2018-09-19 Thread Klaus-Dieter Bauer
Another nice aspect of cleveref is, that it automatically calls references
to appendix sections "appendix". This may become important, when I later
decide to move whole sections to the appendix.

On Wed, Sep 19, 2018 at 3:32 PM Klaus-Dieter Bauer <
bauer.klaus.die...@gmail.com> wrote:

> On Mon, Sep 17, 2018 at 5:09 PM Richard Kimberly Heck 
> wrote:
>
>> On 9/17/18 6:11 AM, Klaus-Dieter Bauer wrote:
>> > Thanks, I wasn't aware of \prettyref support :)
>> >
>> > For my purposes this fits the bill, as the commands seem to be
>> > effectively interchangeable and only really differ in how the
>> > formatting is determined.
>> > Well, except for a possibility to make \cref automatically capitalize
>> > at the beginning of sentences, as done by \prettyref, but I found that
>> > sentences rarely start with references anyway.
>>
>>
>> Well, refstyle does support the capitalization thing, and plurals too.
>> Is there some reason you don't want to use it?
>>
>> Riki
>>
>
> Mostly cross-compatibility with latex export/import and editing the plain
> latex later.
>
> The cleveref package currently implements the best logic, as it bases the
> formatting on the actual target of the reference, rather than the name of
> the label. For instance, if I decide to change a theorem to a result
> environment while end-formatting the plain LaTeX source, both refstyle and
> prettyref would either
>
>- require replacing all references in the document (error-prone for
>multi-file documents), or
>- produce incorrectly formatted references.
>
> - Klaus
>
>


Re: Supporting the cleverref package?

2018-09-19 Thread Klaus-Dieter Bauer
On Mon, Sep 17, 2018 at 5:09 PM Richard Kimberly Heck 
wrote:

> On 9/17/18 6:11 AM, Klaus-Dieter Bauer wrote:
> > Thanks, I wasn't aware of \prettyref support :)
> >
> > For my purposes this fits the bill, as the commands seem to be
> > effectively interchangeable and only really differ in how the
> > formatting is determined.
> > Well, except for a possibility to make \cref automatically capitalize
> > at the beginning of sentences, as done by \prettyref, but I found that
> > sentences rarely start with references anyway.
>
>
> Well, refstyle does support the capitalization thing, and plurals too.
> Is there some reason you don't want to use it?
>
> Riki
>

Mostly cross-compatibility with latex export/import and editing the plain
latex later.

The cleveref package currently implements the best logic, as it bases the
formatting on the actual target of the reference, rather than the name of
the label. For instance, if I decide to change a theorem to a result
environment while end-formatting the plain LaTeX source, both refstyle and
prettyref would either

   - require replacing all references in the document (error-prone for
   multi-file documents), or
   - produce incorrectly formatted references.

- Klaus


Re: Supporting the cleverref package?

2018-09-17 Thread Klaus-Dieter Bauer
Thanks, I wasn't aware of \prettyref support :)

For my purposes this fits the bill, as the commands seem to be effectively
interchangeable and only really differ in how the formatting is determined.
Well, except for a possibility to make \cref automatically capitalize at
the beginning of sentences, as done by \prettyref, but I found that
sentences rarely start with references anyway.

On Thu, Sep 13, 2018 at 10:36 PM Richard Kimberly Heck 
wrote:

> On 09/13/2018 05:31 AM, Klaus-Dieter Bauer wrote:
>
> Hello!
>
> Is there any way wiith LyX's current customization/module interface to add
> support for the cleveref package's \cref{LABEL} command?
>
> The easiest form I can come up with would be an inset style, that is
> exported as \cref{...}, and using the "label-only" setting of the Insert ->
> Cross-Reference dialog. This approach is however cumbersome in two
> important ways:
>
>- It requires adding insert in label in two separate steps.
>- When using tex2lyx, the \cref inset would be correctly created, but
>the label would be inserted as plain-text instead of a cross-reference
>object.
>
> Hence I am looking for a better solution.
>
>
> Obviously, the best option would be to add native support for cleveref.
> This would not be difficult. We already support prettyref and refstyle, so
> it would just be one more option for how "formatted" references are output.
> Feel free to file an enhancement request (cc'ing me), but it is a format
> change so will not happen until 2.4.0.
>
> For now, if all you want is \cref *and do not want to use other types of
> formatted references*, then you can do this. In Document Settings:
>
> 1. Under Document Class, uncheck "Use refstyle"(so you use prettyref).
> 2. In the LaTeX preamble:
> \usepakcage{cleveref}
> \let\prettyref\cref
> 3. In Local Layout:
> Provides prettyref 1
>
> An ugly hack, but it should work. I.e., 'formatted' references are not se
> by cleveref. (The last prevents LyX from loading prettyref.)
>
> Riki
>
>
>


Supporting the cleverref package?

2018-09-13 Thread Klaus-Dieter Bauer
Hello!

Is there any way wiith LyX's current customization/module interface to add
support for the cleveref package's \cref{LABEL} command?

The easiest form I can come up with would be an inset style, that is
exported as \cref{...}, and using the "label-only" setting of the Insert ->
Cross-Reference dialog. This approach is however cumbersome in two
important ways:

   - It requires adding insert in label in two separate steps.
   - When using tex2lyx, the \cref inset would be correctly created, but
   the label would be inserted as plain-text instead of a cross-reference
   object.

Hence I am looking for a better solution.

- Klaus


Change the GUI font?

2018-09-04 Thread Klaus-Dieter Bauer
Is there any way to change the font used in LyX's GUI, or more specifically
the font used in the outline?

The preferences-dialog allows changing the screen-fonts used to display
*documents*, but I didn't see an option to change the GUI font.

I also looked at the .ui files, but couldn't find anything that looked like
it influences the choice of font.

I already tried changing the windows-wide GUI font, but it didn't affect
anything other than the titlebar of the window.

- Klaus


Modules: Indentation inside flex-inset?

2018-05-08 Thread Klaus-Dieter Bauer
Hello!

Is it possible to define a new multi-paragraph flex-inset, such that
paragraphs inside are indented and spaced according to document settings?

As far as I can tell, for documents with "vertical space" paragraph
separation is applied inside multipar flex insets, but "Indentation" is
ignored. As a result in documents that use "Indentation" style paragraph
separation multiparagraph insets lack visual paragraph separation.

I found that I can achieve what I want by using "InsetLayout Branch:"
instead, but in most cases this would be abusing the branch concept.

regards, Klaus


Formatting of Outline view: Intentional or side-effect of native themes?

2018-04-26 Thread Klaus-Dieter Bauer
Hello!

Before submitting an enhancement request, I wanted to ask if there already
*are* possibilities to customize how the outline view looks.

[image: lyx-tree.png]
(mirror for image: https://imgur.com/a/OFAVJCS)

I could imagine that there's some utility that allows changing the Qt theme
or something like that, but I wouldn't even know where to start looking.

I generally find tree-views with lines as visual guides vastly more useful
than the "modern" style of indicating the tree only by indication. My best
guess here is, that Qt choosed a style that mimicks the native style of
modern Windows, which I dislike in this particular case.

I'm certain others will prefer the "line-less" styles, but for me having
the lines would be very helpful in navigating large documents.

- Klaus


Module files: "LabelType manual" with curly braces?

2018-04-24 Thread Klaus-Dieter Bauer
Hello!

In the module/layout-file format, paragraph styles can have a "LabelType
manual", which causes the contents of the paragraph until the first
unprotected space character to be passed as optional argument to the latex
command/environment associated with the paragraph style. The rest of the
paragraph will be passed as curly-braces argument.

   - Is there any method available to make this a "curly-braces" argument?

   - Is it possible to omit the curly braces for the rest of the paragraph?


My intent is to define a paragraph style, that renders like a \paragraph{}
command (i.e. title inline with the text, but bold).

Currently, using "LabelType manual" and "LatexType Command" and setting
LeftDelim and RightDelim to "" I obtain an output

*:1:  \paragraphx[{Title~of~the~paragraph}]{*
*:2:  These are the text contents*
*:3:  of the paragraph*
*:4:  }*
*:5:  *

where *\paragraphx[TITLE] → \paragraph{TITLE}* is a helper macro.

More desirable would be an output

:1:  \paragraph{Title~of~the~paragraph}
:2:  These are the text contents
:3:  of the paragraph
:4:

- Klaus


PS: The style as I am currently defining it:

* Style Paragraphx*
* Category sectioning*
* LatexType command*
* LatexName paragraphx*
* LabelType manual*
* ParIndent xxx*
* TopSep 1*
* ItemSep 1*
* LeftDelim ""*
* RightDelim ""*
* LabelFont*
* Series Bold*
* EndFont*
* LabelSep xxx*
* Preamble*
* \newcommand\paragraphx[1][]{%*
*   %% A wrapper around \paragraph, meant to make*
*   %% it work with LyX 'LabelType manual'.*
*   \paragraph{#1}%*
* }*
* EndPreamble*
* End*


Paste without path conversion?

2018-04-17 Thread Klaus-Dieter Bauer
Hello!

Is it possible to copy/paste between LyX files in different directories,
while preserving the relative paths to images?

Right now, when pasting from LyX to LyX, the paths to the images are
adjusted to be relative paths to the images in the original directory (or
absolute paths if they are on a different drive), e.g.

../../otherstuff/oldproject/img/myimg.png

However, this results in unwanted dependencies between different
directories for me. I'd rather have the original path (img/myimg.png)
preserved, and be told about the missing file by seeing a "could not
generate thumbnail" placeholder or compilation errors.

Is this currently possible?

- Klaus


Re: Automatically reload externally changed ".lyx" files?

2018-04-16 Thread Klaus-Dieter Bauer
I have created a trac-ticket a while back ( https://www.lyx.org/trac/
ticket/10997 ) and now added the discussion from here to the ticket.

2018-04-14 23:42 GMT+02:00 Scott Kostyshak <skost...@lyx.org>:

> On Mon, Mar 05, 2018 at 09:52:32PM +, Guillaume Munch wrote:
> > On Sat, Mar 3, 2018 at 2:16 PM, Scott Kostyshak <skost...@lyx.org>
> wrote:
> >
> > > On Fri, Mar 02, 2018 at 02:12:36PM +, Klaus-Dieter Bauer wrote:
> > >
> > > > A direct comparison is probably difficult, as LyX draws especially
> much
> > > > information from background files (macro definitions, TOC, ...).
> > >
> > > Thanks for that great research, Klaus, and all of those details! I'm
> > > CC'ing Guillaume. He has worked on this feature so might have an
> opinion
> > > on this thread. We might want to eventually open a trac ticket for this
> > > so that it does not get lost in the mail archives.
> > >
> > > Scott
> > >
> >
> > Hello, it is a good idea to automatically reload background files. This
> is
> > not so simple, though, because the change notification can happen at
> random
> > times and it is not clear that the code is ready for this. I have an idea
> > to make it work, but this will need to wait that I am back from holidays.
> > It is best to open a ticket for now.
>
> Klaus, did you open a trac ticket for this? It would be great if you
> could do that and summarize the conversation.
>
> Thanks,
>
> Scott
>


Re: Long preview compilation due to unnecessarily often calling pdflatex?

2018-03-19 Thread Klaus-Dieter Bauer
>  Hopefully someone here knows whether there's something we should improve.

Mostly just the ability to get a faster error reports and layout previews
by forcing single-pass compilation of the PDF preview (unless it already
exists and I just can't find it).

- Klaus

2018-03-19 1:05 GMT+01:00 Scott Kostyshak <skost...@lyx.org>:

> On Sun, Mar 18, 2018 at 08:20:55PM +, Klaus-Dieter Bauer wrote:
> > I attached a simple example file. Sorry for the late replay, seems I
> didn't
> > get the previous message.
>
> Thanks for the example file!
>
> > shows no changes between 3rd and 4th pass.
>
> I can reproduce that LyX does 4 compilations.
>
> Hopefully someone here knows whether there's something we should
> improve.
>
> Best,
>
> Scott
>


Re: Long preview compilation due to unnecessarily often calling pdflatex?

2018-03-18 Thread Klaus-Dieter Bauer
I attached a simple example file. Sorry for the late replay, seems I didn't
get the previous message.

I was able to determine a few performance issues (LyX 2.3.0b prerelease):

   - LyX executes pdflatex apparently until the log file stops changing
   (except for the start time header?). While technically a reasonable
   convergence criterion, this alone ads an additional pdflatex pass.

   - With bibtex "x.lyx" finishes after 3 pdflatex passes; biblatex
   requires a 4th pass, with the following diff between 2nd and 3rd run:

>> diff x.log.2 x.log.3
[...]

660,669d659

<

< LaTeX Warning: There were undefined references.

<

<

< LaTeX Warning: Label(s) may have changed. Rerun to get cross-references
right.

<

<

< Package biblatex Warning: Please rerun LaTeX.

< (biblatex)Page breaks have changed.

<

675,676c665,666

<  18970 strings out of 493305

<  369810 string characters out of 3138875

---

>  18974 strings out of 493305

>  369854 string characters out of 3138875

[...]


   - Note that I didn't observe anything actually changing in the pdf
  between 2nd and 3rd run.

  - Using the "todonotes" module makes each pdflatex pass significantly
   slower.

I couldn't reproduce cases with 5 or more passes in a minimal example. But
for my thesis file I am getting 6 pdflatex passes, even though the log file
shows no changes between 3rd and 4th pass.

All of this wouldn't be much of a problem, if I knew a method to force a
single pdflatex pass in order to see results as quickly as possible; This
would be helpful during some steps such as fine-adjustments to the layout,
fine-adjustments to overlay-specifications in beamer presentations, or when
trying to debug compilation issues.

- Klaus


2018-03-18 4:57 GMT+01:00 Scott Kostyshak <skost...@lyx.org>:

> On Wed, Feb 28, 2018 at 12:04:41PM -0500, Scott Kostyshak wrote:
> > On Wed, Feb 28, 2018 at 01:59:54PM +, Klaus-Dieter Bauer wrote:
> >
> > > This raises the question of how LyX actually determines the number of
> times
> > > it has to run the converter; 5 times seems excessive, especially after
> the
> > > first run nothing changes anymore (latexmk).
> >
> > I believe we determine the number of times by examining the log file.
> > Can you provide us with a minimal example so that we can reproduce the
> > excessive compilation and hopefully fix it? It will probably take some
> > time for you to make a minimal example, but if we can't reproduce it, it
> > is hard for us to fix it.
>
> Klaus, can you send us a minimal example?
>
> Thanks,
>
> Scott
>


x.lyx
Description: application/lyx


Re: Automatically reload externally changed ".lyx" files?

2018-03-02 Thread Klaus-Dieter Bauer
2018-03-01 18:46 GMT+01:00 Scott Kostyshak <skost...@lyx.org>:

> On Mon, Jan 22, 2018 at 12:39:22PM +0000, Klaus-Dieter Bauer wrote:
> > Hello!
> >
> > At least as of LyX 2.3.0 LyX displays a "Reload file" prompt, if it
> detects
> > that the LyX file has been changed externally, e.g. by Dropbox, external
> > version control, or user scripts. As a great bonus, LyX even checks if
> the
> > contents (not only the modification time) has changed.
> >
> > However, when changing a lot of files at once (e.g. checking out an
> earlier
> > version of a document with many child-documents from Git), each file has
> a
> > separate prompt, and even files that were previously opened only
> invisibly
> > in the background are suddenly visible. The best work-around I could
> > idemtify, was to close and restart LyX having enabled the setting
> *“Tools →
> > Preferences → Look & Feel → Document Handling → Load opened files from
> last
> > session”.*
> >
> > Is it possible to make LyX silently automatically reload the files, if no
> > changes were made inside LyX since the last save?
>
> Makes sense. Do you know how any other program behaves in similar
> situations? We try to follow convention when we can.
>
> Scott


A direct comparison is probably difficult, as LyX draws especially much
information from background files (macro definitions, TOC, ...).  But both
TeXStudio and Emacs (with *[global-]auto-revert-mode*) automatically reload
files when there is no conflict.



* TeXStudio. Seems to do pretty much what I was trying to achieve. - For an
open file, - If it doesn't have unsaved changes, the file is silently
reloaded from disk.- If it has unsaved changes, a prompt asks if it should
be reloaded.- Background files- cannot contain unsaved changes (apparently
the same as in LyX)- Macro definitions found in background files are
silently reloaded, if the file changes.*
*Emacs with "auto-revert-mode".* Also quite similar.

   - If the buffer contents are unchanged, but the file has changed, the
   buffer is automatically reloaded with only a log message. Checks for
   changes occur periodically every *``auto-revert-interval``* seconds.
   Since Emacs doesn't distinguish between visible and invisible buffers, this
   happens entirely in the background.
   - If the buffer contents are changed, a warning is displayed when the
   user is trying to overwrite the file with the changes made inside Emacs.

Without auto-revert-mode, the user is prompted for a reload when starting
to edit the buffer whose file has been changed.

Probably for historical reasons, Emacs polls the opened files for changes,
which probably incurs some performance overhead. (Setting
*auto-revert-interval* too low is really noticable).

- Klaus


Long preview compilation due to unnecessarily often calling pdflatex?

2018-02-28 Thread Klaus-Dieter Bauer
Hello!

I'm recently having problems with LyX compiling exceptionally slowly
(compared to plain latex editors). Checking the log, I noticed that LyX
calls pdflatex a full 5 times for my thesis (but only once for a new
document, and 2 or 3 times for a test document derived from the thesis
file).

In an attempt to improve compilation time, in "Tools > Preferences > File
Handling > Converters > LaTeX (pdflatex) to PDF (pdflatex)" I changed the
command to use

latexmk -pdf -pdflatex="pdflatex -interaction=nonstopmode -synctex=1"
$$i

which works; latexmk efficiently compiles the document in the first run,
and reports only "nothing to do" in the next 4 runs called by LyX.

This raises the question of how LyX actually determines the number of times
it has to run the converter; 5 times seems excessive, especially after the
first run nothing changes anymore (latexmk).

- Klaus


Hide section numbers in outline?

2018-01-24 Thread Klaus-Dieter Bauer
Hello!

Is it possible to hide the section numbers in the outline pane?

Most of the time I am using two documents side-by-side (*View → Split View
into Left and Right Half*), which means that I need to keep sidepanes
narrow. For the outline pane however, the combination of strong indentation
and section numbers result in barely readable section titles.
 ___
|Outline   [] X |
|  ___  |
| |Table of Contents v| |
|  ‾‾‾  |
|  ___  |
| | > Chapter 5 TODO Unders...| |
| | v Chapter 6 Definition ...| |
| |   v 6.1 Maxwell Equatio...| |
| |X 0.0.1 Electrom...| |
| |6.1.1 Maxwell eq...| |
| |6.1.2 Gauge free...| |
| |6.1.3 Complicati...| |
| |6.1.4 Solutions ...| | _  _
| |  6.1.4.1 Scalar...| || || |
| |  6.1.4.2 Electr...| | -+ | || |
| |  6.1.4.3 Electr...| |  | |_||_|
| |  6.1.4.4 Electr...| | -+  _  _
| |  6.1.4.5 Multip...| ||_||_|
| |6.1.5 Near-field...| |
| |6.1.6 TODO Macro...| |
| |   | |
| |___| |
|  .   .   .   .   .   [ ]Sort  |
| [#]--+---+---+---+   [ ]Keep  |
|  '   '   '   '   '|
|___|
(or see https://postimg.org/image/i1yngguv7/ )

I therefore need some way to make the outline pane compact, without
truncating titles that much, e.g.

   1. hiding the numbers (which I really don't need here)
   2. change the font-size in the outline pane

Is theresomething I can do to achieve this?

- Klaus


Re: Lyx layouts, and DependsOn: Doesn't force inclusion in preamble?

2018-01-23 Thread Klaus-Dieter Bauer
It seems that DependsOn works only for styles depending on styles; It
cannot have a style depend on an inset, or an inset on a style apparently.

Which means, that definitions needed by multiple InsetLayout's always have
to go to the global Preamble block.

Is there maybe some alternative to "DependsOn" that works across both
styles and insets?

- Klaus

2018-01-23 18:43 GMT+01:00 Klaus-Dieter Bauer <bauer.klaus.die...@gmail.com>
:

> I figured it out myself: The DependsOn property apparently doesn't
> actually work for insets (only for styles).
>
> 2018-01-23 18:27 GMT+01:00 Klaus-Dieter Bauer <
> bauer.klaus.die...@gmail.com>:
>
>> Hello!
>>
>> Is there some way to specify layouts, that depend on the preamble of
>> another?
>>
>> Consider e.g. the following LyX file:
>>
>> #LyX 2.3 created this file.
>> \lyxformat 544
>> \begin_document
>> \begin_header
>> \begin_local_layout
>> InsetLayout Flex:AAA
>> LyxType custom
>>   LabelString AAA
>> LatexName AAA
>> LatexType command
>> Preamble
>> \newcommand\AAA[1]{hello #1 world}
>> EndPreamble
>> End
>>
>> InsetLayout Flex:BBB
>> LyxType custom
>> LabelString BBB
>> LatexName BBB
>> LatexType command
>> DependsOn Flex:AAA
>> Preamble
>> \newcommand\BBB[1]{bye(\AAA{#1})}
>> EndPreamble
>> End
>>
>> \end_local_layout
>> \end_header
>> \begin_body
>> \begin_layout Standard
>> \begin_inset Flex BBB
>> status open
>> \begin_layout Plain Layout
>> Hello.
>> \end_layout
>> \end_inset
>> \end_layout
>> \end_body
>> \end_document
>>
>>
>> The dependency of BBB on AAA is explicitly declared, but using \BBB in
>> the body adds only the preamble of \BBB, but not the preamble of \AAA,
>> causing an "undefined control sequence" error on compilation.
>>
>> As I understand, DependsOn merely declares that the preamble of AAA
>> should be added *before* the preamble of BBB, but only _if_ AAA is used
>> itself.
>>
>> I couldn't find any feature that allows to declare an actual dependency,
>> rather than just the ordering. Am I missing something?
>>
>> - Klaus
>>
>
>


Re: Lyx layouts, and DependsOn: Doesn't force inclusion in preamble?

2018-01-23 Thread Klaus-Dieter Bauer
I figured it out myself: The DependsOn property apparently doesn't actually
work for insets (only for styles).

2018-01-23 18:27 GMT+01:00 Klaus-Dieter Bauer <bauer.klaus.die...@gmail.com>
:

> Hello!
>
> Is there some way to specify layouts, that depend on the preamble of
> another?
>
> Consider e.g. the following LyX file:
>
> #LyX 2.3 created this file.
> \lyxformat 544
> \begin_document
> \begin_header
> \begin_local_layout
> InsetLayout Flex:AAA
> LyxType custom
>   LabelString AAA
> LatexName AAA
> LatexType command
> Preamble
> \newcommand\AAA[1]{hello #1 world}
> EndPreamble
> End
>
> InsetLayout Flex:BBB
> LyxType custom
> LabelString BBB
> LatexName BBB
> LatexType command
> DependsOn Flex:AAA
> Preamble
> \newcommand\BBB[1]{bye(\AAA{#1})}
> EndPreamble
> End
>
> \end_local_layout
> \end_header
> \begin_body
> \begin_layout Standard
> \begin_inset Flex BBB
> status open
> \begin_layout Plain Layout
> Hello.
> \end_layout
> \end_inset
> \end_layout
> \end_body
> \end_document
>
>
> The dependency of BBB on AAA is explicitly declared, but using \BBB in the
> body adds only the preamble of \BBB, but not the preamble of \AAA, causing
> an "undefined control sequence" error on compilation.
>
> As I understand, DependsOn merely declares that the preamble of AAA should
> be added *before* the preamble of BBB, but only _if_ AAA is used itself.
>
> I couldn't find any feature that allows to declare an actual dependency,
> rather than just the ordering. Am I missing something?
>
> - Klaus
>


Lyx layouts, and DependsOn: Doesn't force inclusion in preamble?

2018-01-23 Thread Klaus-Dieter Bauer
Hello!

Is there some way to specify layouts, that depend on the preamble of
another?

Consider e.g. the following LyX file:

#LyX 2.3 created this file.
\lyxformat 544
\begin_document
\begin_header
\begin_local_layout
InsetLayout Flex:AAA
LyxType custom
  LabelString AAA
LatexName AAA
LatexType command
Preamble
\newcommand\AAA[1]{hello #1 world}
EndPreamble
End

InsetLayout Flex:BBB
LyxType custom
LabelString BBB
LatexName BBB
LatexType command
DependsOn Flex:AAA
Preamble
\newcommand\BBB[1]{bye(\AAA{#1})}
EndPreamble
End

\end_local_layout
\end_header
\begin_body
\begin_layout Standard
\begin_inset Flex BBB
status open
\begin_layout Plain Layout
Hello.
\end_layout
\end_inset
\end_layout
\end_body
\end_document


The dependency of BBB on AAA is explicitly declared, but using \BBB in the
body adds only the preamble of \BBB, but not the preamble of \AAA, causing
an "undefined control sequence" error on compilation.

As I understand, DependsOn merely declares that the preamble of AAA should
be added *before* the preamble of BBB, but only _if_ AAA is used itself.

I couldn't find any feature that allows to declare an actual dependency,
rather than just the ordering. Am I missing something?

- Klaus


Automatically reload externally changed ".lyx" files?

2018-01-22 Thread Klaus-Dieter Bauer
Hello!

At least as of LyX 2.3.0 LyX displays a "Reload file" prompt, if it detects
that the LyX file has been changed externally, e.g. by Dropbox, external
version control, or user scripts. As a great bonus, LyX even checks if the
contents (not only the modification time) has changed.

However, when changing a lot of files at once (e.g. checking out an earlier
version of a document with many child-documents from Git), each file has a
separate prompt, and even files that were previously opened only invisibly
in the background are suddenly visible. The best work-around I could
idemtify, was to close and restart LyX having enabled the setting *“Tools →
Preferences → Look & Feel → Document Handling → Load opened files from last
session”.*

Is it possible to make LyX silently automatically reload the files, if no
changes were made inside LyX since the last save?

- Klaus


Layout files: Preamble inheritance?

2018-01-16 Thread Klaus-Dieter Bauer
Hello!

Is there some way to tell LyX, that some layout definitions (in *Document →
Local Layout* or in a layout/module file) depend on the preamble defined by
others?

E.g. consider the following:

InsetLayout Flex:Test
Decoration classic
LyxType custom
LatexType   command
LatexName testit
LabelString Test
Preamble
\newcommand\testit[1]{testit(#1)}
EndPreamble
End

InsetLayout Flex:TestInherit
CopyStyle Flex:Test
LatexName testitb
LabelString TestInherit
Preamble
\newcommand\testitb[1]{((\testit{#1}))}
EndPreamble
End


IfI am searching for a way to tell LyX about this dependency, i.e. *“If
Flex:TestInherit is used, also add the preamble defined by Flex:Test, even
if it isn't used separately.”*

Full exaple file:
https://drive.google.com/open?id=1barXTBvo7HvozHCPc2bJ8kSBB0HkokOB

- Klaus


Re: List of TODOs missing from LyX interface?

2017-06-09 Thread Klaus-Dieter Bauer
Forgot to answer it to the mailing list.

2017-06-09 2:00 GMT+02:00 John Kane <jrkrid...@gmail.com>:

> Sorry, I misunderstood you. They don't furn up in the outlliner for me
> either. I don't think they are intended to.  I know you can insert a ToDo
> list in the pdf but I don't have any idea about the outliner.
>
> On 8 June 2017 at 13:04, Klaus-Dieter Bauer <bauer.klaus.die...@gmail.com>
> wrote:
>
>> The items defined in ``todonotes.module`` show up in the ``Insert`` menu,
>> but the question was about these items being displayed in the ``Outline``
>> pane and the ``Navigation`` menu.
>>
>> Two module – ``todonotes.module`` and ``theorems-std.module`` via
>> ``theorems.inc`` – contain a ``OutlinerName`` line and corresponding
>> ``AddToToc`` lines in the relevant inset and style definitions.
>>
>> I assumed these are supposed to be visible in the ``Outline`` views of
>> LyX, so I wanted to ask about the effect of these declarations which, as
>> far as I can tell, seem to have no effect.
>>
>> - Klaus
>>
>> 2017-06-08 17:28 GMT+02:00 John Kane <jrkrid...@gmail.com>:
>>
>>> It definitely is not showing up  in "Insert > Custom Inserts"?
>>>
>>> On 8 June 2017 at 10:32, Klaus-Dieter Bauer <
>>> bauer.klaus.die...@gmail.com> wrote:
>>>
>>>> Hello!
>>>>
>>>> In ``todonotes.module`` I noticed the line
>>>>
>>>> OutlinerName todonotes "TODO"
>>>>
>>>>
>>>> which I assume is meant to add the list of TODOs to the user interface
>>>> in the manner of the table of contents and list of figures etc, i.e. having
>>>> entries in both the "Navigate" menu and the "Outline" pane.
>>>>
>>>> However, I can't find any indication of such an outliner in the
>>>> interface after adding the module and a todonnote. (I uploaded the example
>>>> file to [1] for reference).
>>>>
>>>> Is there any possibility to get this working?
>>>>
>>>> If not, would this be considered a bug?
>>>>
>>>>   - Klaus
>>>>
>>>> ––
>>>>
>>>> [1] https://drive.google.com/drive/folders/0Bxu3imuSrPFaUVcyOWxfZ1h4bzQ
>>>>
>>>>
>>>
>>>
>>> --
>>> John Kane
>>> Kingston ON Canada
>>>
>>
>>
>
>
> --
> John Kane
> Kingston ON Canada
>


List of TODOs missing from LyX interface?

2017-06-08 Thread Klaus-Dieter Bauer
Hello!

In ``todonotes.module`` I noticed the line

OutlinerName todonotes "TODO"


which I assume is meant to add the list of TODOs to the user interface in
the manner of the table of contents and list of figures etc, i.e. having
entries in both the "Navigate" menu and the "Outline" pane.

However, I can't find any indication of such an outliner in the interface
after adding the module and a todonnote. (I uploaded the example file to
[1] for reference).

Is there any possibility to get this working?

If not, would this be considered a bug?

  - Klaus

––

[1] https://drive.google.com/drive/folders/0Bxu3imuSrPFaUVcyOWxfZ1h4bzQ


Re: "Local Layout" in external file?

2016-11-24 Thread Klaus-Dieter Bauer
2016-11-23 17:03 GMT+01:00 Richard Heck <rgh...@lyx.org>:

> On 11/23/2016 04:49 AM, Klaus-Dieter Bauer wrote:
>
> 2014-11-13 11:20 GMT+01:00 Klaus-Dieter Bauer <
> bauer.klaus.die...@gmail.com>:
>>
>> 2014-11-07 19:50 GMT+01:00 Richard Heck <rgh...@lyx.org>:
>>
>>> On 11/07/2014 10:25 AM, Klaus-Dieter Bauer wrote:
>>>
>>>> Hello!
>>>>
>>>> Is there a method to share document settings (document class, font
>>>> size, ...) across all subdocuments of a project?
>>>>
>>>> My intention is to be able to compile each file separately (for faster
>>>> debugging), with changes to document settings being automatically shared
>>>> across all files and explicitly WITHOUT manually changing settings like
>>>> \includeonly or commenting-out include statements.
>>>>
>>>
>>> Note that Document> Settings> Child Documents provides a different way
>>> to do this. But I understand the desire to compile the documents
>>> separately. And that can sort of be done.
>>>
>>> If you can get the settings right at the start, then you can put them
>>> into a sort of template file and use that to start all your documents. But
>>> if you need to change something, you'll have to change it manually in each
>>> of the sub-documents. The exception is anything you put in the LaTeX
>>> preamable. That can be synchronized by putting it all into some common file
>>> and then incuding that.
>>>
>>> Richard
>>>
>> Since I found manually changing the documents tiresome, I wrote a script
>> that extracts, overwrites and copies the header section between lyx files
>> and uploaded it to
>>
>> https://gist.github.com/kbauer/2282492968f061b94f82
>>
>
> Picking up on my old question again, with a more limited scope: Is there
> some feature that allows putting the "local layout" in an external file,
> that is local to the current project (e.g. in the same directory as the lyx
> file)?
>
>
> No. This facility does exist for layout files, but it causes all kinds of
> problems, and I've meant for some years to remove it.
>
> I am recently heavily using the "local layout" feature in my documents.
> This does however come with some disadvantages, notably a very limited
> internal editor and the need to manually (or with an external script)
> synchronize the setting across multiple files of a project. Installing them
> as system-wide modules isn't a good solution either, when I want to ensure
> that files that were created with an old version of my local-layout will
> still compile in the future, let alone on other people's LyX-installation –
> or my own in three years.
>
>
> We've discussed the possibility before of allowing for the possibility of
> launching an external editor, etc, for Local Layout. But no one has ever
> done it.
>
> I'm not totally sure why installing them as modules is a bad idea. Perhaps
> "system-wide" is meant to indicate that you aren't putting them in your
> local user directory?
>
> Richard
>

Hello!

By system-wide I mean that they are shared across all projects on the local
machine, and cannot be transferred to other machines easily as part of a
project. Just for clarification, do you mean
https://wiki.lyx.org/LyX/UserDir which for Windows would be
%APPDATA%\Lyx\ ?

It is also not easily possible to archive a LyX document together with the
installed modules it used, to ensure that future changes to the layout
(such as removal of deprecated custom insets, or loss of disused modules)
don't break archived documents. While manually archiving all user-modules
along with the document is certainly doable, it is also easily forgotten.

Convenience-wise, adding or modifying a local layout is more friction-free
than reloading changed modules installed to the user directory; As far as I
remember that requires "Tools > Reconfigure". Sadly that convenience breaks
down when having more than one file...

To summarize,

   - "Local layout" doesn't work well with multi-file documents.
   - UserDir modules are easily forgotten when archiving or transferring
   LyX files to other users/devices.

We've discussed the possibility before of allowing for the possibility of
> launching an external editor, etc, for Local Layout. But no one has ever
> done it.


It would already help though, if these places just used a monospaced font,
allowing source-code formatting with whitespace-indentation.

regards, Klaus


"Local Layout" in external file?

2016-11-23 Thread Klaus-Dieter Bauer
2014-11-13 11:20 GMT+01:00 Klaus-Dieter Bauer <bauer.klaus.die...@gmail.com>
:
>
> 2014-11-07 19:50 GMT+01:00 Richard Heck <rgh...@lyx.org>:
>
>> On 11/07/2014 10:25 AM, Klaus-Dieter Bauer wrote:
>>
>>> Hello!
>>>
>>> Is there a method to share document settings (document class, font size,
>>> ...) across all subdocuments of a project?
>>>
>>> My intention is to be able to compile each file separately (for faster
>>> debugging), with changes to document settings being automatically shared
>>> across all files and explicitly WITHOUT manually changing settings like
>>> \includeonly or commenting-out include statements.
>>>
>>
>> Note that Document> Settings> Child Documents provides a different way to
>> do this. But I understand the desire to compile the documents separately.
>> And that can sort of be done.
>>
>> If you can get the settings right at the start, then you can put them
>> into a sort of template file and use that to start all your documents. But
>> if you need to change something, you'll have to change it manually in each
>> of the sub-documents. The exception is anything you put in the LaTeX
>> preamable. That can be synchronized by putting it all into some common file
>> and then incuding that.
>>
>> Richard
>>
> Since I found manually changing the documents tiresome, I wrote a script
> that extracts, overwrites and copies the header section between lyx files
> and uploaded it to
>
> https://gist.github.com/kbauer/2282492968f061b94f82
>

Picking up on my old question again, with a more limited scope: Is there
some feature that allows putting the "local layout" in an external file,
that is local to the current project (e.g. in the same directory as the lyx
file)?

I am recently heavily using the "local layout" feature in my documents.
This does however come with some disadvantages, notably a very limited
internal editor and the need to manually (or with an external script)
synchronize the setting across multiple files of a project. Installing them
as system-wide modules isn't a good solution either, when I want to ensure
that files that were created with an old version of my local-layout will
still compile in the future, let alone on other people's LyX-installation –
or my own in three years.

regards, Klaus


Lyx's tab/window capabilities?

2016-03-30 Thread Klaus-Dieter Bauer
LyX has an option "Open documents in tabs" in
Preferences > Document Handling.

As far as I can tell, disabling this option
causes LyX to open different documents
in new windows, but grouping files belonging
to the same output document into the same
window into tabs.

Is it possible to detach such tabs into
a new window? Is it possible to open each
FILE in a separate window?


=== The purpose ===

I am sometimes working with long documents
where I'd rather split even one document
across multiple windows, e.g. in order to
keep a section, which I am referring to,
opened on a second screen. In such cases
having more than one window per document,
or even displaying the same file in multiple
windows at once, would be useful.

Basically I am trying to use windows
to recreate an equivalent of spreading out
notes on a table.

- Klaus


Instant Preview when opening existing LyX file?

2015-05-04 Thread Klaus-Dieter Bauer
Hello!

When I open my existing LyX files with instant preview enabled for
equations, existing equations will only be rendered as instant-preview
after I change something in them.

Many of my equations however contain inconvenient visual clutter, e.g.
empty left sides or large horizontal spaces in AMS align environments.
These would look much better in the editor if consistently rendered as
preview, rather than as the equation editor.

Is it possible to make LyX render a preview for existing equations when
opening a file?

- Klaus


Re: Instant Preview when opening existing LyX file?

2015-05-04 Thread Klaus-Dieter Bauer
Hello again!

I tried a minimal example (simple-example.lyx) and there it actually
worked. It also worked after seriously stripping down an actual project
file.

It turns out that the issue arose due to a command defined with
\providecommand in the body of the text and used within \AtEndDocument.
When compiling the preview, the contents of the body of the lyx document
are imported into a single preview block,

\begin{preview}
\input{1E_...}
\end{preview}

Here \providecommand defines the macro locally to this environment, but
\AtEndDocument has a global effect, so when reaching \end{document} the
previously defined macro is used but undefined, preventing compilation. In
such cases, LyX tends to fail quietly, and I mistook it for standard
behaviour since it affected all my recent documents.

So, thanks for the help! Awkwardly enough, yet again do a minimal example
showed the origin of the issue :-/


best regards, Klaus


2015-05-04 13:09 GMT+02:00 edu Gpl mandrivagn...@gmail.com:

 Can you add examle.lyx .
 Regards

 ‏في الاثنين، ٤ مايو، ٢٠١٥, Klaus-Dieter Bauer 
 bauer.klaus.die...@gmail.com كتب:

 Hello!

 When I open my existing LyX files with instant preview enabled for
 equations, existing equations will only be rendered as instant-preview
 after I change something in them.

 Many of my equations however contain inconvenient visual clutter, e.g.
 empty left sides or large horizontal spaces in AMS align environments.
 These would look much better in the editor if consistently rendered as
 preview, rather than as the equation editor.

 Is it possible to make LyX render a preview for existing equations when
 opening a file?

 - Klaus




simple-example.lyx
Description: application/lyx


Instant Preview when opening existing LyX file?

2015-05-04 Thread Klaus-Dieter Bauer
Hello!

When I open my existing LyX files with instant preview enabled for
equations, existing equations will only be rendered as instant-preview
after I change something in them.

Many of my equations however contain inconvenient visual clutter, e.g.
empty left sides or large horizontal spaces in AMS align environments.
These would look much better in the editor if consistently rendered as
preview, rather than as the equation editor.

Is it possible to make LyX render a preview for existing equations when
opening a file?

- Klaus


Re: Instant Preview when opening existing LyX file?

2015-05-04 Thread Klaus-Dieter Bauer
Hello again!

I tried a minimal example (simple-example.lyx) and there it actually
worked. It also worked after seriously stripping down an actual project
file.

It turns out that the issue arose due to a command defined with
\providecommand in the body of the text and used within \AtEndDocument.
When compiling the preview, the contents of the body of the lyx document
are imported into a single preview block,

\begin{preview}
\input{1E_...}
\end{preview}

Here \providecommand defines the macro locally to this environment, but
\AtEndDocument has a global effect, so when reaching \end{document} the
previously defined macro is used but undefined, preventing compilation. In
such cases, LyX tends to fail quietly, and I mistook it for standard
behaviour since it affected all my recent documents.

So, thanks for the help! Awkwardly enough, yet again do a minimal example
showed the origin of the issue :-/


best regards, Klaus


2015-05-04 13:09 GMT+02:00 edu Gpl mandrivagn...@gmail.com:

 Can you add examle.lyx .
 Regards

 ‏في الاثنين، ٤ مايو، ٢٠١٥, Klaus-Dieter Bauer 
 bauer.klaus.die...@gmail.com كتب:

 Hello!

 When I open my existing LyX files with instant preview enabled for
 equations, existing equations will only be rendered as instant-preview
 after I change something in them.

 Many of my equations however contain inconvenient visual clutter, e.g.
 empty left sides or large horizontal spaces in AMS align environments.
 These would look much better in the editor if consistently rendered as
 preview, rather than as the equation editor.

 Is it possible to make LyX render a preview for existing equations when
 opening a file?

 - Klaus




simple-example.lyx
Description: application/lyx


"Instant Preview" when opening existing LyX file?

2015-05-04 Thread Klaus-Dieter Bauer
Hello!

When I open my existing LyX files with instant preview enabled for
equations, existing equations will only be rendered as instant-preview
after I change something in them.

Many of my equations however contain inconvenient visual clutter, e.g.
empty left sides or large horizontal spaces in AMS align environments.
These would look much better in the editor if consistently rendered as
preview, rather than as the equation editor.

Is it possible to make LyX render a preview for existing equations when
opening a file?

- Klaus


Re: "Instant Preview" when opening existing LyX file?

2015-05-04 Thread Klaus-Dieter Bauer
Hello again!

I tried a minimal example (simple-example.lyx) and there it actually
worked. It also worked after seriously stripping down an actual project
file.

It turns out that the issue arose due to a command defined with
\providecommand in the body of the text and used within \AtEndDocument.
When compiling the preview, the contents of the body of the lyx document
are imported into a single preview block,

\begin{preview}
\input{1E_...}
\end{preview}

Here \providecommand defines the macro locally to this environment, but
\AtEndDocument has a global effect, so when reaching \end{document} the
previously defined macro is used but undefined, preventing compilation. In
such cases, LyX tends to fail quietly, and I mistook it for standard
behaviour since it affected all my recent documents.

So, thanks for the help! Awkwardly enough, yet again "do a minimal example"
showed the origin of the issue :-/


best regards, Klaus


2015-05-04 13:09 GMT+02:00 edu Gpl <mandrivagn...@gmail.com>:

> Can you add examle.lyx .
> Regards
>
> ‏في الاثنين، ٤ مايو، ٢٠١٥, Klaus-Dieter Bauer <
> bauer.klaus.die...@gmail.com> كتب:
>
> Hello!
>>
>> When I open my existing LyX files with instant preview enabled for
>> equations, existing equations will only be rendered as instant-preview
>> after I change something in them.
>>
>> Many of my equations however contain inconvenient visual clutter, e.g.
>> empty left sides or large horizontal spaces in AMS align environments.
>> These would look much better in the editor if consistently rendered as
>> preview, rather than as the equation editor.
>>
>> Is it possible to make LyX render a preview for existing equations when
>> opening a file?
>>
>> - Klaus
>>
>


simple-example.lyx
Description: application/lyx


Defining full-width insets

2015-04-23 Thread Klaus-Dieter Bauer
Hello!

I am trying to define an inset, that compiles to \begin{widetext} ...
\end{widetext}.

Doing so with InsetLayout however, results in flexible-width insets
(like the Note inset), which is undesirable. E.g. when creating a such
a widetext inset with a single display-style equation inside, it will
be display a left-aligned equation in lyx, strongly at odds with the
compiled result (a full-width equation in a twocolumn document).

Is there some standard way to change this behaviour to be more like
boxes, i.e. full-width in LyX regardless of the contents?

I also posted the question on stackexchange[1] where an answer pointed
out that the behaviour for boxes is achieved by the code

bool InsetBox::hasFixedWidth() const
{
return !params_.width.empty();
}

in InsetBox.cpp, so I fear it may be hard-coded.

For reference, my current layout is

InsetLayout WideText
LyXType  Custom
LabelString  WideText
LatexTypeenvironment
LatexNamewidetext
Decoration   classic
LabelFont
Colorblue
Size Small
EndFont
MultiPar true
OptionalArgs 0
Preamble
\RequirePackage{widetext}
EndPreamble
End

regards, Klaus


[1] 
http://tex.stackexchange.com/questions/240001/defining-a-lyx-inset-that-always-has-full-line-width-in-the-editor


Defining full-width insets

2015-04-23 Thread Klaus-Dieter Bauer
Hello!

I am trying to define an inset, that compiles to \begin{widetext} ...
\end{widetext}.

Doing so with InsetLayout however, results in flexible-width insets
(like the Note inset), which is undesirable. E.g. when creating a such
a widetext inset with a single display-style equation inside, it will
be display a left-aligned equation in lyx, strongly at odds with the
compiled result (a full-width equation in a twocolumn document).

Is there some standard way to change this behaviour to be more like
boxes, i.e. full-width in LyX regardless of the contents?

I also posted the question on stackexchange[1] where an answer pointed
out that the behaviour for boxes is achieved by the code

bool InsetBox::hasFixedWidth() const
{
return !params_.width.empty();
}

in InsetBox.cpp, so I fear it may be hard-coded.

For reference, my current layout is

InsetLayout WideText
LyXType  Custom
LabelString  WideText
LatexTypeenvironment
LatexNamewidetext
Decoration   classic
LabelFont
Colorblue
Size Small
EndFont
MultiPar true
OptionalArgs 0
Preamble
\RequirePackage{widetext}
EndPreamble
End

regards, Klaus


[1] 
http://tex.stackexchange.com/questions/240001/defining-a-lyx-inset-that-always-has-full-line-width-in-the-editor


Defining full-width insets

2015-04-23 Thread Klaus-Dieter Bauer
Hello!

I am trying to define an inset, that compiles to \begin{widetext} ...
\end{widetext}.

Doing so with InsetLayout however, results in flexible-width insets
(like the Note inset), which is undesirable. E.g. when creating a such
a widetext inset with a single display-style equation inside, it will
be display a left-aligned equation in lyx, strongly at odds with the
compiled result (a full-width equation in a twocolumn document).

Is there some standard way to change this behaviour to be more like
boxes, i.e. full-width in LyX regardless of the contents?

I also posted the question on stackexchange[1] where an answer pointed
out that the behaviour for boxes is achieved by the code

bool InsetBox::hasFixedWidth() const
{
return !params_.width.empty();
}

in InsetBox.cpp, so I fear it may be hard-coded.

For reference, my current layout is

InsetLayout WideText
LyXType  Custom
LabelString  WideText
LatexTypeenvironment
LatexNamewidetext
Decoration   classic
LabelFont
Colorblue
Size Small
EndFont
MultiPar true
OptionalArgs 0
Preamble
\RequirePackage{widetext}
EndPreamble
End

regards, Klaus


[1] 
http://tex.stackexchange.com/questions/240001/defining-a-lyx-inset-that-always-has-full-line-width-in-the-editor


Re: Sharing document settings across multiple files

2014-11-13 Thread Klaus-Dieter Bauer
Since I found manually changing the documents tiresome, I wrote a script
that extracts, overwrites and copies the header section between lyx files
and uploaded it to

https://gist.github.com/kbauer/2282492968f061b94f82



2014-11-07 19:50 GMT+01:00 Richard Heck rgh...@lyx.org:

 On 11/07/2014 10:25 AM, Klaus-Dieter Bauer wrote:

 Hello!

 Is there a method to share document settings (document class, font size,
 ...) across all subdocuments of a project?

 My intention is to be able to compile each file separately (for faster
 debugging), with changes to document settings being automatically shared
 across all files and explicitly WITHOUT manually changing settings like
 \includeonly or commenting-out include statements.


 Note that Document Settings Child Documents provides a different way to
 do this. But I understand the desire to compile the documents separately.
 And that can sort of be done.

 If you can get the settings right at the start, then you can put them into
 a sort of template file and use that to start all your documents. But if
 you need to change something, you'll have to change it manually in each of
 the sub-documents. The exception is anything you put in the LaTeX
 preamable. That can be synchronized by putting it all into some common file
 and then incuding that.

 Richard





Re: Sharing document settings across multiple files

2014-11-13 Thread Klaus-Dieter Bauer
Since I found manually changing the documents tiresome, I wrote a script
that extracts, overwrites and copies the header section between lyx files
and uploaded it to

https://gist.github.com/kbauer/2282492968f061b94f82



2014-11-07 19:50 GMT+01:00 Richard Heck rgh...@lyx.org:

 On 11/07/2014 10:25 AM, Klaus-Dieter Bauer wrote:

 Hello!

 Is there a method to share document settings (document class, font size,
 ...) across all subdocuments of a project?

 My intention is to be able to compile each file separately (for faster
 debugging), with changes to document settings being automatically shared
 across all files and explicitly WITHOUT manually changing settings like
 \includeonly or commenting-out include statements.


 Note that Document Settings Child Documents provides a different way to
 do this. But I understand the desire to compile the documents separately.
 And that can sort of be done.

 If you can get the settings right at the start, then you can put them into
 a sort of template file and use that to start all your documents. But if
 you need to change something, you'll have to change it manually in each of
 the sub-documents. The exception is anything you put in the LaTeX
 preamable. That can be synchronized by putting it all into some common file
 and then incuding that.

 Richard





Re: Sharing document settings across multiple files

2014-11-13 Thread Klaus-Dieter Bauer
Since I found manually changing the documents tiresome, I wrote a script
that extracts, overwrites and copies the header section between lyx files
and uploaded it to

https://gist.github.com/kbauer/2282492968f061b94f82



2014-11-07 19:50 GMT+01:00 Richard Heck <rgh...@lyx.org>:

> On 11/07/2014 10:25 AM, Klaus-Dieter Bauer wrote:
>
>> Hello!
>>
>> Is there a method to share document settings (document class, font size,
>> ...) across all subdocuments of a project?
>>
>> My intention is to be able to compile each file separately (for faster
>> debugging), with changes to document settings being automatically shared
>> across all files and explicitly WITHOUT manually changing settings like
>> \includeonly or commenting-out include statements.
>>
>
> Note that Document> Settings> Child Documents provides a different way to
> do this. But I understand the desire to compile the documents separately.
> And that can sort of be done.
>
> If you can get the settings right at the start, then you can put them into
> a sort of template file and use that to start all your documents. But if
> you need to change something, you'll have to change it manually in each of
> the sub-documents. The exception is anything you put in the LaTeX
> preamable. That can be synchronized by putting it all into some common file
> and then incuding that.
>
> Richard
>
>
>


Sharing document settings across multiple files

2014-11-07 Thread Klaus-Dieter Bauer
Hello!

Is there a method to share document settings (document class, font size,
...) across all subdocuments of a project?

My intention is to be able to compile each file separately (for faster
debugging), with changes to document settings being automatically shared
across all files and explicitly WITHOUT manually changing settings like
\includeonly or commenting-out include statements.

regards, Klaus


Sharing document settings across multiple files

2014-11-07 Thread Klaus-Dieter Bauer
Hello!

Is there a method to share document settings (document class, font size,
...) across all subdocuments of a project?

My intention is to be able to compile each file separately (for faster
debugging), with changes to document settings being automatically shared
across all files and explicitly WITHOUT manually changing settings like
\includeonly or commenting-out include statements.

regards, Klaus


Sharing document settings across multiple files

2014-11-07 Thread Klaus-Dieter Bauer
Hello!

Is there a method to share document settings (document class, font size,
...) across all subdocuments of a project?

My intention is to be able to compile each file separately (for faster
debugging), with changes to document settings being automatically shared
across all files and explicitly WITHOUT manually changing settings like
\includeonly or commenting-out include statements.

regards, Klaus


On-the-fly preview? (Beyond instant-preview)

2014-09-02 Thread Klaus-Dieter Bauer
Hello!

Publications in physics mostly use a two-column format and I am recently
trying to adopt this style for my private (equation-heavy) summaries as
well. However, I found that for my workflow in two-column documents fast
feedback about the layout of equations, especially their width with respect
to column width, is essential.

In TeXStudio there is the preview feature, which on the fly while editing
the equation provides a rendering, as it will appear in the document, but
obviously TeXStudio lacks LyX's convenience in editing the equation.
However, LyX's instant-preview feature (which by default is disabled for
math) requires interrupting editing the equation, moving the cursor
outside. Also, when the equation is too wide for the column, it will be cut
off in the preview rather than showing the full misformatted equation
(though this is actually positive for unnumbered equations).

So I was wondering if I am missing a feature. Is there some on-the-fly
preview of equations possible in LyX, while editing the equation? Currently
my best guess is document preview with Ctrl+R (pdflatex), but this is still
rather slow.

regards, Klaus


On-the-fly preview? (Beyond instant-preview)

2014-09-02 Thread Klaus-Dieter Bauer
Hello!

Publications in physics mostly use a two-column format and I am recently
trying to adopt this style for my private (equation-heavy) summaries as
well. However, I found that for my workflow in two-column documents fast
feedback about the layout of equations, especially their width with respect
to column width, is essential.

In TeXStudio there is the preview feature, which on the fly while editing
the equation provides a rendering, as it will appear in the document, but
obviously TeXStudio lacks LyX's convenience in editing the equation.
However, LyX's instant-preview feature (which by default is disabled for
math) requires interrupting editing the equation, moving the cursor
outside. Also, when the equation is too wide for the column, it will be cut
off in the preview rather than showing the full misformatted equation
(though this is actually positive for unnumbered equations).

So I was wondering if I am missing a feature. Is there some on-the-fly
preview of equations possible in LyX, while editing the equation? Currently
my best guess is document preview with Ctrl+R (pdflatex), but this is still
rather slow.

regards, Klaus


On-the-fly preview? (Beyond instant-preview)

2014-09-02 Thread Klaus-Dieter Bauer
Hello!

Publications in physics mostly use a two-column format and I am recently
trying to adopt this style for my private (equation-heavy) summaries as
well. However, I found that for my workflow in two-column documents fast
feedback about the layout of equations, especially their width with respect
to column width, is essential.

In TeXStudio there is the preview feature, which on the fly while editing
the equation provides a rendering, as it will appear in the document, but
obviously TeXStudio lacks LyX's convenience in editing the equation.
However, LyX's instant-preview feature (which by default is disabled for
math) requires interrupting editing the equation, moving the cursor
outside. Also, when the equation is too wide for the column, it will be cut
off in the preview rather than showing the full misformatted equation
(though this is actually positive for unnumbered equations).

So I was wondering if I am missing a feature. Is there some on-the-fly
preview of equations possible in LyX, while editing the equation? Currently
my best guess is document preview with Ctrl+R (pdflatex), but this is still
rather slow.

regards, Klaus


Re: Insets that don't mess up text flow.

2014-06-10 Thread Klaus-Dieter Bauer
Thanks for the tip!

While not what I intended, it indeed results in much less intrusive
multi-line footnotes, especially when combined with Richard Heck's local
layout.

- Klaus


2014-05-27 16:42 GMT+02:00 Liviu Andronic landronim...@gmail.com:

 On Tue, May 27, 2014 at 3:19 PM, Klaus-Dieter Bauer
 klaus-dieter.ba...@jku.at wrote:
  Hello!
 
  When creating a lengthy footnote and not folding it (Ctrl+I), it will
  invariably mess up the text-flow, causing the last line before the
 footnote
  to be stretched to paragraph width regardless of contents. I sometimes
 End
  up with situations like
 
 Maybe this can help:
 http://wiki.lyx.org/LyX.NewInLyX21#misc

 Users can now decide for every document in the menu
 Document→Settings→Text Layout if LyX justifies the document text or
 not. (This setting has no effect on the output.)

 Liviu


 
   : Sampletext Sampletext Sampletext Sampletext
   : Sampletext Sampletext Sampletext Sampletext
   : Sampletext Sampletext Sampletext Sampletext
   : Sample ~ H U G E E M P T Y S P A C E ~ Text
   : [foot1]
   : |Here is the footnote text that goes over
   : |several lines, just because.
   : +--
   : RestOfPar RestOfPar RestOfPar RestOfPar
   : RestOfPar RestOfPar RestOfPar RestOfPar
   : RestOfPar RestOfPar.
 
  Yet the footnote may contain information that, while not important
 enough to
  clutter the output text, may be important enough for me not to fold the
  footnote away.
 
  Would it be possible to get with custom formats either
 
  1. Footnotes that look like normal text, except for a different
 formatting,
  i.e.
 
   : Sampletext Sampletext Sampletext Sampletext
   : Sampletext Sampletext [foot1][Foot Foot Foot
   : Foot Foot Foot Foot Foot Foot Foot Foot] Rest
   : OfPar RestOfPar RestOfPar.
 
  2. Footnotes to show the beginning of the text, like ERT does, i.e.
 
   : Sampletext Sampletext Sampletext Sampletext Sampletext
   : Sampletext Sampletext [foot1][This is the footn...]
   : RestOfPar RestOfPar RestOfPar.
 
 
  - Klaus
 



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



Re: Insets that don't mess up text flow.

2014-06-10 Thread Klaus-Dieter Bauer
Thanks for the tip!

While not what I intended, it indeed results in much less intrusive
multi-line footnotes, especially when combined with Richard Heck's local
layout.

- Klaus


2014-05-27 16:42 GMT+02:00 Liviu Andronic landronim...@gmail.com:

 On Tue, May 27, 2014 at 3:19 PM, Klaus-Dieter Bauer
 klaus-dieter.ba...@jku.at wrote:
  Hello!
 
  When creating a lengthy footnote and not folding it (Ctrl+I), it will
  invariably mess up the text-flow, causing the last line before the
 footnote
  to be stretched to paragraph width regardless of contents. I sometimes
 End
  up with situations like
 
 Maybe this can help:
 http://wiki.lyx.org/LyX.NewInLyX21#misc

 Users can now decide for every document in the menu
 Document→Settings→Text Layout if LyX justifies the document text or
 not. (This setting has no effect on the output.)

 Liviu


 
   : Sampletext Sampletext Sampletext Sampletext
   : Sampletext Sampletext Sampletext Sampletext
   : Sampletext Sampletext Sampletext Sampletext
   : Sample ~ H U G E E M P T Y S P A C E ~ Text
   : [foot1]
   : |Here is the footnote text that goes over
   : |several lines, just because.
   : +--
   : RestOfPar RestOfPar RestOfPar RestOfPar
   : RestOfPar RestOfPar RestOfPar RestOfPar
   : RestOfPar RestOfPar.
 
  Yet the footnote may contain information that, while not important
 enough to
  clutter the output text, may be important enough for me not to fold the
  footnote away.
 
  Would it be possible to get with custom formats either
 
  1. Footnotes that look like normal text, except for a different
 formatting,
  i.e.
 
   : Sampletext Sampletext Sampletext Sampletext
   : Sampletext Sampletext [foot1][Foot Foot Foot
   : Foot Foot Foot Foot Foot Foot Foot Foot] Rest
   : OfPar RestOfPar RestOfPar.
 
  2. Footnotes to show the beginning of the text, like ERT does, i.e.
 
   : Sampletext Sampletext Sampletext Sampletext Sampletext
   : Sampletext Sampletext [foot1][This is the footn...]
   : RestOfPar RestOfPar RestOfPar.
 
 
  - Klaus
 



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



Re: Insets that don't mess up text flow.

2014-06-10 Thread Klaus-Dieter Bauer
Thanks for the tip!

While not what I intended, it indeed results in much less intrusive
multi-line footnotes, especially when combined with Richard Heck's local
layout.

- Klaus


2014-05-27 16:42 GMT+02:00 Liviu Andronic <landronim...@gmail.com>:

> On Tue, May 27, 2014 at 3:19 PM, Klaus-Dieter Bauer
> <klaus-dieter.ba...@jku.at> wrote:
> > Hello!
> >
> > When creating a lengthy footnote and not folding it (Ctrl+I), it will
> > invariably mess up the text-flow, causing the last line before the
> footnote
> > to be stretched to paragraph width regardless of contents. I sometimes
> End
> > up with situations like
> >
> Maybe this can help:
> http://wiki.lyx.org/LyX.NewInLyX21#misc
>
> "Users can now decide for every document in the menu
> Document→Settings→Text Layout if LyX justifies the document text or
> not. (This setting has no effect on the output.)"
>
> Liviu
>
>
> >
> >  : Sampletext Sampletext Sampletext Sampletext
> >  : Sampletext Sampletext Sampletext Sampletext
> >  : Sampletext Sampletext Sampletext Sampletext
> >  : Sample ~ H U G E E M P T Y S P A C E ~ Text
> >  : [foot1]
> >  : |Here is the footnote text that goes over
> >  : |several lines, just because.
> >  : +--
> >  : RestOfPar RestOfPar RestOfPar RestOfPar
> >  : RestOfPar RestOfPar RestOfPar RestOfPar
> >  : RestOfPar RestOfPar.
> >
> > Yet the footnote may contain information that, while not important
> enough to
> > clutter the output text, may be important enough for me not to fold the
> > footnote away.
> >
> > Would it be possible to get with custom formats either
> >
> > 1. Footnotes that look like normal text, except for a different
> formatting,
> > i.e.
> >
> >  : Sampletext Sampletext Sampletext Sampletext
> >  : Sampletext Sampletext [foot1][Foot Foot Foot
> >  : Foot Foot Foot Foot Foot Foot Foot Foot] Rest
> >  : OfPar RestOfPar RestOfPar.
> >
> > 2. Footnotes to show the beginning of the text, like ERT does, i.e.
> >
> >  : Sampletext Sampletext Sampletext Sampletext Sampletext
> >  : Sampletext Sampletext [foot1][This is the footn...]
> >  : RestOfPar RestOfPar RestOfPar.
> >
> >
> > - Klaus
> >
>
>
>
> --
> Do you know how to read?
> http://www.alienetworks.com/srtest.cfm
> http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
> Do you know how to write?
> http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail
>


Insets that don't mess up text flow.

2014-05-27 Thread Klaus-Dieter Bauer
Hello!

When creating a lengthy footnote and not folding it (Ctrl+I), it will
invariably mess up the text-flow, causing the last line before the footnote
to be stretched to paragraph width regardless of contents. I sometimes End
up with situations like

 : Sampletext Sampletext Sampletext Sampletext
 : Sampletext Sampletext Sampletext Sampletext
 : Sampletext Sampletext Sampletext Sampletext
 : Sample ~ H U G E E M P T Y S P A C E ~ Text
 : [foot1]
 : |Here is the footnote text that goes over
 : |several lines, just because.
 : +--
 : RestOfPar RestOfPar RestOfPar RestOfPar
 : RestOfPar RestOfPar RestOfPar RestOfPar
 : RestOfPar RestOfPar.

Yet the footnote may contain information that, while not important enough
to clutter the output text, may be important enough for me not to fold the
footnote away.

Would it be possible to get with custom formats either

1. Footnotes that look like normal text, except for a different formatting,
i.e.

 : Sampletext Sampletext Sampletext Sampletext
 : Sampletext Sampletext [foot1][Foot Foot Foot
 : Foot Foot Foot Foot Foot Foot Foot Foot] Rest
 : OfPar RestOfPar RestOfPar.

2. Footnotes to show the beginning of the text, like ERT does, i.e.

 : Sampletext Sampletext Sampletext Sampletext Sampletext
 : Sampletext Sampletext [foot1][This is the footn...]
 : RestOfPar RestOfPar RestOfPar.


- Klaus


Insets that don't mess up text flow.

2014-05-27 Thread Klaus-Dieter Bauer
Hello!

When creating a lengthy footnote and not folding it (Ctrl+I), it will
invariably mess up the text-flow, causing the last line before the footnote
to be stretched to paragraph width regardless of contents. I sometimes End
up with situations like

 : Sampletext Sampletext Sampletext Sampletext
 : Sampletext Sampletext Sampletext Sampletext
 : Sampletext Sampletext Sampletext Sampletext
 : Sample ~ H U G E E M P T Y S P A C E ~ Text
 : [foot1]
 : |Here is the footnote text that goes over
 : |several lines, just because.
 : +--
 : RestOfPar RestOfPar RestOfPar RestOfPar
 : RestOfPar RestOfPar RestOfPar RestOfPar
 : RestOfPar RestOfPar.

Yet the footnote may contain information that, while not important enough
to clutter the output text, may be important enough for me not to fold the
footnote away.

Would it be possible to get with custom formats either

1. Footnotes that look like normal text, except for a different formatting,
i.e.

 : Sampletext Sampletext Sampletext Sampletext
 : Sampletext Sampletext [foot1][Foot Foot Foot
 : Foot Foot Foot Foot Foot Foot Foot Foot] Rest
 : OfPar RestOfPar RestOfPar.

2. Footnotes to show the beginning of the text, like ERT does, i.e.

 : Sampletext Sampletext Sampletext Sampletext Sampletext
 : Sampletext Sampletext [foot1][This is the footn...]
 : RestOfPar RestOfPar RestOfPar.


- Klaus


Insets that don't mess up text flow.

2014-05-27 Thread Klaus-Dieter Bauer
Hello!

When creating a lengthy footnote and not folding it (Ctrl+I), it will
invariably mess up the text-flow, causing the last line before the footnote
to be stretched to paragraph width regardless of contents. I sometimes End
up with situations like

 : Sampletext Sampletext Sampletext Sampletext
 : Sampletext Sampletext Sampletext Sampletext
 : Sampletext Sampletext Sampletext Sampletext
 : Sample ~ H U G E E M P T Y S P A C E ~ Text
 : [foot1]
 : |Here is the footnote text that goes over
 : |several lines, just because.
 : +--
 : RestOfPar RestOfPar RestOfPar RestOfPar
 : RestOfPar RestOfPar RestOfPar RestOfPar
 : RestOfPar RestOfPar.

Yet the footnote may contain information that, while not important enough
to clutter the output text, may be important enough for me not to fold the
footnote away.

Would it be possible to get with custom formats either

1. Footnotes that look like normal text, except for a different formatting,
i.e.

 : Sampletext Sampletext Sampletext Sampletext
 : Sampletext Sampletext [foot1][Foot Foot Foot
 : Foot Foot Foot Foot Foot Foot Foot Foot] Rest
 : OfPar RestOfPar RestOfPar.

2. Footnotes to show the beginning of the text, like ERT does, i.e.

 : Sampletext Sampletext Sampletext Sampletext Sampletext
 : Sampletext Sampletext [foot1][This is the footn...]
 : RestOfPar RestOfPar RestOfPar.


- Klaus


Re: Lyx on Windows: ps2eps missing?

2012-05-10 Thread Klaus-Dieter Bauer
2012/5/10 Vincent van Ravesteijn v...@lyx.org:
 Op 7-5-2012 15:29, Klaus-Dieter Bauer schreef:

 Hello!

 I stumbled into problems previewing PDF graphics inside LyX. It would
 give me the error Unable to Convert to Loadable Format.

 You didn't mention which version of LyX you have installed. There was a bug
 in the version of ImageMagick that was included in the LyX installer. This
 bug prevented pdf images to be previewed. The latest LyX installer has a
 newer version of ImageMagick that fixes this.
 [...]
 Vincent

Ah sorry, that LyX Version number was lost during editing the email.

LyX was installed using the installer LyX-2.0.3-1-Installer.exe,
which should be the latest one.

Anyway, the problem did not seem Image-Magick related to me. Switching
to using convert.exe for PDF-PNG conversion fixed the problem after
all. It was the default converter, that did not work -- and that uses
ps2eps in an intermediate step, which should be related to the LaTeX
distribution rather than Image Magick. Your answer seems to indicate,
that LyX is meant to use Image Magick for PDF previewing by default
though.

Deleting my local LyX settings and running reconfigure didn't solve
the problem, so it SHOULD not be a problem with my local settings.

Just to be sure, I found a work-around, as said before. So my interest
in that behaviour is more or less academic right now. :-)

kind regards, Klaus-Dieter


Re: Lyx on Windows: ps2eps missing?

2012-05-10 Thread Klaus-Dieter Bauer
2012/5/10 Vincent van Ravesteijn v...@lyx.org:
 Op 7-5-2012 15:29, Klaus-Dieter Bauer schreef:

 Hello!

 I stumbled into problems previewing PDF graphics inside LyX. It would
 give me the error Unable to Convert to Loadable Format.

 You didn't mention which version of LyX you have installed. There was a bug
 in the version of ImageMagick that was included in the LyX installer. This
 bug prevented pdf images to be previewed. The latest LyX installer has a
 newer version of ImageMagick that fixes this.
 [...]
 Vincent

Ah sorry, that LyX Version number was lost during editing the email.

LyX was installed using the installer LyX-2.0.3-1-Installer.exe,
which should be the latest one.

Anyway, the problem did not seem Image-Magick related to me. Switching
to using convert.exe for PDF-PNG conversion fixed the problem after
all. It was the default converter, that did not work -- and that uses
ps2eps in an intermediate step, which should be related to the LaTeX
distribution rather than Image Magick. Your answer seems to indicate,
that LyX is meant to use Image Magick for PDF previewing by default
though.

Deleting my local LyX settings and running reconfigure didn't solve
the problem, so it SHOULD not be a problem with my local settings.

Just to be sure, I found a work-around, as said before. So my interest
in that behaviour is more or less academic right now. :-)

kind regards, Klaus-Dieter


Re: Lyx on Windows: ps2eps missing?

2012-05-10 Thread Klaus-Dieter Bauer
2012/5/10 Vincent van Ravesteijn <v...@lyx.org>:
> Op 7-5-2012 15:29, Klaus-Dieter Bauer schreef:
>
>> Hello!
>>
>> I stumbled into problems previewing PDF graphics inside LyX. It would
>> give me the error "Unable to Convert to Loadable Format".
>
> You didn't mention which version of LyX you have installed. There was a bug
> in the version of ImageMagick that was included in the LyX installer. This
> bug prevented pdf images to be previewed. The latest LyX installer has a
> newer version of ImageMagick that fixes this.
> [...]
> Vincent

Ah sorry, that LyX Version number was lost during editing the email.

LyX was installed using the installer "LyX-2.0.3-1-Installer.exe",
which should be the latest one.

Anyway, the problem did not seem Image-Magick related to me. Switching
to using "convert.exe" for PDF->PNG conversion fixed the problem after
all. It was the default converter, that did not work -- and that uses
ps2eps in an intermediate step, which should be related to the LaTeX
distribution rather than Image Magick. Your answer seems to indicate,
that LyX is meant to use Image Magick for PDF previewing by default
though.

Deleting my local LyX settings and running "reconfigure" didn't solve
the problem, so it SHOULD not be a problem with my local settings.

Just to be sure, I found a work-around, as said before. So my interest
in that behaviour is more or less academic right now. :-)

kind regards, Klaus-Dieter


Lyx on Windows: ps2eps missing?

2012-05-07 Thread Klaus-Dieter Bauer
Hello!

I stumbled into problems previewing PDF graphics inside LyX. It would
give me the error Unable to Convert to Loadable Format. That got me
some hits on Google, but the hits typically were from 2003, the issue
being about EPS files.

I investigated the message log, with only Graphics conversion and
loading enabled (full file see attachment). I found that the
conversion takes a very roundabout way, converting the PDF to PS, than
the PS to EPS and then EPS to PNG.

On examining the temporary directory, I found several PS files (and
some subdirectories unrelated to the image conversion), but no EPS or
PNG files. And indeed I found out that my system doesn't have a
ps2eps script on any of the PATH prefix folders. It has ps2epsi
though in MiKTeX!

My solution was to add a custom converter for PDF  PNG, simply using
LyX's own Image Magick convert.exe:
   convert -density 96 pdf:$$i png:$$o

However, I'm now wondering...
1. Did I just overlook posts describing a solution?
2. Why does the default converter go such a roundabout way, when most
file formats work well with convert.exe directly?
3. Would ps2eps be included if I had chosen the combined LyX/MiKTeX
installer? CTAN says, that it is not part of MiKTeX (
http://www.ctan.org/pkg/ps2eps ).
3a. If yes, is there anywhere any indication that the combined
installer should be preferred?

kind regards, Klaus-Dieter


Platform Information:
- Windows 7
- MiKTeX 2.9, installed separately. Should be the newest version, so
not having ps2eps is surprising to me.
- Cygwin installed, but only /bin on the windows PATH.
13:54:40.281: 
(graphics-reload)C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(408):
Converting it to  format.
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\support\FileName.cpp(945):
 Recognised Fileformat: pdf
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(378):
 [CacheItem::Impl::convertToDisplayFormat]
Attempting to convert image file: 
E:/studium/diplomarbeit/labbook/3.Lyx/images/fe-100-s5-100gb-supercellsize-convergence.pdf
with displayed filename: 
E:\studium\diplomarbeit\labbook\3.Lyx\images\fe-100-s5-100gb-supercellsize-convergence.pdf
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\support\FileName.cpp(945):
 Recognised Fileformat: pdf
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(385):
 
The file contains pdf format data.
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(340):
 Unable to convert from pdf to bmp
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(340):
 Unable to convert from pdf to pbm
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(340):
 Unable to convert from pdf to pgm
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsConverter.cpp(127):
 Converter c-tor:
from_file:  
E:/studium/diplomarbeit/labbook/3.Lyx/images/fe-100-s5-100gb-supercellsize-convergence.pdf
to_file_base: 
C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/CacheItem.PJ3672
from_format:  pdf
to_format:png
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsConverter.cpp(264):
 build_script ... 
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsConverter.cpp(376):
 ready!
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsConverter.cpp(142):
   Conversion script:
--
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, shutil, sys

def unlinkNoThrow(file):
  ''' remove a file, do not throw if an error occurs '''
  try:
os.unlink(file)
  except:
pass

infile = 
E:/studium/diplomarbeit/labbook/3.Lyx/images/fe-100-s5-100gb-supercellsize-convergence.pdf
outfile = 
C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672.pdf
shutil.copy(infile, outfile)
os.chdir(C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/)
infile = 
C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672.pdf
infile_base = 
C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672
outfile = 
C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672.ps
outdir  = os.path.dirname(outfile)

if os.system(r'pdf2ps ' + '' + infile + '' + ' ' + '' + outfile + '' + '') 
!= 0:
  unlinkNoThrow(outfile)
  sys.exit(1)

if not os.path.isfile(outfile):
  if os.path.isfile(outfile + '.0'):
os.rename(outfile + '.0', outfile)
import glob
for file in glob.glob(outfile + '.?'):
  unlinkNoThrow(file)
  else:
sys.exit(1)

unlinkNoThrow(infile)

infile = 
C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672.ps
infile_base = 
C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672
outfile = 

Lyx on Windows: ps2eps missing?

2012-05-07 Thread Klaus-Dieter Bauer
Hello!

I stumbled into problems previewing PDF graphics inside LyX. It would
give me the error Unable to Convert to Loadable Format. That got me
some hits on Google, but the hits typically were from 2003, the issue
being about EPS files.

I investigated the message log, with only Graphics conversion and
loading enabled (full file see attachment). I found that the
conversion takes a very roundabout way, converting the PDF to PS, than
the PS to EPS and then EPS to PNG.

On examining the temporary directory, I found several PS files (and
some subdirectories unrelated to the image conversion), but no EPS or
PNG files. And indeed I found out that my system doesn't have a
ps2eps script on any of the PATH prefix folders. It has ps2epsi
though in MiKTeX!

My solution was to add a custom converter for PDF  PNG, simply using
LyX's own Image Magick convert.exe:
   convert -density 96 pdf:$$i png:$$o

However, I'm now wondering...
1. Did I just overlook posts describing a solution?
2. Why does the default converter go such a roundabout way, when most
file formats work well with convert.exe directly?
3. Would ps2eps be included if I had chosen the combined LyX/MiKTeX
installer? CTAN says, that it is not part of MiKTeX (
http://www.ctan.org/pkg/ps2eps ).
3a. If yes, is there anywhere any indication that the combined
installer should be preferred?

kind regards, Klaus-Dieter


Platform Information:
- Windows 7
- MiKTeX 2.9, installed separately. Should be the newest version, so
not having ps2eps is surprising to me.
- Cygwin installed, but only /bin on the windows PATH.
13:54:40.281: 
(graphics-reload)C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(408):
Converting it to  format.
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\support\FileName.cpp(945):
 Recognised Fileformat: pdf
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(378):
 [CacheItem::Impl::convertToDisplayFormat]
Attempting to convert image file: 
E:/studium/diplomarbeit/labbook/3.Lyx/images/fe-100-s5-100gb-supercellsize-convergence.pdf
with displayed filename: 
E:\studium\diplomarbeit\labbook\3.Lyx\images\fe-100-s5-100gb-supercellsize-convergence.pdf
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\support\FileName.cpp(945):
 Recognised Fileformat: pdf
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(385):
 
The file contains pdf format data.
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(340):
 Unable to convert from pdf to bmp
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(340):
 Unable to convert from pdf to pbm
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(340):
 Unable to convert from pdf to pgm
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsConverter.cpp(127):
 Converter c-tor:
from_file:  
E:/studium/diplomarbeit/labbook/3.Lyx/images/fe-100-s5-100gb-supercellsize-convergence.pdf
to_file_base: 
C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/CacheItem.PJ3672
from_format:  pdf
to_format:png
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsConverter.cpp(264):
 build_script ... 
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsConverter.cpp(376):
 ready!
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsConverter.cpp(142):
   Conversion script:
--
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, shutil, sys

def unlinkNoThrow(file):
  ''' remove a file, do not throw if an error occurs '''
  try:
os.unlink(file)
  except:
pass

infile = 
E:/studium/diplomarbeit/labbook/3.Lyx/images/fe-100-s5-100gb-supercellsize-convergence.pdf
outfile = 
C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672.pdf
shutil.copy(infile, outfile)
os.chdir(C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/)
infile = 
C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672.pdf
infile_base = 
C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672
outfile = 
C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672.ps
outdir  = os.path.dirname(outfile)

if os.system(r'pdf2ps ' + '' + infile + '' + ' ' + '' + outfile + '' + '') 
!= 0:
  unlinkNoThrow(outfile)
  sys.exit(1)

if not os.path.isfile(outfile):
  if os.path.isfile(outfile + '.0'):
os.rename(outfile + '.0', outfile)
import glob
for file in glob.glob(outfile + '.?'):
  unlinkNoThrow(file)
  else:
sys.exit(1)

unlinkNoThrow(infile)

infile = 
C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672.ps
infile_base = 
C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672
outfile = 

Lyx on Windows: ps2eps missing?

2012-05-07 Thread Klaus-Dieter Bauer
Hello!

I stumbled into problems previewing PDF graphics inside LyX. It would
give me the error "Unable to Convert to Loadable Format". That got me
some hits on Google, but the hits typically were from 2003, the issue
being about EPS files.

I investigated the message log, with only "Graphics conversion and
loading" enabled (full file see attachment). I found that the
conversion takes a very roundabout way, converting the PDF to PS, than
the PS to EPS and then EPS to PNG.

On examining the temporary directory, I found several PS files (and
some subdirectories unrelated to the image conversion), but no EPS or
PNG files. And indeed I found out that my system doesn't have a
"ps2eps" script on any of the "PATH prefix" folders. It has "ps2epsi"
though in MiKTeX!

My solution was to add a custom converter for PDF > PNG, simply using
LyX's own Image Magick "convert.exe":
   convert -density 96 pdf:$$i png:$$o

However, I'm now wondering...
1. Did I just overlook posts describing a solution?
2. Why does the default converter go such a roundabout way, when most
file formats work well with convert.exe directly?
3. Would ps2eps be included if I had chosen the combined LyX/MiKTeX
installer? CTAN says, that it is not part of MiKTeX (
http://www.ctan.org/pkg/ps2eps ).
3a. If yes, is there anywhere any indication that the combined
installer should be preferred?

kind regards, Klaus-Dieter


Platform Information:
- Windows 7
- MiKTeX 2.9, installed separately. Should be the newest version, so
not having ps2eps is surprising to me.
- Cygwin installed, but only "/bin" on the windows PATH.
13:54:40.281: 
(graphics-reload)C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(408):
Converting it to  format.
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\support\FileName.cpp(945):
 Recognised Fileformat: pdf
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(378):
 [CacheItem::Impl::convertToDisplayFormat]
Attempting to convert image file: 
E:/studium/diplomarbeit/labbook/3.Lyx/images/fe-100-s5-100gb-supercellsize-convergence.pdf
with displayed filename: 
E:\studium\diplomarbeit\labbook\3.Lyx\images\fe-100-s5-100gb-supercellsize-convergence.pdf
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\support\FileName.cpp(945):
 Recognised Fileformat: pdf
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(385):
 
The file contains pdf format data.
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(340):
 Unable to convert from pdf to bmp
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(340):
 Unable to convert from pdf to pbm
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsCacheItem.cpp(340):
 Unable to convert from pdf to pgm
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsConverter.cpp(127):
 Converter c-tor:
from_file:  
E:/studium/diplomarbeit/labbook/3.Lyx/images/fe-100-s5-100gb-supercellsize-convergence.pdf
to_file_base: 
C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/CacheItem.PJ3672
from_format:  pdf
to_format:png
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsConverter.cpp(264):
 build_script ... 
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsConverter.cpp(376):
 ready!
C:\Users\Vincent\Documents\LyX\source\lyx-svn-branch\src\graphics\GraphicsConverter.cpp(142):
   Conversion script:
--
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, shutil, sys

def unlinkNoThrow(file):
  ''' remove a file, do not throw if an error occurs '''
  try:
os.unlink(file)
  except:
pass

infile = 
"E:/studium/diplomarbeit/labbook/3.Lyx/images/fe-100-s5-100gb-supercellsize-convergence.pdf"
outfile = 
"C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672.pdf"
shutil.copy(infile, outfile)
os.chdir("C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/")
infile = 
"C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672.pdf"
infile_base = 
"C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672"
outfile = 
"C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672.ps"
outdir  = os.path.dirname(outfile)

if os.system(r'pdf2ps ' + '"' + infile + '"' + ' ' + '"' + outfile + '"' + '') 
!= 0:
  unlinkNoThrow(outfile)
  sys.exit(1)

if not os.path.isfile(outfile):
  if os.path.isfile(outfile + '.0'):
os.rename(outfile + '.0', outfile)
import glob
for file in glob.glob(outfile + '.?'):
  unlinkNoThrow(file)
  else:
sys.exit(1)

unlinkNoThrow(infile)

infile = 
"C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672.ps"
infile_base = 
"C:/Users/klaus/AppData/Local/Temp/lyx_tmpdir.Hp3672/gconvert6.ER3672"
outfile =