Re: Auto-reload pdf files on Mac?

2011-05-03 Thread Daniel Lohmann

On 31.01.2011, at 18:17, Murat Yildizoglu wrote:

 I confirm that Skim is able to autoload the pdf and keep the actual view of 
 the file. You have just tell it, the first time you update the PDF, that you 
 want it to auto-load it (I have not found a way to tell it to auto-load 
 without asking this question).

That's easy, there is a hidden preference for this:
   
http://sourceforge.net/apps/mediawiki/skim-app/index.php?title=Hidden_Preferences#Auto_Reload

Basically, all you have to do to get rid of this question is to open a Terminal 
window and enter:
   defaults write -app Skim SKAutoReloadFileUpdate -boolean true

Daniel





smime.p7s
Description: S/MIME cryptographic signature


Re: Auto-reload pdf files on Mac?

2011-05-03 Thread Daniel Lohmann

On 31.01.2011, at 18:17, Murat Yildizoglu wrote:

 I confirm that Skim is able to autoload the pdf and keep the actual view of 
 the file. You have just tell it, the first time you update the PDF, that you 
 want it to auto-load it (I have not found a way to tell it to auto-load 
 without asking this question).

That's easy, there is a hidden preference for this:
   
http://sourceforge.net/apps/mediawiki/skim-app/index.php?title=Hidden_Preferences#Auto_Reload

Basically, all you have to do to get rid of this question is to open a Terminal 
window and enter:
   defaults write -app Skim SKAutoReloadFileUpdate -boolean true

Daniel





smime.p7s
Description: S/MIME cryptographic signature


Re: Auto-reload pdf files on Mac?

2011-05-03 Thread Daniel Lohmann

On 31.01.2011, at 18:17, Murat Yildizoglu wrote:

> I confirm that Skim is able to autoload the pdf and keep the actual view of 
> the file. You have just tell it, the first time you update the PDF, that you 
> want it to auto-load it (I have not found a way to tell it to auto-load 
> without asking this question).

That's easy, there is a "hidden preference" for this:
   
http://sourceforge.net/apps/mediawiki/skim-app/index.php?title=Hidden_Preferences#Auto_Reload

Basically, all you have to do to get rid of this question is to open a Terminal 
window and enter:
   defaults write -app Skim SKAutoReloadFileUpdate -boolean true

Daniel





smime.p7s
Description: S/MIME cryptographic signature


Re: Old Beamer Class Presentation Lost Navigation Links

2010-06-22 Thread Daniel Lohmann

On 22.06.2010, at 23:00, Paul Rubin wrote:

 Rich Shepard rshepard at appl-ecosys.com writes:
 
 
   Both source .tex and .log are attached.
 
   While the newest hyperref package does not include all the files of the
 earlier versions and throws a warning, the error that halts compilation of
 the file is \makebeamertitle.
 
 That's where it halts, but not the problem.  The problem seems to be
 \thispdfpagelabel is an undefined control sequence.  It's supposed to be 
 defined
 in hyperref (I think).

Not by newer versions of hyperref, see

http://bitbucket.org/rivanvx/beamer/issue/8/beamer-should-generate-pdf-page-labels-using

Daniel

 You mentioned something about hyperref not having a .sty or .cfg file?? 
 Have you tried reinstalling/upgrading hyperref?
 
   After seeing complaints in an earlier log file about hyperref I downloaded
 and installed the latest version from CTAN. There are no .sty or .cfg files
 for hyperref in the latest release.
 
 Well, your log indicates it seems to be loading hyperref (and, in particular,
 /usr/share/texmf/tex/latex/hyperref/hyperref.sty), version 6.74m, from 2003. 
 The config file (also found) has a 2002 version date.  That's not the latest
 version, so maybe you're not using what you installed -- or, worse yet, you've
 got a hybrid of old and new versions??
 
 Your log shows hyperref loading a little earlier than mine does, but what 
 loads
 before it in mine and after it in yours looks pretty harmless to me.  The one
 other major discrepancy between our logs is that yours indicates some ConTeXT
 macros are loading where mine does not:
 
 (/usr/share/texmf/tex/context/base/supp-pdf.tex
 (/usr/share/texmf/tex/context/base/supp-mis.tex
 loading : Context Support Macros / Miscellaneous (2004.10.26)
 
 Dunno if that would muck things up.  I think I'd try straightening out the
 questions about hyperref first.  The latest release comes as .ins and .dtx
 files, although there's supposed to be a .zip version somewhere or other.  If
 you grabbed the .dtx and .ins files, did you run 'tex hyperref.ins' to 
 generate
 the .sty file(s), and then distribute stuff around your TDS tree?  (And did 
 you
 texhash it?)
 
 Nag, nag, nag ...  :-)
 
 /Paul
 



Re: Old Beamer Class Presentation Lost Navigation Links

2010-06-22 Thread Daniel Lohmann

On 22.06.2010, at 23:00, Paul Rubin wrote:

 Rich Shepard rshepard at appl-ecosys.com writes:
 
 
   Both source .tex and .log are attached.
 
   While the newest hyperref package does not include all the files of the
 earlier versions and throws a warning, the error that halts compilation of
 the file is \makebeamertitle.
 
 That's where it halts, but not the problem.  The problem seems to be
 \thispdfpagelabel is an undefined control sequence.  It's supposed to be 
 defined
 in hyperref (I think).

Not by newer versions of hyperref, see

http://bitbucket.org/rivanvx/beamer/issue/8/beamer-should-generate-pdf-page-labels-using

Daniel

 You mentioned something about hyperref not having a .sty or .cfg file?? 
 Have you tried reinstalling/upgrading hyperref?
 
   After seeing complaints in an earlier log file about hyperref I downloaded
 and installed the latest version from CTAN. There are no .sty or .cfg files
 for hyperref in the latest release.
 
 Well, your log indicates it seems to be loading hyperref (and, in particular,
 /usr/share/texmf/tex/latex/hyperref/hyperref.sty), version 6.74m, from 2003. 
 The config file (also found) has a 2002 version date.  That's not the latest
 version, so maybe you're not using what you installed -- or, worse yet, you've
 got a hybrid of old and new versions??
 
 Your log shows hyperref loading a little earlier than mine does, but what 
 loads
 before it in mine and after it in yours looks pretty harmless to me.  The one
 other major discrepancy between our logs is that yours indicates some ConTeXT
 macros are loading where mine does not:
 
 (/usr/share/texmf/tex/context/base/supp-pdf.tex
 (/usr/share/texmf/tex/context/base/supp-mis.tex
 loading : Context Support Macros / Miscellaneous (2004.10.26)
 
 Dunno if that would muck things up.  I think I'd try straightening out the
 questions about hyperref first.  The latest release comes as .ins and .dtx
 files, although there's supposed to be a .zip version somewhere or other.  If
 you grabbed the .dtx and .ins files, did you run 'tex hyperref.ins' to 
 generate
 the .sty file(s), and then distribute stuff around your TDS tree?  (And did 
 you
 texhash it?)
 
 Nag, nag, nag ...  :-)
 
 /Paul
 



Re: Old Beamer Class Presentation Lost Navigation Links

2010-06-22 Thread Daniel Lohmann

On 22.06.2010, at 23:00, Paul Rubin wrote:

> Rich Shepard  appl-ecosys.com> writes:
> 
>> 
>>   Both source .tex and .log are attached.
>> 
>>   While the newest hyperref package does not include all the files of the
>> earlier versions and throws a warning, the error that halts compilation of
>> the file is \makebeamertitle.
> 
> That's where it halts, but not the problem.  The problem seems to be
> \thispdfpagelabel is an undefined control sequence.  It's supposed to be 
> defined
> in hyperref (I think).

Not by newer versions of hyperref, see

http://bitbucket.org/rivanvx/beamer/issue/8/beamer-should-generate-pdf-page-labels-using

Daniel

>>> You mentioned something about hyperref not having a .sty or .cfg file?? 
>>> Have you tried reinstalling/upgrading hyperref?
>> 
>>   After seeing complaints in an earlier log file about hyperref I downloaded
>> and installed the latest version from CTAN. There are no .sty or .cfg files
>> for hyperref in the latest release.
> 
> Well, your log indicates it seems to be loading hyperref (and, in particular,
> /usr/share/texmf/tex/latex/hyperref/hyperref.sty), version 6.74m, from 2003. 
> The config file (also found) has a 2002 version date.  That's not the latest
> version, so maybe you're not using what you installed -- or, worse yet, you've
> got a hybrid of old and new versions??
> 
> Your log shows hyperref loading a little earlier than mine does, but what 
> loads
> before it in mine and after it in yours looks pretty harmless to me.  The one
> other major discrepancy between our logs is that yours indicates some ConTeXT
> macros are loading where mine does not:
> 
> (/usr/share/texmf/tex/context/base/supp-pdf.tex
> (/usr/share/texmf/tex/context/base/supp-mis.tex
> loading : Context Support Macros / Miscellaneous (2004.10.26)
> 
> Dunno if that would muck things up.  I think I'd try straightening out the
> questions about hyperref first.  The latest release comes as .ins and .dtx
> files, although there's supposed to be a .zip version somewhere or other.  If
> you grabbed the .dtx and .ins files, did you run 'tex hyperref.ins' to 
> generate
> the .sty file(s), and then distribute stuff around your TDS tree?  (And did 
> you
> texhash it?)
> 
> Nag, nag, nag ...  :-)
> 
> /Paul
> 



Re: Reducing the number of pages in an article

2010-06-15 Thread Daniel Lohmann
If you compile with pdflatex to pdf, you might also consider loading the 
microtype package in your preamble:

\usepackage{microtype}

Not only this improves the typographical aesthetics of your document, I have 
also found it reducing the number of pages slightly (by about a quarter page 
per ten pages in a two-column style, that is by about 2-3%, which might be 
enough in your case.)

More evil hacks include:

- explicitly putting negative vskips (e.g., \vskip{-2ex}) to reduce the spacing 
between certain figure floats and the following text or between the figure and 
its caption.

- explicitly enlarging the one or other page by a single line 
(\enlargethispage{\baselineskip}) 


Daniel

Re: Negative indent in an enumerated list inside a theorem?

2010-06-15 Thread Daniel Lohmann

On 15.06.2010, at 15:19, Paul A. Rubin wrote:

 On 6/14/2010 7:35 PM, Paul Elliott wrote:
 
 How do I do in lyx, a negative indent on an enumerated list inside a Theorem?
 
 I have a math book where sometimes the theorems are written like this:
 
 --
 Theorem.
 If all cows are spherical and either:
  (1) the moon is made of green cheese,
   or (2) there are canals on Mars
 then pluto is a planet.
 --
 
 How do I copy this style in lyx, specificly the negative indent
 on the or.
 
 
 
 Crude hack attached.  Due to the way LaTeX spaces enumerations (the anchor 
 point is the start of the item text), you can easily wind up with or 
 violating the left margin, hence my use of a box with horizontal space 
 stuffed in front of it.

Alternative approach with \llap to typset the or to the left (subject to the 
danger of margin violation as mentioned by Paul).

Daniel



pluto.lyx
Description: Binary data


Re: Reducing the number of pages in an article

2010-06-15 Thread Daniel Lohmann
If you compile with pdflatex to pdf, you might also consider loading the 
microtype package in your preamble:

\usepackage{microtype}

Not only this improves the typographical aesthetics of your document, I have 
also found it reducing the number of pages slightly (by about a quarter page 
per ten pages in a two-column style, that is by about 2-3%, which might be 
enough in your case.)

More evil hacks include:

- explicitly putting negative vskips (e.g., \vskip{-2ex}) to reduce the spacing 
between certain figure floats and the following text or between the figure and 
its caption.

- explicitly enlarging the one or other page by a single line 
(\enlargethispage{\baselineskip}) 


Daniel

Re: Negative indent in an enumerated list inside a theorem?

2010-06-15 Thread Daniel Lohmann

On 15.06.2010, at 15:19, Paul A. Rubin wrote:

 On 6/14/2010 7:35 PM, Paul Elliott wrote:
 
 How do I do in lyx, a negative indent on an enumerated list inside a Theorem?
 
 I have a math book where sometimes the theorems are written like this:
 
 --
 Theorem.
 If all cows are spherical and either:
  (1) the moon is made of green cheese,
   or (2) there are canals on Mars
 then pluto is a planet.
 --
 
 How do I copy this style in lyx, specificly the negative indent
 on the or.
 
 
 
 Crude hack attached.  Due to the way LaTeX spaces enumerations (the anchor 
 point is the start of the item text), you can easily wind up with or 
 violating the left margin, hence my use of a box with horizontal space 
 stuffed in front of it.

Alternative approach with \llap to typset the or to the left (subject to the 
danger of margin violation as mentioned by Paul).

Daniel



pluto.lyx
Description: Binary data


Re: Reducing the number of pages in an article

2010-06-15 Thread Daniel Lohmann
If you compile with pdflatex to pdf, you might also consider loading the 
microtype package in your preamble:

\usepackage{microtype}

Not only this improves the typographical aesthetics of your document, I have 
also found it reducing the number of pages slightly (by about a quarter page 
per ten pages in a two-column style, that is by about 2-3%, which might be 
enough in your case.)

More "evil" hacks include:

- explicitly putting negative vskips (e.g., \vskip{-2ex}) to reduce the spacing 
between certain figure floats and the following text or between the figure and 
its caption.

- explicitly enlarging the one or other page by a single line 
(\enlargethispage{\baselineskip}) 


Daniel

Re: Negative indent in an enumerated list inside a theorem?

2010-06-15 Thread Daniel Lohmann

On 15.06.2010, at 15:19, Paul A. Rubin wrote:

> On 6/14/2010 7:35 PM, Paul Elliott wrote:
>> 
>> How do I do in lyx, a negative indent on an enumerated list inside a Theorem?
>> 
>> I have a math book where sometimes the theorems are written like this:
>> 
>> --
>> Theorem.
>> If all cows are spherical and either:
>>  (1) the moon is made of green cheese,
>>   or (2) there are canals on Mars
>> then pluto is a planet.
>> --
>> 
>> How do I copy this style in lyx, specificly the negative indent
>> on the "or".
>> 
>> 
> 
> Crude hack attached.  Due to the way LaTeX spaces enumerations (the anchor 
> point is the start of the item text), you can easily wind up with "or" 
> violating the left margin, hence my use of a box with horizontal space 
> stuffed in front of it.

Alternative approach with \llap to typset the "or" to the left (subject to the 
danger of margin violation as mentioned by Paul).

Daniel



pluto.lyx
Description: Binary data


Re: Custom Insets with multiple arguments

2010-06-11 Thread Daniel Lohmann

On 10.06.2010, at 11:02, stephen's mailinglist account wrote:

 On 06/02/2010 10:59 AM, Rob Oakes wrote:
 Dear LyX-Users,
 
 I am in the process of creating a custom of modules for personal use
 
 p  and another for the creation of epigraphs).  For the epigraph
 module to work correctly, it is important that I be able to use multiple
 input arguments.  For example, the LaTeX code for the epigraph command
 has the form \epigraph{Quotation}{Source}.
 
 \epigraph{If a picture isn't worth a thousand words, the hell with
 it.}{Ad Reinhardt}
 
 Is anyone aware of a way to create an inset that could support this type
 of macro?  I've looked through several of the examples shipped with LyX
 and wasn't able to find a similar example.
 
 The dinbrief.layout uses the following workaround in a similar case::
 
 I have created a module for epigraph using the style of workaround
 suggested by DINbrief
 
 http://wiki.lyx.org/uploads/Modules/epigraph/epigraph.module
 
 it uses 3 terms (text, source and typeset) because I wanted to make
 the source italic.
 
 I would be interested in comments and feedback as to how to do this
 better/more elegantly

An alternative approach might be to exploit plain tex to delimit the arguments 
in a way that is opaque to LyX. Hence, from the viewpoint of LyX and LaTeX, we 
pass a single argument, which then is internally parsed to split it up to 
whatever you need. Minimal example (LaTeX):

\documentclass{minimal} 

\newcommand*{\epigraph}[1]{%
  \def\parsearg##1+##2+{\def\one{##1}\def\two{##2}\relax}
  \parsearg#1+
  \emph{\one} (\two)
}

\begin{document} 
 
  \epigraph{Das Leben ist des Lebens Ziel+unbekannt}

\end{document}

Note that \epigraph gets just one argument, which is then internally split into 
two. In the example I have used the plus symbol (+) as delimiter to split the 
arguments; the delimiter itself is not printed.  However, you might use 
whatever you want to delimit the arguments, even complex tokens:

\documentclass{minimal} 

\newcommand*{\epigraph}[1]{%
  \def\parsearg##1 QUOTE OF ##2\end{\def\one{##1}\def\two{##2}\relax}
  \parsearg#1\end
  \emph{\one} (\two)
}

\begin{document} 
 
  \epigraph{Das Leben ist des Lebens Ziel QUOTE OF unbekannt}

\end{document}

Some additional work is required if you want the second part to be optional, 
though this should be possible as well.

Daniel

Re: Custom Insets with multiple arguments

2010-06-11 Thread Daniel Lohmann

On 10.06.2010, at 11:02, stephen's mailinglist account wrote:

 On 06/02/2010 10:59 AM, Rob Oakes wrote:
 Dear LyX-Users,
 
 I am in the process of creating a custom of modules for personal use
 
 p  and another for the creation of epigraphs).  For the epigraph
 module to work correctly, it is important that I be able to use multiple
 input arguments.  For example, the LaTeX code for the epigraph command
 has the form \epigraph{Quotation}{Source}.
 
 \epigraph{If a picture isn't worth a thousand words, the hell with
 it.}{Ad Reinhardt}
 
 Is anyone aware of a way to create an inset that could support this type
 of macro?  I've looked through several of the examples shipped with LyX
 and wasn't able to find a similar example.
 
 The dinbrief.layout uses the following workaround in a similar case::
 
 I have created a module for epigraph using the style of workaround
 suggested by DINbrief
 
 http://wiki.lyx.org/uploads/Modules/epigraph/epigraph.module
 
 it uses 3 terms (text, source and typeset) because I wanted to make
 the source italic.
 
 I would be interested in comments and feedback as to how to do this
 better/more elegantly

An alternative approach might be to exploit plain tex to delimit the arguments 
in a way that is opaque to LyX. Hence, from the viewpoint of LyX and LaTeX, we 
pass a single argument, which then is internally parsed to split it up to 
whatever you need. Minimal example (LaTeX):

\documentclass{minimal} 

\newcommand*{\epigraph}[1]{%
  \def\parsearg##1+##2+{\def\one{##1}\def\two{##2}\relax}
  \parsearg#1+
  \emph{\one} (\two)
}

\begin{document} 
 
  \epigraph{Das Leben ist des Lebens Ziel+unbekannt}

\end{document}

Note that \epigraph gets just one argument, which is then internally split into 
two. In the example I have used the plus symbol (+) as delimiter to split the 
arguments; the delimiter itself is not printed.  However, you might use 
whatever you want to delimit the arguments, even complex tokens:

\documentclass{minimal} 

\newcommand*{\epigraph}[1]{%
  \def\parsearg##1 QUOTE OF ##2\end{\def\one{##1}\def\two{##2}\relax}
  \parsearg#1\end
  \emph{\one} (\two)
}

\begin{document} 
 
  \epigraph{Das Leben ist des Lebens Ziel QUOTE OF unbekannt}

\end{document}

Some additional work is required if you want the second part to be optional, 
though this should be possible as well.

Daniel

Re: Custom Insets with multiple arguments

2010-06-11 Thread Daniel Lohmann

On 10.06.2010, at 11:02, stephen's mailinglist account wrote:

>>> On 06/02/2010 10:59 AM, Rob Oakes wrote:
 Dear LyX-Users,
>> 
 I am in the process of creating a custom of modules for personal use
> 
 p  and another for the creation of epigraphs).  For the epigraph
 module to work correctly, it is important that I be able to use multiple
 input arguments.  For example, the LaTeX code for the epigraph command
 has the form \epigraph{Quotation}{Source}.
>> 
 \epigraph{If a picture isn't worth a thousand words, the hell with
 it.}{Ad Reinhardt}
>> 
 Is anyone aware of a way to create an inset that could support this type
 of macro?  I've looked through several of the examples shipped with LyX
 and wasn't able to find a similar example.
>> 
>> The dinbrief.layout uses the following workaround in a similar case::
>> 
> I have created a module for epigraph using the style of workaround
> suggested by DINbrief
> 
> http://wiki.lyx.org/uploads/Modules/epigraph/epigraph.module
> 
> it uses 3 terms (text, source and typeset) because I wanted to make
> the source italic.
> 
> I would be interested in comments and feedback as to how to do this
> better/more elegantly

An alternative approach might be to exploit plain tex to delimit the arguments 
in a way that is opaque to LyX. Hence, from the viewpoint of LyX and LaTeX, we 
pass a single argument, which then is internally parsed to split it up to 
whatever you need. Minimal example (LaTeX):

\documentclass{minimal} 

\newcommand*{\epigraph}[1]{%
  \def\parsearg##1+##2+{\def\one{##1}\def\two{##2}\relax}
  \parsearg#1+
  \emph{\one} (\two)
}

\begin{document} 
 
  \epigraph{Das Leben ist des Lebens Ziel+unbekannt}

\end{document}

Note that \epigraph gets just one argument, which is then internally split into 
two. In the example I have used the plus symbol (+) as delimiter to split the 
arguments; the delimiter itself is not printed.  However, you might use 
whatever you want to delimit the arguments, even complex tokens:

\documentclass{minimal} 

\newcommand*{\epigraph}[1]{%
  \def\parsearg##1 QUOTE OF ##2\end{\def\one{##1}\def\two{##2}\relax}
  \parsearg#1\end
  \emph{\one} (\two)
}

\begin{document} 
 
  \epigraph{Das Leben ist des Lebens Ziel QUOTE OF unbekannt}

\end{document}

Some additional work is required if you want the second part to be optional, 
though this should be possible as well.

Daniel

Re: Beamer multitude problems with lyx

2010-06-09 Thread Daniel Lohmann

On 08.06.2010, at 11:00, E. Kaplan wrote:

 Thanks, Daniel, for sharing this solution.  

 Which style file are we talking about?  

The beamer theme I have developed for my department. Its a complete own theme 
that is included with \usetheme{i4} in your preamble and has to be put 
somewhere in your texmf-tree (or side by side to the presentation). I have 
zipped it together with a small example:
  http://www4.informatik.uni-erlangen.de/~lohmann/download/i4beamer.zip

As a (somewhat bigger) example I have also provided the Puma-Talk:
  http://www4.informatik.uni-erlangen.de/~lohmann/download/puma-slides.zip

Here I have put the style side by side to the presentation, as I was 
collaborating with a colleague on that.
DISCLAIMER: As most of my talks, this one went through some last-minute 
optimization that partly lead to, well, not so nice code.

 Since examples are the best teachers, could you please upload (or point to) a 
 Lyx file to produce (part of?) the very nice presentation of PUMA that was 
 showcased on your last message?

Sorry, there is no LyX file. I considered the discussion to be already at a 
point how to achieve such things with beamer at all.

I personally do not consider LyX to be the right front end for beamer. In my 
presentations, I tend to use a lot of visual effects and as little plain text 
as possible. The visual effects are mostly achieved with TikZ and some LaTeX 
(and sometimes even plain TeX) coding, which means that within LyX I would end 
up with 80% ERT, which would be a PITA. LyX is definitely not my editor of 
choice for LaTeX code.

Even though I never have tried it: the theme should be usable together with LyX 
as good (or as bad) as any Beamer theme, so feel free to experiment with it.


On 08.06.2010, at 20:29, Steve Litt wrote:

 Daniel, your solution inspired me to solve the other Beamer problem I'd been 
 having. I enjoy having text blocks in my presentations where the text block 
 is 
 maybe 60% of the width, and centered. The width of a Beamer block can be 
 altered by a \setlength{\textwidth}, but no matter what I did with \center, 
 \centering, \hskip, \leftskip, I couldn't center it.

Yeah, this LaTeX center commands are all a bit strange wrt when they work and 
when not; I have never really understood it. The one that works for me is the 
center *environment*. I usually combine it with minipages to achieve the 
desired text width:

 \begin{center}\begin{minipage}{0.8\textwidth}
   BLOCK 
\end{minipage}\end{center}


 Ehud and Daniel, what other Beamer difficulties can you think of? I'm having 
 a 
 lot of trouble getting onto the Beamer-Latex mailing list, so this is the 
 most 
 authoritative Beamer knowledge source I have.


There is probably plenty to say that (even more probably) I have forgot 
meanwhile. So, to just get this started:

** absolute positioning of elements.
IMHO an essential for presentation slides, but not natively supported by 
beamer. I ended up with using TikZ pictures with the [overlay] option and the 
(current page) node to achieve this (see the puma-slides example). In fact, 
TikZ has come to my rescue in many more cases, so I use it quite a lot in 
conjunction with beamer. A major downside of employing TikZ quite a lot, is, 
however...

** long compilation times.
I use the comment package (\begin{comment} ... \end{comment} to uncomment 
during authoring those parts of a presentation I am currently not working on.

** reusability of frames.
This is an issue I do not yet have found a good solution for. In theory, beamer 
frames should be simply reusable, that is, just copy the \begin{frame} ... 
\end{frame} block into your new presentation  -- right? 
In practice, this only works for the most trivial slides. LaTeX is all about 
easing your life with macros, packages, styles, and so on and I use all of it 
quite a lot. The downside is that after a while it is no longer obvious on 
which packages, listing-styles, tikz-styles, color definitions, custom macros, 
and so on -- all that stuff one usually puts (or has to put) in the preamble -- 
a certain frame depends. Things become even worse in a collaborative 
environment, where each of your colleagues has her own tool kit in this 
respect. An attempt to reuse just three slides from a colleague in one of my 
lectures turned out to be multi-hour project, because of such subtle 
dependencies, especially those that do not show up at compilation time, but 
just make the result looking weird, are hard to debug. 
 
Daniel

Re: Beamer multitude problems with lyx

2010-06-09 Thread Daniel Lohmann

On 08.06.2010, at 11:00, E. Kaplan wrote:

 Thanks, Daniel, for sharing this solution.  

 Which style file are we talking about?  

The beamer theme I have developed for my department. Its a complete own theme 
that is included with \usetheme{i4} in your preamble and has to be put 
somewhere in your texmf-tree (or side by side to the presentation). I have 
zipped it together with a small example:
  http://www4.informatik.uni-erlangen.de/~lohmann/download/i4beamer.zip

As a (somewhat bigger) example I have also provided the Puma-Talk:
  http://www4.informatik.uni-erlangen.de/~lohmann/download/puma-slides.zip

Here I have put the style side by side to the presentation, as I was 
collaborating with a colleague on that.
DISCLAIMER: As most of my talks, this one went through some last-minute 
optimization that partly lead to, well, not so nice code.

 Since examples are the best teachers, could you please upload (or point to) a 
 Lyx file to produce (part of?) the very nice presentation of PUMA that was 
 showcased on your last message?

Sorry, there is no LyX file. I considered the discussion to be already at a 
point how to achieve such things with beamer at all.

I personally do not consider LyX to be the right front end for beamer. In my 
presentations, I tend to use a lot of visual effects and as little plain text 
as possible. The visual effects are mostly achieved with TikZ and some LaTeX 
(and sometimes even plain TeX) coding, which means that within LyX I would end 
up with 80% ERT, which would be a PITA. LyX is definitely not my editor of 
choice for LaTeX code.

Even though I never have tried it: the theme should be usable together with LyX 
as good (or as bad) as any Beamer theme, so feel free to experiment with it.


On 08.06.2010, at 20:29, Steve Litt wrote:

 Daniel, your solution inspired me to solve the other Beamer problem I'd been 
 having. I enjoy having text blocks in my presentations where the text block 
 is 
 maybe 60% of the width, and centered. The width of a Beamer block can be 
 altered by a \setlength{\textwidth}, but no matter what I did with \center, 
 \centering, \hskip, \leftskip, I couldn't center it.

Yeah, this LaTeX center commands are all a bit strange wrt when they work and 
when not; I have never really understood it. The one that works for me is the 
center *environment*. I usually combine it with minipages to achieve the 
desired text width:

 \begin{center}\begin{minipage}{0.8\textwidth}
   BLOCK 
\end{minipage}\end{center}


 Ehud and Daniel, what other Beamer difficulties can you think of? I'm having 
 a 
 lot of trouble getting onto the Beamer-Latex mailing list, so this is the 
 most 
 authoritative Beamer knowledge source I have.


There is probably plenty to say that (even more probably) I have forgot 
meanwhile. So, to just get this started:

** absolute positioning of elements.
IMHO an essential for presentation slides, but not natively supported by 
beamer. I ended up with using TikZ pictures with the [overlay] option and the 
(current page) node to achieve this (see the puma-slides example). In fact, 
TikZ has come to my rescue in many more cases, so I use it quite a lot in 
conjunction with beamer. A major downside of employing TikZ quite a lot, is, 
however...

** long compilation times.
I use the comment package (\begin{comment} ... \end{comment} to uncomment 
during authoring those parts of a presentation I am currently not working on.

** reusability of frames.
This is an issue I do not yet have found a good solution for. In theory, beamer 
frames should be simply reusable, that is, just copy the \begin{frame} ... 
\end{frame} block into your new presentation  -- right? 
In practice, this only works for the most trivial slides. LaTeX is all about 
easing your life with macros, packages, styles, and so on and I use all of it 
quite a lot. The downside is that after a while it is no longer obvious on 
which packages, listing-styles, tikz-styles, color definitions, custom macros, 
and so on -- all that stuff one usually puts (or has to put) in the preamble -- 
a certain frame depends. Things become even worse in a collaborative 
environment, where each of your colleagues has her own tool kit in this 
respect. An attempt to reuse just three slides from a colleague in one of my 
lectures turned out to be multi-hour project, because of such subtle 
dependencies, especially those that do not show up at compilation time, but 
just make the result looking weird, are hard to debug. 
 
Daniel

Re: Beamer multitude problems with lyx

2010-06-09 Thread Daniel Lohmann

On 08.06.2010, at 11:00, E. Kaplan wrote:

> Thanks, Daniel, for sharing this solution.  

> Which style file are we talking about?  

The beamer theme I have developed for my department. Its a complete own theme 
that is included with \usetheme{i4} in your preamble and has to be put 
somewhere in your texmf-tree (or side by side to the presentation). I have 
zipped it together with a small example:
  http://www4.informatik.uni-erlangen.de/~lohmann/download/i4beamer.zip

As a (somewhat bigger) example I have also provided the Puma-Talk:
  http://www4.informatik.uni-erlangen.de/~lohmann/download/puma-slides.zip

Here I have put the style side by side to the presentation, as I was 
collaborating with a colleague on that.
DISCLAIMER: As most of my talks, this one went through some "last-minute 
optimization" that partly lead to, well, not so nice code.

> Since examples are the best teachers, could you please upload (or point to) a 
> Lyx file to produce (part of?) the very nice presentation of PUMA that was 
> showcased on your last message?

Sorry, there is no LyX file. I considered the discussion to be already at a 
point how to achieve such things with beamer at all.

I personally do not consider LyX to be the right front end for beamer. In my 
presentations, I tend to use a lot of visual effects and as little "plain text" 
as possible. The visual effects are mostly achieved with TikZ and some LaTeX 
(and sometimes even plain TeX) coding, which means that within LyX I would end 
up with 80% ERT, which would be a PITA. LyX is definitely not my editor of 
choice for LaTeX code.

Even though I never have tried it: the theme should be usable together with LyX 
as good (or as bad) as any Beamer theme, so feel free to experiment with it.


On 08.06.2010, at 20:29, Steve Litt wrote:

> Daniel, your solution inspired me to solve the other Beamer problem I'd been 
> having. I enjoy having text blocks in my presentations where the text block 
> is 
> maybe 60% of the width, and centered. The width of a Beamer block can be 
> altered by a \setlength{\textwidth}, but no matter what I did with \center, 
> \centering, \hskip, \leftskip, I couldn't center it.

Yeah, this LaTeX center commands are all a bit strange wrt when they work and 
when not; I have never really understood it. The one that works for me is the 
center *environment*. I usually combine it with minipages to achieve the 
desired text width:

 \begin{center}\begin{minipage}{0.8\textwidth}
  < BLOCK >
\end{minipage}\end{center}


> Ehud and Daniel, what other Beamer difficulties can you think of? I'm having 
> a 
> lot of trouble getting onto the Beamer-Latex mailing list, so this is the 
> most 
> authoritative Beamer knowledge source I have.


There is probably plenty to say that (even more probably) I have forgot 
meanwhile. So, to just get this started:

** absolute positioning of elements.
IMHO an essential for presentation slides, but not "natively" supported by 
beamer. I ended up with using TikZ pictures with the [overlay] option and the 
(current page) node to achieve this (see the puma-slides example). In fact, 
TikZ has come to my rescue in many more cases, so I use it quite a lot in 
conjunction with beamer. A major downside of employing TikZ quite a lot, is, 
however...

** long compilation times.
I use the comment package (\begin{comment} ... \end{comment} to uncomment 
during authoring those parts of a presentation I am currently not working on.

** reusability of frames.
This is an issue I do not yet have found a good solution for. In theory, beamer 
frames should be simply reusable, that is, just copy the \begin{frame} ... 
\end{frame} block into your new presentation  -- right? 
In practice, this only works for the most trivial slides. LaTeX is all about 
easing your life with macros, packages, styles, and so on and I use all of it 
quite a lot. The downside is that after a while it is no longer obvious on 
which packages, listing-styles, tikz-styles, color definitions, custom macros, 
and so on -- all that stuff one usually puts (or has to put) in the preamble -- 
a certain frame depends. Things become even worse in a collaborative 
environment, where each of your colleagues has her own tool kit in this 
respect. An attempt to reuse just three slides from a colleague in one of my 
lectures turned out to be multi-hour project, because of such subtle 
dependencies, especially those that do not show up at compilation time, but 
just make the result looking weird, are hard to debug. 
 
Daniel

Re: Beamer multitude problems with lyx

2010-06-08 Thread Daniel Lohmann

On 07.06.2010, at 19:41, Steve Litt wrote:

 On Wednesday 02 June 2010 19:18:37 Ehud Kaplan wrote:
 Steve,
 To place a logo (or any other element of a template)  with vfill, hfill,
 etc. is way too much work, since you have to do it on every slide,
 dodging the other important stuff that the slide is to carry-- that is
 what a template is supposed to do.
 I'd be pretty happy with Beamer if they only added to the \logo{}
 statement, in addition to the [height=..] option, a position argument.
 It seems like it should be a rather small thing for them.
 
 EK
 
 Ehud,
 
 I'm trying to join the Beamer-LaTeX mailing list in order to find a solution 
 to this problem. As you correctly pointed out, there's no obvious way to use 
 \vskip within either \logo or \footer -- it won't compile. Unfortunately it's 
 a very hard list to join (yeah, I know that's weird).
 
 You've identified a serious shortcoming of Beamer, and I'm trying very hard 
 to 
 find a way around it, because I plan on using Beamer a lot.

Steve (and others),

I know that you a are a friend of pragmatic solutions (recalling the recurring 
discussion on how to do the front matter), so here is mine with respect to 
beamer, which kind of resembles your front-matter approach :-)

I tried for about a day to implement my group's slide style with beamer, 
including a logo on every slide, of course, but also some other graphical 
elements. (If there is one thing I really dislike about beamer than it are the 
standard styles. I have seen them just too many times, they look all the same. 
IMHO, it should not be overly obvious to the audience which tool the presenter 
has used to create her presentation!)

After fiddling around just too long with pgfimage and Co I gave up and went for 
the brute force approach. I draw the slide style with my graphics program of 
choice into an PDF image of exactly 128x96 mm (the dimensions of a beamer 
slide). Then I install this as the background image on every page. I do not 
use any additional beamer style stuff, and -- voila, there we are. In the style 
file this looks as follows:

%
% background image setup
%
% This is the real trick :-) All graphical elements of the i4-layout are just
% in the background image. To support the plain-option for frames, we actually
% need two different background images (and probably a third one for the title
% slide, don't know yet)
%
%
  \usebackgroundtemplate{
\ifbea...@plainframe%
  \includegraphics[width=\paperwidth]{beamerthemei4_bgplain}%
\else %
  \includegraphics[width=\paperwidth]{beamerthemei4_bg}
\fi%
  }

Of course, this approach is not really the beamer philosophy. You cannot 
combine it as smoothly with outer styles, inner styles, and all this stuff ... 
but what the heck -- I do not need (pseudo-) variety, I need just ONE style 
done right. 

Here is a link to an example presentation:

http://www4.informatik.uni-erlangen.de/Publications/2010/urban_10_aosd-slides.pdf

Daniel

Re: Beamer multitude problems with lyx

2010-06-08 Thread Daniel Lohmann

On 07.06.2010, at 19:41, Steve Litt wrote:

 On Wednesday 02 June 2010 19:18:37 Ehud Kaplan wrote:
 Steve,
 To place a logo (or any other element of a template)  with vfill, hfill,
 etc. is way too much work, since you have to do it on every slide,
 dodging the other important stuff that the slide is to carry-- that is
 what a template is supposed to do.
 I'd be pretty happy with Beamer if they only added to the \logo{}
 statement, in addition to the [height=..] option, a position argument.
 It seems like it should be a rather small thing for them.
 
 EK
 
 Ehud,
 
 I'm trying to join the Beamer-LaTeX mailing list in order to find a solution 
 to this problem. As you correctly pointed out, there's no obvious way to use 
 \vskip within either \logo or \footer -- it won't compile. Unfortunately it's 
 a very hard list to join (yeah, I know that's weird).
 
 You've identified a serious shortcoming of Beamer, and I'm trying very hard 
 to 
 find a way around it, because I plan on using Beamer a lot.

Steve (and others),

I know that you a are a friend of pragmatic solutions (recalling the recurring 
discussion on how to do the front matter), so here is mine with respect to 
beamer, which kind of resembles your front-matter approach :-)

I tried for about a day to implement my group's slide style with beamer, 
including a logo on every slide, of course, but also some other graphical 
elements. (If there is one thing I really dislike about beamer than it are the 
standard styles. I have seen them just too many times, they look all the same. 
IMHO, it should not be overly obvious to the audience which tool the presenter 
has used to create her presentation!)

After fiddling around just too long with pgfimage and Co I gave up and went for 
the brute force approach. I draw the slide style with my graphics program of 
choice into an PDF image of exactly 128x96 mm (the dimensions of a beamer 
slide). Then I install this as the background image on every page. I do not 
use any additional beamer style stuff, and -- voila, there we are. In the style 
file this looks as follows:

%
% background image setup
%
% This is the real trick :-) All graphical elements of the i4-layout are just
% in the background image. To support the plain-option for frames, we actually
% need two different background images (and probably a third one for the title
% slide, don't know yet)
%
%
  \usebackgroundtemplate{
\ifbea...@plainframe%
  \includegraphics[width=\paperwidth]{beamerthemei4_bgplain}%
\else %
  \includegraphics[width=\paperwidth]{beamerthemei4_bg}
\fi%
  }

Of course, this approach is not really the beamer philosophy. You cannot 
combine it as smoothly with outer styles, inner styles, and all this stuff ... 
but what the heck -- I do not need (pseudo-) variety, I need just ONE style 
done right. 

Here is a link to an example presentation:

http://www4.informatik.uni-erlangen.de/Publications/2010/urban_10_aosd-slides.pdf

Daniel

Re: Beamer multitude problems with lyx

2010-06-08 Thread Daniel Lohmann

On 07.06.2010, at 19:41, Steve Litt wrote:

> On Wednesday 02 June 2010 19:18:37 Ehud Kaplan wrote:
>> Steve,
>> To place a logo (or any other element of a template)  with vfill, hfill,
>> etc. is way too much work, since you have to do it on every slide,
>> dodging the other important stuff that the slide is to carry-- that is
>> what a template is supposed to do.
>> I'd be pretty happy with Beamer if they only added to the \logo{}
>> statement, in addition to the [height=..] option, a position argument.
>> It seems like it should be a rather small thing for them.
>> 
>> EK
> 
> Ehud,
> 
> I'm trying to join the Beamer-LaTeX mailing list in order to find a solution 
> to this problem. As you correctly pointed out, there's no obvious way to use 
> \vskip within either \logo or \footer -- it won't compile. Unfortunately it's 
> a very hard list to join (yeah, I know that's weird).
> 
> You've identified a serious shortcoming of Beamer, and I'm trying very hard 
> to 
> find a way around it, because I plan on using Beamer a lot.

Steve (and others),

I know that you a are a friend of pragmatic solutions (recalling the recurring 
discussion on how to do the front matter), so here is mine with respect to 
beamer, which kind of resembles your front-matter approach :-)

I tried for about a day to implement my group's slide style with beamer, 
including a logo on every slide, of course, but also some other graphical 
elements. (If there is one thing I really dislike about beamer than it are the 
standard styles. I have seen them just too many times, they look all the same. 
IMHO, it should not be overly obvious to the audience which tool the presenter 
has used to create her presentation!)

After fiddling around just too long with pgfimage and Co I gave up and went for 
the brute force approach. I "draw" the slide style with my graphics program of 
choice into an PDF image of exactly 128x96 mm (the dimensions of a beamer 
slide). Then I install this as the "background" image on every page. I do not 
use any additional beamer style stuff, and -- voila, there we are. In the style 
file this looks as follows:

%
% background image setup
%
% This is the real trick :-) All graphical elements of the i4-layout are just
% in the background image. To support the "plain"-option for frames, we actually
% need two different background images (and probably a third one for the title
% slide, don't know yet)
%
%
  \usebackgroundtemplate{
\ifbea...@plainframe%
  \includegraphics[width=\paperwidth]{beamerthemei4_bgplain}%
\else %
  \includegraphics[width=\paperwidth]{beamerthemei4_bg}
\fi%
  }

Of course, this approach is not really the "beamer philosophy". You cannot 
combine it as smoothly with outer styles, inner styles, and all this stuff ... 
but what the heck -- I do not need (pseudo-) variety, I need just ONE style 
"done right". 

Here is a link to an example presentation:

http://www4.informatik.uni-erlangen.de/Publications/2010/urban_10_aosd-slides.pdf

Daniel

Re: Save Date vs. Print Date

2010-05-28 Thread Daniel Lohmann

On 28.05.2010, at 00:30, Tim Wescott wrote:

 Under the 'Article' document type, the title page will list the print date of 
 a document.
 
 But I vastly prefer to insert my own date, or to list the save date of the 
 file -- it just makes more sense for tracking changes.
 
 Is there a way to get LyX to do this? I didn't see it in the menus.

Assuming you are compiling with pdftex as backend (which is most probably the 
case, as all more or less recent LaTeX-Distributions use it by default -- even 
when compiling to dvi), you can use the  \pdffilemoddate{filename} built-in 
command to retrieve the last modified date of filename. 

LyXically and applied for the own source file this comes down to the following 
two lines, which should be inserted into your document's preamble:

\def\parsedate #1:20#2#3#4#5#6#7#8\empty{20#2#3/#4#5/#6#7}
\date{\expandafter\parsedate\pdffilemoddate{\jobname.tex}\empty}

(You can alter the display format, e.g., to use full stops instead of hyphens 
as separators, by modifying the \empty{} part of the first line.

I have found the basics of this trick on the net some time ago, so I do not 
want claim authorship for it. Note that in its current form \parsedate only 
works for the years 2000 -- 2099.

Daniel
 

Re: Save Date vs. Print Date

2010-05-28 Thread Daniel Lohmann

On 28.05.2010, at 21:24, stefano franchi wrote:

 
 
 On Fri, May 28, 2010 at 5:33 AM, Daniel Lohmann 
 daniel.lohm...@informatik.uni-erlangen.de wrote:
 
 On 28.05.2010, at 00:30, Tim Wescott wrote:
 
 
 Assuming you are compiling with pdftex as backend (which is most probably the 
 case, as all more or less recent LaTeX-Distributions use it by default -- 
 even when compiling to dvi), you can use the  \pdffilemoddate{filename} 
 built-in command to retrieve the last modified date of filename.
 
 LyXically and applied for the own source file this comes down to the 
 following two lines, which should be inserted into your document's preamble:
 
 \def\parsedate #1:20#2#3#4#5#6#7#8\empty{20#2#3/#4#5/#6#7}
 \date{\expandafter\parsedate\pdffilemoddate{\jobname.tex}\empty}
 
 (You can alter the display format, e.g., to use full stops instead of hyphens 
 as separators, by modifying the \empty{} part of the first line.
 
 
 Nice trick. But wouldn't the  final result be identical to the print date, 
 since pdftex checks the modification date of a tex file created on the fly by 
 lyx at print time? Or there is something more involved I don't understand?

Stefano, you are right, of course!

We need the path to the LyX-File, not to the generated .tex file:

\date{\expandafter\parsedate\pdffilemoddate{/Users/lohmann/test.lyx}\empty}

However, I would prefer not to hard-code the absolute path to the LyX file. 
Fortunately, LyX defines \in...@path in the preamble as the file path to the 
LyX-file directory:

\def\in...@path{{/Users/lohmann//}}

However, the following does /not/ work:

\date{\expandafter\parsedate\pdffilemoddate{\in...@path\jobname.lyx}\empty}

Apparently, the problem is the double curly braces that LyX uses in the 
definition of \in...@path and that somehow influence the TeX-internal scanning; 
with the following definition it /would/ work: 

\def\in...@path{/Users/lohmann//}

Does anybody know, how to expand \in...@path in a way that the double curly 
braces do not cause these troubles?

 Daniel

Re: Save Date vs. Print Date

2010-05-28 Thread Daniel Lohmann

 Nice trick. But wouldn't the  final result be identical to the print date, 
 since pdftex checks the modification date of a tex file created on the fly 
 by lyx at print time? Or there is something more involved I don't understand?
 
 Stefano, you are right, of course!
 
 We need the path to the LyX-File, not to the generated .tex file:
 
 \date{\expandafter\parsedate\pdffilemoddate{/Users/lohmann/test.lyx}\empty}
 
 However, I would prefer not to hard-code the absolute path to the LyX file. 
 Fortunately, LyX defines \in...@path in the preamble as the file path to the 
 LyX-file directory:
 
 \def\in...@path{{/Users/lohmann//}}
 
 However, the following does /not/ work:
 
 \date{\expandafter\parsedate\pdffilemoddate{\in...@path\jobname.lyx}\empty}
 
 Apparently, the problem is the double curly braces that LyX uses in the 
 definition of \in...@path and that somehow influence the TeX-internal 
 scanning; with the following definition it /would/ work: 
 
 \def\in...@path{/Users/lohmann//}
 
 Does anybody know, how to expand \in...@path in a way that the double curly 
 braces do not cause these troubles?


I have found the xstring package, which provides a \StrRemoveBraces command 
that helps here:

\usepackage{xstring}
\strremovebraces{\in...@path\jobname.lyx}[\lyxfilepath]
\def\parsedate #1:20#2#3#4#5#6#7#8\empty{20#2#3/#4#5/#6#7}
\date{\expandafter\parsedate\pdffilemoddate{\lyxfilepath}\empty}

Attached is a .lyx-file that demonstrate this.

Nevertheless, I would prefer a solution that does not employ xstring.

Daniel




moddate.lyx
Description: Binary data


Re: Save Date vs. Print Date

2010-05-28 Thread Daniel Lohmann

On 28.05.2010, at 00:30, Tim Wescott wrote:

 Under the 'Article' document type, the title page will list the print date of 
 a document.
 
 But I vastly prefer to insert my own date, or to list the save date of the 
 file -- it just makes more sense for tracking changes.
 
 Is there a way to get LyX to do this? I didn't see it in the menus.

Assuming you are compiling with pdftex as backend (which is most probably the 
case, as all more or less recent LaTeX-Distributions use it by default -- even 
when compiling to dvi), you can use the  \pdffilemoddate{filename} built-in 
command to retrieve the last modified date of filename. 

LyXically and applied for the own source file this comes down to the following 
two lines, which should be inserted into your document's preamble:

\def\parsedate #1:20#2#3#4#5#6#7#8\empty{20#2#3/#4#5/#6#7}
\date{\expandafter\parsedate\pdffilemoddate{\jobname.tex}\empty}

(You can alter the display format, e.g., to use full stops instead of hyphens 
as separators, by modifying the \empty{} part of the first line.

I have found the basics of this trick on the net some time ago, so I do not 
want claim authorship for it. Note that in its current form \parsedate only 
works for the years 2000 -- 2099.

Daniel
 

Re: Save Date vs. Print Date

2010-05-28 Thread Daniel Lohmann

On 28.05.2010, at 21:24, stefano franchi wrote:

 
 
 On Fri, May 28, 2010 at 5:33 AM, Daniel Lohmann 
 daniel.lohm...@informatik.uni-erlangen.de wrote:
 
 On 28.05.2010, at 00:30, Tim Wescott wrote:
 
 
 Assuming you are compiling with pdftex as backend (which is most probably the 
 case, as all more or less recent LaTeX-Distributions use it by default -- 
 even when compiling to dvi), you can use the  \pdffilemoddate{filename} 
 built-in command to retrieve the last modified date of filename.
 
 LyXically and applied for the own source file this comes down to the 
 following two lines, which should be inserted into your document's preamble:
 
 \def\parsedate #1:20#2#3#4#5#6#7#8\empty{20#2#3/#4#5/#6#7}
 \date{\expandafter\parsedate\pdffilemoddate{\jobname.tex}\empty}
 
 (You can alter the display format, e.g., to use full stops instead of hyphens 
 as separators, by modifying the \empty{} part of the first line.
 
 
 Nice trick. But wouldn't the  final result be identical to the print date, 
 since pdftex checks the modification date of a tex file created on the fly by 
 lyx at print time? Or there is something more involved I don't understand?

Stefano, you are right, of course!

We need the path to the LyX-File, not to the generated .tex file:

\date{\expandafter\parsedate\pdffilemoddate{/Users/lohmann/test.lyx}\empty}

However, I would prefer not to hard-code the absolute path to the LyX file. 
Fortunately, LyX defines \in...@path in the preamble as the file path to the 
LyX-file directory:

\def\in...@path{{/Users/lohmann//}}

However, the following does /not/ work:

\date{\expandafter\parsedate\pdffilemoddate{\in...@path\jobname.lyx}\empty}

Apparently, the problem is the double curly braces that LyX uses in the 
definition of \in...@path and that somehow influence the TeX-internal scanning; 
with the following definition it /would/ work: 

\def\in...@path{/Users/lohmann//}

Does anybody know, how to expand \in...@path in a way that the double curly 
braces do not cause these troubles?

 Daniel

Re: Save Date vs. Print Date

2010-05-28 Thread Daniel Lohmann

 Nice trick. But wouldn't the  final result be identical to the print date, 
 since pdftex checks the modification date of a tex file created on the fly 
 by lyx at print time? Or there is something more involved I don't understand?
 
 Stefano, you are right, of course!
 
 We need the path to the LyX-File, not to the generated .tex file:
 
 \date{\expandafter\parsedate\pdffilemoddate{/Users/lohmann/test.lyx}\empty}
 
 However, I would prefer not to hard-code the absolute path to the LyX file. 
 Fortunately, LyX defines \in...@path in the preamble as the file path to the 
 LyX-file directory:
 
 \def\in...@path{{/Users/lohmann//}}
 
 However, the following does /not/ work:
 
 \date{\expandafter\parsedate\pdffilemoddate{\in...@path\jobname.lyx}\empty}
 
 Apparently, the problem is the double curly braces that LyX uses in the 
 definition of \in...@path and that somehow influence the TeX-internal 
 scanning; with the following definition it /would/ work: 
 
 \def\in...@path{/Users/lohmann//}
 
 Does anybody know, how to expand \in...@path in a way that the double curly 
 braces do not cause these troubles?


I have found the xstring package, which provides a \StrRemoveBraces command 
that helps here:

\usepackage{xstring}
\strremovebraces{\in...@path\jobname.lyx}[\lyxfilepath]
\def\parsedate #1:20#2#3#4#5#6#7#8\empty{20#2#3/#4#5/#6#7}
\date{\expandafter\parsedate\pdffilemoddate{\lyxfilepath}\empty}

Attached is a .lyx-file that demonstrate this.

Nevertheless, I would prefer a solution that does not employ xstring.

Daniel




moddate.lyx
Description: Binary data


Re: Save Date vs. Print Date

2010-05-28 Thread Daniel Lohmann

On 28.05.2010, at 00:30, Tim Wescott wrote:

> Under the 'Article' document type, the title page will list the print date of 
> a document.
> 
> But I vastly prefer to insert my own date, or to list the save date of the 
> file -- it just makes more sense for tracking changes.
> 
> Is there a way to get LyX to do this? I didn't see it in the menus.

Assuming you are compiling with pdftex as backend (which is most probably the 
case, as all more or less recent LaTeX-Distributions use it by default -- even 
when compiling to dvi), you can use the  \pdffilemoddate{} built-in 
command to retrieve the "last modified" date of . 

LyXically and applied for the own source file this comes down to the following 
two lines, which should be inserted into your document's preamble:

\def\parsedate #1:20#2#3#4#5#6#7#8\empty{20#2#3/#4#5/#6#7}
\date{\expandafter\parsedate\pdffilemoddate{\jobname.tex}\empty}

(You can alter the display format, e.g., to use full stops instead of hyphens 
as separators, by modifying the \empty{} part of the first line.

I have found the basics of this trick on the net some time ago, so I do not 
want claim authorship for it. Note that in its current form \parsedate only 
works for the years 2000 -- 2099.

Daniel
 

Re: Save Date vs. Print Date

2010-05-28 Thread Daniel Lohmann

On 28.05.2010, at 21:24, stefano franchi wrote:

> 
> 
> On Fri, May 28, 2010 at 5:33 AM, Daniel Lohmann 
> <daniel.lohm...@informatik.uni-erlangen.de> wrote:
> 
> On 28.05.2010, at 00:30, Tim Wescott wrote:
> 
> 
> Assuming you are compiling with pdftex as backend (which is most probably the 
> case, as all more or less recent LaTeX-Distributions use it by default -- 
> even when compiling to dvi), you can use the  \pdffilemoddate{} 
> built-in command to retrieve the "last modified" date of .
> 
> LyXically and applied for the own source file this comes down to the 
> following two lines, which should be inserted into your document's preamble:
> 
> \def\parsedate #1:20#2#3#4#5#6#7#8\empty{20#2#3/#4#5/#6#7}
> \date{\expandafter\parsedate\pdffilemoddate{\jobname.tex}\empty}
> 
> (You can alter the display format, e.g., to use full stops instead of hyphens 
> as separators, by modifying the \empty{} part of the first line.
> 
> 
> Nice trick. But wouldn't the  final result be identical to the print date, 
> since pdftex checks the modification date of a tex file created on the fly by 
> lyx at print time? Or there is something more involved I don't understand?

Stefano, you are right, of course!

We need the path to the LyX-File, not to the generated .tex file:

\date{\expandafter\parsedate\pdffilemoddate{/Users/lohmann/test.lyx}\empty}

However, I would prefer not to hard-code the absolute path to the LyX file. 
Fortunately, LyX defines \in...@path in the preamble as the file path to the 
LyX-file directory:

\def\in...@path{{/Users/lohmann//}}

However, the following does /not/ work:

\date{\expandafter\parsedate\pdffilemoddate{\in...@path\jobname.lyx}\empty}

Apparently, the problem is the double curly braces that LyX uses in the 
definition of \in...@path and that somehow influence the TeX-internal scanning; 
with the following definition it /would/ work: 

\def\in...@path{/Users/lohmann//}

Does anybody know, how to expand \in...@path in a way that the double curly 
braces do not cause these troubles?

 Daniel

Re: Save Date vs. Print Date

2010-05-28 Thread Daniel Lohmann

>> Nice trick. But wouldn't the  final result be identical to the print date, 
>> since pdftex checks the modification date of a tex file created on the fly 
>> by lyx at print time? Or there is something more involved I don't understand?
> 
> Stefano, you are right, of course!
> 
> We need the path to the LyX-File, not to the generated .tex file:
> 
> \date{\expandafter\parsedate\pdffilemoddate{/Users/lohmann/test.lyx}\empty}
> 
> However, I would prefer not to hard-code the absolute path to the LyX file. 
> Fortunately, LyX defines \in...@path in the preamble as the file path to the 
> LyX-file directory:
> 
> \def\in...@path{{/Users/lohmann//}}
> 
> However, the following does /not/ work:
> 
> \date{\expandafter\parsedate\pdffilemoddate{\in...@path\jobname.lyx}\empty}
> 
> Apparently, the problem is the double curly braces that LyX uses in the 
> definition of \in...@path and that somehow influence the TeX-internal 
> scanning; with the following definition it /would/ work: 
> 
> \def\in...@path{/Users/lohmann//}
> 
> Does anybody know, how to expand \in...@path in a way that the double curly 
> braces do not cause these troubles?


I have found the xstring package, which provides a \StrRemoveBraces command 
that helps here:

\usepackage{xstring}
\strremovebraces{\in...@path\jobname.lyx}[\lyxfilepath]
\def\parsedate #1:20#2#3#4#5#6#7#8\empty{20#2#3/#4#5/#6#7}
\date{\expandafter\parsedate\pdffilemoddate{\lyxfilepath}\empty}

Attached is a .lyx-file that demonstrate this.

Nevertheless, I would prefer a solution that does not employ xstring.

Daniel




moddate.lyx
Description: Binary data


Re: General Question

2010-05-19 Thread Daniel Lohmann

On 18.05.2010, at 17:02, RIchard Heck wrote:

 
 Sending this to user's, too
 
 On 05/18/2010 10:24 AM, Wes Lakenan wrote:
 
 Hi,
  
 My company is looking into switching from MS Word to a less stressful 
 program to create textbook-like binders.  My company is a government 
 contractor that teaches program management courses that utilize both printed 
 text and PowerPoint presentations.  Right now, we create PowerPoint files 
 and copy/paste them into a Word document.  This allows the students to 
 follow along with the printed text and use the inserted PowerPoint slides to 
 follow the presentation.  However, every time a slide is changed or deleted, 
 every slide needs to be reinserted.  Is it possible to insert individual 
 slides throughout the document one by one?  I appreciate any help you can 
 give me. 
  
 I have only a very vague sense what you are trying to do, but I think this 
 kind of thing would be possible. Is the idea that the slides from the 
 presentation appear as images in the text, so that the student can see them 
 there with the text?
 
 If so, then I would think the workflow could look like this. You create two 
 separate documents: a LyX document for the text, and a presentation document, 
 for which you could use OpenOffice Impress or LyX itself, via the Beamer 
 class, or you could stick with PowerPoint. You print the presentation 
 document as a PDF and then use something like pdftoppm to convert the pages 
 of the pdf to images. The images themselves can then be inserted into the LyX 
 document in the usual way. Since all of this is just running a bunch of 
 programs, it could all be automated, even, though you might have to check the 
 image names manually, as they could change if you'd added or removed pages.

It's even easier than that as LyX/Latex (\includegraphics) can directly embed a 
certain page of a PDF file as graphics. 

The general idea is to have the slides as external material that is *referenced 
from* the textbook document instead of *copied into* it, so that whenever a 
silde changes, it also changes in the textbook. Note: While I surely would like 
to convince you to use LyX, this should be possible with Word as well (at least 
it used to be possible ten years ago).

Daniel

  



Re: General Question

2010-05-19 Thread Daniel Lohmann

On 18.05.2010, at 17:02, RIchard Heck wrote:

 
 Sending this to user's, too
 
 On 05/18/2010 10:24 AM, Wes Lakenan wrote:
 
 Hi,
  
 My company is looking into switching from MS Word to a less stressful 
 program to create textbook-like binders.  My company is a government 
 contractor that teaches program management courses that utilize both printed 
 text and PowerPoint presentations.  Right now, we create PowerPoint files 
 and copy/paste them into a Word document.  This allows the students to 
 follow along with the printed text and use the inserted PowerPoint slides to 
 follow the presentation.  However, every time a slide is changed or deleted, 
 every slide needs to be reinserted.  Is it possible to insert individual 
 slides throughout the document one by one?  I appreciate any help you can 
 give me. 
  
 I have only a very vague sense what you are trying to do, but I think this 
 kind of thing would be possible. Is the idea that the slides from the 
 presentation appear as images in the text, so that the student can see them 
 there with the text?
 
 If so, then I would think the workflow could look like this. You create two 
 separate documents: a LyX document for the text, and a presentation document, 
 for which you could use OpenOffice Impress or LyX itself, via the Beamer 
 class, or you could stick with PowerPoint. You print the presentation 
 document as a PDF and then use something like pdftoppm to convert the pages 
 of the pdf to images. The images themselves can then be inserted into the LyX 
 document in the usual way. Since all of this is just running a bunch of 
 programs, it could all be automated, even, though you might have to check the 
 image names manually, as they could change if you'd added or removed pages.

It's even easier than that as LyX/Latex (\includegraphics) can directly embed a 
certain page of a PDF file as graphics. 

The general idea is to have the slides as external material that is *referenced 
from* the textbook document instead of *copied into* it, so that whenever a 
silde changes, it also changes in the textbook. Note: While I surely would like 
to convince you to use LyX, this should be possible with Word as well (at least 
it used to be possible ten years ago).

Daniel

  



Re: General Question

2010-05-19 Thread Daniel Lohmann

On 18.05.2010, at 17:02, RIchard Heck wrote:

> 
> Sending this to user's, too
> 
> On 05/18/2010 10:24 AM, Wes Lakenan wrote:
>> 
>> Hi,
>>  
>> My company is looking into switching from MS Word to a less stressful 
>> program to create textbook-like binders.  My company is a government 
>> contractor that teaches program management courses that utilize both printed 
>> text and PowerPoint presentations.  Right now, we create PowerPoint files 
>> and copy/paste them into a Word document.  This allows the students to 
>> follow along with the printed text and use the inserted PowerPoint slides to 
>> follow the presentation.  However, every time a slide is changed or deleted, 
>> every slide needs to be reinserted.  Is it possible to insert individual 
>> slides throughout the document one by one?  I appreciate any help you can 
>> give me. 
>>  
> I have only a very vague sense what you are trying to do, but I think this 
> kind of thing would be possible. Is the idea that the slides from the 
> presentation appear as images in the text, so that the student can see them 
> there with the text?
> 
> If so, then I would think the workflow could look like this. You create two 
> separate documents: a LyX document for the text, and a presentation document, 
> for which you could use OpenOffice Impress or LyX itself, via the Beamer 
> class, or you could stick with PowerPoint. You print the presentation 
> document as a PDF and then use something like pdftoppm to convert the pages 
> of the pdf to images. The images themselves can then be inserted into the LyX 
> document in the usual way. Since all of this is just running a bunch of 
> programs, it could all be automated, even, though you might have to check the 
> image names manually, as they could change if you'd added or removed pages.

It's even easier than that as LyX/Latex (\includegraphics) can directly embed a 
certain page of a PDF file as graphics. 

The general idea is to have the slides as external material that is *referenced 
from* the textbook document instead of *copied into* it, so that whenever a 
silde changes, it also changes in the textbook. Note: While I surely would like 
to convince you to use LyX, this should be possible with Word as well (at least 
it used to be possible ten years ago).

Daniel

  



Re: Bibtex question. How do I insert scans of covers.

2010-03-02 Thread Daniel Lohmann


On 02.03.2010, at 09:04, mario wrote:


Il giorno lun, 01/03/2010 alle 22.29 +0100, Daniel Lohmann ha scritto:

On 01.03.2010, at 21:33, mario wrote:





Just an untested idea: Have you tried (mis-)using the note field  
for

this purpose?

@book {...

note={\includegraphics{...}}
}

This probably won't work within LyX, as LyX would not copy the image
files to the temporary generation directory. However, with plain  
LaTeX

it might do the trick.


Daniel


I get the following error:
./myfile.bbl:4:Undefined control sequence $\includegraphics



You have to include some graphics package (e.g.,  
\usepackage{graphicx}) in your preamble.


Daniel


Re: Bibtex question. How do I insert scans of covers.

2010-03-02 Thread Daniel Lohmann


On 02.03.2010, at 09:04, mario wrote:


Il giorno lun, 01/03/2010 alle 22.29 +0100, Daniel Lohmann ha scritto:

On 01.03.2010, at 21:33, mario wrote:





Just an untested idea: Have you tried (mis-)using the note field  
for

this purpose?

@book {...

note={\includegraphics{...}}
}

This probably won't work within LyX, as LyX would not copy the image
files to the temporary generation directory. However, with plain  
LaTeX

it might do the trick.


Daniel


I get the following error:
./myfile.bbl:4:Undefined control sequence $\includegraphics



You have to include some graphics package (e.g.,  
\usepackage{graphicx}) in your preamble.


Daniel


Re: Bibtex question. How do I insert scans of covers.

2010-03-02 Thread Daniel Lohmann


On 02.03.2010, at 09:04, mario wrote:


Il giorno lun, 01/03/2010 alle 22.29 +0100, Daniel Lohmann ha scritto:

On 01.03.2010, at 21:33, mario wrote:





Just an untested idea: Have you tried (mis-)using the "note" field  
for

this purpose?

@book {...

note={\includegraphics{...}}
}

This probably won't work within LyX, as LyX would not copy the image
files to the temporary generation directory. However, with plain  
LaTeX

it might do the trick.


Daniel


I get the following error:
./myfile.bbl:4:Undefined control sequence $\includegraphics



You have to include some graphics package (e.g.,  
\usepackage{graphicx}) in your preamble.


Daniel


Re: Bibtex question. How do I insert scans of covers.

2010-03-01 Thread Daniel Lohmann


On 01.03.2010, at 21:33, mario wrote:


Hi

thanks for your reply.

Il giorno lun, 01/03/2010 alle 17.14 +0100, Uwe Stöhr ha scritto:

mario schrieb:


My question is: I would like to include scans of covers and selected
pages within my bibtex entrie (and final output), how do I do?


Personally, I use the BibTeX entry type misc for such cases.


yes, but  then how do you get the scan image in the final .dvi  
(or .pdf)

output?


Just an untested idea: Have you tried (mis-)using the note field for  
this purpose?


@book {...

note={\includegraphics{...}}
}

This probably won't work within LyX, as LyX would not copy the image  
files to the temporary generation directory. However, with plain LaTeX  
it might do the trick.



Daniel

Re: Bibtex question. How do I insert scans of covers.

2010-03-01 Thread Daniel Lohmann


On 01.03.2010, at 21:33, mario wrote:


Hi

thanks for your reply.

Il giorno lun, 01/03/2010 alle 17.14 +0100, Uwe Stöhr ha scritto:

mario schrieb:


My question is: I would like to include scans of covers and selected
pages within my bibtex entrie (and final output), how do I do?


Personally, I use the BibTeX entry type misc for such cases.


yes, but  then how do you get the scan image in the final .dvi  
(or .pdf)

output?


Just an untested idea: Have you tried (mis-)using the note field for  
this purpose?


@book {...

note={\includegraphics{...}}
}

This probably won't work within LyX, as LyX would not copy the image  
files to the temporary generation directory. However, with plain LaTeX  
it might do the trick.



Daniel

Re: Bibtex question. How do I insert scans of covers.

2010-03-01 Thread Daniel Lohmann


On 01.03.2010, at 21:33, mario wrote:


Hi

thanks for your reply.

Il giorno lun, 01/03/2010 alle 17.14 +0100, Uwe Stöhr ha scritto:

mario schrieb:


My question is: I would like to include scans of covers and selected
pages within my bibtex entrie (and final output), how do I do?


Personally, I use the BibTeX entry type "misc" for such cases.


yes, but  then how do you get the scan image in the final .dvi  
(or .pdf)

output?


Just an untested idea: Have you tried (mis-)using the "note" field for  
this purpose?


@book {...

note={\includegraphics{...}}
}

This probably won't work within LyX, as LyX would not copy the image  
files to the temporary generation directory. However, with plain LaTeX  
it might do the trick.



Daniel

Re: Convert Comment into Marginal Note

2010-02-16 Thread Daniel Lohmann

Hi Diego,

I did something similar for lyxgreyedout in my dissertation. The  
caveat is that both., lyxgreyedout and comment are environments,  
whereas marginpar is a command. So actually you are looking for a  
technique to grab the content of an environment in a way it can be  
passed to a command.


After hours of googling I had found the trick. The amsmath package  
provides  a fairly magic macro called \coll...@body to perform this  
task.


I have added the respective lines from my thesis preamble. I developed  
three variants to typeset the comments, but don't know if the  
marginpar variant ever really worked. The tikz variant was way  
cooler :-)



Have fun,

Daniel

%*
%** handling of notes  

% LyX typesets greyed out notes in an LaTeX environment  
lyxgreyedout. By

% redefinition of this environment, we can control how notes are printed
% out in the PDF.
%
% The \coll...@body (provided by amsmath) trick was taken from
% 
http://groups.google.com/group/comp.text.tex/browse_thread/thread/4cc1379654f40925/2316a38e9912fe23?lnk=stq=+%5Ccollect%40body+1995+rnum=1#2316a38e9912fe23
% Basically, it can be used to pass all content of an enviroment to a  
command.


%%   % Variant 1: typeset notes as \marginpar (yet to be completed)
%%  \makeatletter
%%  \renewenvironment{lyxgreyedout}{\coll...@body\@NOTE}{\global 
\...@ignoretrue}

%%  \newcomma...@note[1]{\marginpar{#1}}
%%  \makeatother
%%  \addtolength{\textwidth}{-5cm}



%%  % Variant 2: typeset notes as footnotes. We use the bigfoot package
%%  % to define our own footnote stack for the notes
%%
%%
%%  % The following replaces the default \footnote command by an own
%%  % to ensure that ordinary footnotes are always printed first
%%  \DeclareNewFootnote{A}
%%  \renewcommand{\footnote}{\footnoteA}
%%
%%  % This defines the \footnoteNOTE command for the extra stack.
%%  % greyed out are printed as sans-serif, red colored footnotes
%%  % with captial arabic numbering
%%  \DeclareNewFootnote[para]{NOTE}[Alph]
%%  \renewcommand{\footnoteNOTE}{%
%%\stepcounter{footnoteNOTE}%
%%\textcolor{red}{\Footnotemark\thefootnoteNOTE} \FootnotetextNOTE 
\thefootnoteNOTE}

%%
%%  % redefine the lyxgreyedout environment
%%  \makeatletter
%%  \makeenvironment{lyxgreyedout}{\coll...@body\@NOTE}{\global 
\...@ignoretrue}
%%  \newcomma...@note[1]{\footnotenote{\begin{minipage}[t]{\textwidth} 
{\scriptsize\sffamily{\textcolor{red}{#1}}}\end{minipage}}}

%%  \makeatother

%%   % Variant 3: typset notes with tikz as marginpars
   \usepackage{tikz}
%%   \makeatletter
%%   \makeenvironment{lyxgreyedout}{\coll...@body\todonote}{\global 
\...@ignoretrue}%

%%   \makeatother
%%
%%   \newcommand{\todoNOTE}[1]{%
%% \begin{tikzpicture}[remember picture, baseline=-0.75ex]%
%%   \node [coordinate] (inText) {};%
%% \end{tikzpicture}%
%% \marginpar{%
%%   \begin{sffamily}%
%%   \begin{scriptsize}%
%%   \begin{tikzpicture}[remember picture]%
%% %  \draw node[draw=Orange_4, fill=Orange_4!50, text width =  
3.4cm ] (inNote)
%%   \draw node[draw=Gray_40, fill=Gray_10, text width =  
3.4cm ] (inNote)

%%   {#1};
%%   \end{tikzpicture}%
%%   \end{scriptsize}%
%%   \end{sffamily}%
%% }%
%% \begin{tikzpicture}[remember picture, overlay]%
%%   \draw[draw = Gray_40, thick]
%% %  \draw[draw = Orange_4, thick]
%%   ([yshift=-0.2cm] inText)
%% -| ([xshift=-0.2cm] inNote.west)
%% -| (inNote.west);
%% \end{tikzpicture}%
%%   }%

  % Variant 4: ignore them at all -- for the final print
  \makeenvironment{lyxgreyedout}{}{}


On 13.02.2010, at 19:51, Diego wrote:

Hi, using LyX I'm trying to convert the comments into marginal  
notes.


I tried several things but without luck.

The best shot was like this:

\makeatletter
\...@ifundefined{comment}{}{%
\renewenvironment{comment}[1]%
{\begingroup\marginpar{\bgroup#1\egroup}}%
{\endgroup}}
\makeatother

or like this:

\...@ifundefined{comment}{}{%
\renewenvironment{comment}%
{\marginpar{}%
{}}%

But what I get is only the first character of the text converted.  
Like in the attached image.


I searched a lot trying to find how to solve this but without luck.  
I found the explanation of what is happening here:http://theoval.cmp.uea.ac.uk/~nlct/latex/csed/solutions/fonts.html


Unexpected Output
Only one character is in the new font
You thought you changed font over a selection of text, but only the  
first character has come out in the new font.
You have most probably used a command instead of a declaration. The  
command should take the text as its argument. If you don't group the  
text, only the first character will be passed as the argument.


What I don't know and wasn't able to find is how to group the text.

Hope someone could help me :-)

Many thanks.

Best Regards,
Diego
(diegostex)

Re: Convert Comment into Marginal Note

2010-02-16 Thread Daniel Lohmann

Hi Diego,

I did something similar for lyxgreyedout in my dissertation. The  
caveat is that both., lyxgreyedout and comment are environments,  
whereas marginpar is a command. So actually you are looking for a  
technique to grab the content of an environment in a way it can be  
passed to a command.


After hours of googling I had found the trick. The amsmath package  
provides  a fairly magic macro called \coll...@body to perform this  
task.


I have added the respective lines from my thesis preamble. I developed  
three variants to typeset the comments, but don't know if the  
marginpar variant ever really worked. The tikz variant was way  
cooler :-)



Have fun,

Daniel

%*
%** handling of notes  

% LyX typesets greyed out notes in an LaTeX environment  
lyxgreyedout. By

% redefinition of this environment, we can control how notes are printed
% out in the PDF.
%
% The \coll...@body (provided by amsmath) trick was taken from
% 
http://groups.google.com/group/comp.text.tex/browse_thread/thread/4cc1379654f40925/2316a38e9912fe23?lnk=stq=+%5Ccollect%40body+1995+rnum=1#2316a38e9912fe23
% Basically, it can be used to pass all content of an enviroment to a  
command.


%%   % Variant 1: typeset notes as \marginpar (yet to be completed)
%%  \makeatletter
%%  \renewenvironment{lyxgreyedout}{\coll...@body\@NOTE}{\global 
\...@ignoretrue}

%%  \newcomma...@note[1]{\marginpar{#1}}
%%  \makeatother
%%  \addtolength{\textwidth}{-5cm}



%%  % Variant 2: typeset notes as footnotes. We use the bigfoot package
%%  % to define our own footnote stack for the notes
%%
%%
%%  % The following replaces the default \footnote command by an own
%%  % to ensure that ordinary footnotes are always printed first
%%  \DeclareNewFootnote{A}
%%  \renewcommand{\footnote}{\footnoteA}
%%
%%  % This defines the \footnoteNOTE command for the extra stack.
%%  % greyed out are printed as sans-serif, red colored footnotes
%%  % with captial arabic numbering
%%  \DeclareNewFootnote[para]{NOTE}[Alph]
%%  \renewcommand{\footnoteNOTE}{%
%%\stepcounter{footnoteNOTE}%
%%\textcolor{red}{\Footnotemark\thefootnoteNOTE} \FootnotetextNOTE 
\thefootnoteNOTE}

%%
%%  % redefine the lyxgreyedout environment
%%  \makeatletter
%%  \makeenvironment{lyxgreyedout}{\coll...@body\@NOTE}{\global 
\...@ignoretrue}
%%  \newcomma...@note[1]{\footnotenote{\begin{minipage}[t]{\textwidth} 
{\scriptsize\sffamily{\textcolor{red}{#1}}}\end{minipage}}}

%%  \makeatother

%%   % Variant 3: typset notes with tikz as marginpars
   \usepackage{tikz}
%%   \makeatletter
%%   \makeenvironment{lyxgreyedout}{\coll...@body\todonote}{\global 
\...@ignoretrue}%

%%   \makeatother
%%
%%   \newcommand{\todoNOTE}[1]{%
%% \begin{tikzpicture}[remember picture, baseline=-0.75ex]%
%%   \node [coordinate] (inText) {};%
%% \end{tikzpicture}%
%% \marginpar{%
%%   \begin{sffamily}%
%%   \begin{scriptsize}%
%%   \begin{tikzpicture}[remember picture]%
%% %  \draw node[draw=Orange_4, fill=Orange_4!50, text width =  
3.4cm ] (inNote)
%%   \draw node[draw=Gray_40, fill=Gray_10, text width =  
3.4cm ] (inNote)

%%   {#1};
%%   \end{tikzpicture}%
%%   \end{scriptsize}%
%%   \end{sffamily}%
%% }%
%% \begin{tikzpicture}[remember picture, overlay]%
%%   \draw[draw = Gray_40, thick]
%% %  \draw[draw = Orange_4, thick]
%%   ([yshift=-0.2cm] inText)
%% -| ([xshift=-0.2cm] inNote.west)
%% -| (inNote.west);
%% \end{tikzpicture}%
%%   }%

  % Variant 4: ignore them at all -- for the final print
  \makeenvironment{lyxgreyedout}{}{}


On 13.02.2010, at 19:51, Diego wrote:

Hi, using LyX I'm trying to convert the comments into marginal  
notes.


I tried several things but without luck.

The best shot was like this:

\makeatletter
\...@ifundefined{comment}{}{%
\renewenvironment{comment}[1]%
{\begingroup\marginpar{\bgroup#1\egroup}}%
{\endgroup}}
\makeatother

or like this:

\...@ifundefined{comment}{}{%
\renewenvironment{comment}%
{\marginpar{}%
{}}%

But what I get is only the first character of the text converted.  
Like in the attached image.


I searched a lot trying to find how to solve this but without luck.  
I found the explanation of what is happening here:http://theoval.cmp.uea.ac.uk/~nlct/latex/csed/solutions/fonts.html


Unexpected Output
Only one character is in the new font
You thought you changed font over a selection of text, but only the  
first character has come out in the new font.
You have most probably used a command instead of a declaration. The  
command should take the text as its argument. If you don't group the  
text, only the first character will be passed as the argument.


What I don't know and wasn't able to find is how to group the text.

Hope someone could help me :-)

Many thanks.

Best Regards,
Diego
(diegostex)

Re: Convert "Comment" into "Marginal Note"

2010-02-16 Thread Daniel Lohmann

Hi Diego,

I did something similar for "lyxgreyedout" in my dissertation. The  
caveat is that both., "lyxgreyedout" and "comment" are environments,  
whereas marginpar is a command. So actually you are looking for a  
technique to grab the content of an environment in a way it can be  
passed to a command.


After hours of googling I had found the trick. The amsmath package  
provides  a fairly magic macro called \coll...@body to perform this  
task.


I have added the respective lines from my thesis preamble. I developed  
three variants to typeset the comments, but don't know if the  
marginpar variant ever really worked. The tikz variant was way  
cooler :-)



Have fun,

Daniel

%*
%** handling of notes  

% LyX typesets "greyed out" notes in an LaTeX environment  
"lyxgreyedout". By

% redefinition of this environment, we can control how notes are printed
% out in the PDF.
%
% The \coll...@body (provided by amsmath) trick was taken from
% 
http://groups.google.com/group/comp.text.tex/browse_thread/thread/4cc1379654f40925/2316a38e9912fe23?lnk=st=+%5Ccollect%40body+1995+=1#2316a38e9912fe23
% Basically, it can be used to pass all content of an enviroment to a  
command.


%%   % Variant 1: typeset notes as \marginpar (yet to be completed)
%%  \makeatletter
%%  \renewenvironment{lyxgreyedout}{\coll...@body\@NOTE}{\global 
\...@ignoretrue}

%%  \newcomma...@note[1]{\marginpar{#1}}
%%  \makeatother
%%  \addtolength{\textwidth}{-5cm}



%%  % Variant 2: typeset notes as footnotes. We use the bigfoot package
%%  % to define our own footnote stack for the notes
%%
%%
%%  % The following replaces the default \footnote command by an own
%%  % to ensure that ordinary footnotes are always printed first
%%  \DeclareNewFootnote{A}
%%  \renewcommand{\footnote}{\footnoteA}
%%
%%  % This defines the \footnoteNOTE command for the extra stack.
%%  % "greyed out" are printed as sans-serif, red colored footnotes
%%  % with captial arabic numbering
%%  \DeclareNewFootnote[para]{NOTE}[Alph]
%%  \renewcommand{\footnoteNOTE}{%
%%\stepcounter{footnoteNOTE}%
%%\textcolor{red}{\Footnotemark\thefootnoteNOTE} \FootnotetextNOTE 
\thefootnoteNOTE}

%%
%%  % redefine the lyxgreyedout environment
%%  \makeatletter
%%  \makeenvironment{lyxgreyedout}{\coll...@body\@NOTE}{\global 
\...@ignoretrue}
%%  \newcomma...@note[1]{\footnotenote{\begin{minipage}[t]{\textwidth} 
{\scriptsize\sffamily{\textcolor{red}{#1}}}\end{minipage}}}

%%  \makeatother

%%   % Variant 3: typset notes with tikz as marginpars
   \usepackage{tikz}
%%   \makeatletter
%%   \makeenvironment{lyxgreyedout}{\coll...@body\todonote}{\global 
\...@ignoretrue}%

%%   \makeatother
%%
%%   \newcommand{\todoNOTE}[1]{%
%% \begin{tikzpicture}[remember picture, baseline=-0.75ex]%
%%   \node [coordinate] (inText) {};%
%% \end{tikzpicture}%
%% \marginpar{%
%%   \begin{sffamily}%
%%   \begin{scriptsize}%
%%   \begin{tikzpicture}[remember picture]%
%% %  \draw node[draw=Orange_4, fill=Orange_4!50, text width =  
3.4cm ] (inNote)
%%   \draw node[draw=Gray_40, fill=Gray_10, text width =  
3.4cm ] (inNote)

%%   {#1};
%%   \end{tikzpicture}%
%%   \end{scriptsize}%
%%   \end{sffamily}%
%% }%
%% \begin{tikzpicture}[remember picture, overlay]%
%%   \draw[draw = Gray_40, thick]
%% %  \draw[draw = Orange_4, thick]
%%   ([yshift=-0.2cm] inText)
%% -| ([xshift=-0.2cm] inNote.west)
%% -| (inNote.west);
%% \end{tikzpicture}%
%%   }%

  % Variant 4: ignore them at all -- for the final print
  \makeenvironment{lyxgreyedout}{}{}


On 13.02.2010, at 19:51, Diego wrote:

Hi, using LyX I'm trying to convert the "comments" into "marginal  
notes".


I tried several things but without luck.

The best shot was like this:

\makeatletter
\...@ifundefined{comment}{}{%
\renewenvironment{comment}[1]%
{\begingroup\marginpar{\bgroup#1\egroup}}%
{\endgroup}}
\makeatother

or like this:

\...@ifundefined{comment}{}{%
\renewenvironment{comment}%
{\marginpar{}%
{}}%

But what I get is only the first character of the text converted.  
Like in the attached image.


I searched a lot trying to find how to solve this but without luck.  
I found the explanation of what is happening here:http://theoval.cmp.uea.ac.uk/~nlct/latex/csed/solutions/fonts.html


Unexpected Output
Only one character is in the new font
You thought you changed font over a selection of text, but only the  
first character has come out in the new font.
You have most probably used a command instead of a declaration. The  
command should take the text as its argument. If you don't group the  
text, only the first character will be passed as the argument.


What I don't know and wasn't able to find is how to group the text.

Hope someone could help me :-)

Many thanks.

Best Regards,
Diego

Re: Why this list refuses small zip / 7z archives ?

2010-01-21 Thread Daniel Lohmann
I can recommend DropBox (http://www.dropbox.com) for this purpose.  
They offer 2GB of free space and their software (Linux/Mac/Windows)  
seamlessly integrates this storage into your file system: You just  
copy your files to the local Dropbox/Public folder (via command  
line, Explorer, Finder, or whatsoever), from which it is transparently  
synchronized with the server. Right-clicking on an item gives you the  
option to copy the public URL in the clipboard you can then paste  
into the e-mail.


I have been using it for quite a while under OS X without any  
complaints so far. No spamming/advertising, no service dropouts, and  
really easy to use.


Daniel


On 20.01.2010, at 18:14, Steve Litt wrote:


On Wednesday 20 January 2010 11:37:38 John Coppens wrote:

On Wed, 20 Jan 2010 09:14:18 +0100

Olivier Ripoll durocortorum73-gm...@yahoo.fr wrote:
I'm not planning to attach the images individually, there are more  
than
100 files (including variants and some xcf)! How can I send them  
to the

list. Should I change the extension to pretend it's something else ?


Hi Olivier,

A rather simple solution is using one of the file share sites such as
rapidshare.com, hotfile.com, megaupload.com, upload.to, or one of
many others. For small files, the service is free, and they'll  
delete the

files after some time automatically.

John


Yeah, and that way you don't have to take the time to mess around  
with the
wiki. I'm like you Oliver -- my days are too short to be wikiing  
around just

to distribute a few files.




Re: export pdf only in certain pages

2010-01-21 Thread Daniel Lohmann


On 22.01.2010, at 06:13, Waluyo Adi Siswanto wrote:


Dear All

I am going to export lyx file to pdf, but not all pages.
What I usually do: Fileexportpdf(pdflatex)
but it will export all pages.

Is that possible to chose only at specific pages, for example page 13
to 14 only.


This is not possible directly from within LyX or pdflatex. However,  
you can easily use an external tool to extract the pages you want from  
the final pdf, such as the free pdftk tool kit (pre-installed on most  
Linux distros, easily to get via macports/fink on Mac and most  
probable also available for windows):


(1) Export from lyx to doc.pdf

(2) run the following command in a command shell:

pdftk doc.pdf cat 14-14 output doc-selected-pages.pdf


Daniel


Re: Why this list refuses small zip / 7z archives ?

2010-01-21 Thread Daniel Lohmann
I can recommend DropBox (http://www.dropbox.com) for this purpose.  
They offer 2GB of free space and their software (Linux/Mac/Windows)  
seamlessly integrates this storage into your file system: You just  
copy your files to the local Dropbox/Public folder (via command  
line, Explorer, Finder, or whatsoever), from which it is transparently  
synchronized with the server. Right-clicking on an item gives you the  
option to copy the public URL in the clipboard you can then paste  
into the e-mail.


I have been using it for quite a while under OS X without any  
complaints so far. No spamming/advertising, no service dropouts, and  
really easy to use.


Daniel


On 20.01.2010, at 18:14, Steve Litt wrote:


On Wednesday 20 January 2010 11:37:38 John Coppens wrote:

On Wed, 20 Jan 2010 09:14:18 +0100

Olivier Ripoll durocortorum73-gm...@yahoo.fr wrote:
I'm not planning to attach the images individually, there are more  
than
100 files (including variants and some xcf)! How can I send them  
to the

list. Should I change the extension to pretend it's something else ?


Hi Olivier,

A rather simple solution is using one of the file share sites such as
rapidshare.com, hotfile.com, megaupload.com, upload.to, or one of
many others. For small files, the service is free, and they'll  
delete the

files after some time automatically.

John


Yeah, and that way you don't have to take the time to mess around  
with the
wiki. I'm like you Oliver -- my days are too short to be wikiing  
around just

to distribute a few files.




Re: export pdf only in certain pages

2010-01-21 Thread Daniel Lohmann


On 22.01.2010, at 06:13, Waluyo Adi Siswanto wrote:


Dear All

I am going to export lyx file to pdf, but not all pages.
What I usually do: Fileexportpdf(pdflatex)
but it will export all pages.

Is that possible to chose only at specific pages, for example page 13
to 14 only.


This is not possible directly from within LyX or pdflatex. However,  
you can easily use an external tool to extract the pages you want from  
the final pdf, such as the free pdftk tool kit (pre-installed on most  
Linux distros, easily to get via macports/fink on Mac and most  
probable also available for windows):


(1) Export from lyx to doc.pdf

(2) run the following command in a command shell:

pdftk doc.pdf cat 14-14 output doc-selected-pages.pdf


Daniel


Re: Why this list refuses small zip / 7z archives ?

2010-01-21 Thread Daniel Lohmann
I can recommend DropBox (http://www.dropbox.com) for this purpose.  
They offer 2GB of free space and their software (Linux/Mac/Windows)  
seamlessly integrates this storage into your file system: You just  
copy your files to the local "Dropbox/Public" folder (via command  
line, Explorer, Finder, or whatsoever), from which it is transparently  
synchronized with the server. Right-clicking on an item gives you the  
option to copy the "public URL" in the clipboard you can then paste  
into the e-mail.


I have been using it for quite a while under OS X without any  
complaints so far. No spamming/advertising, no service dropouts, and  
really easy to use.


Daniel


On 20.01.2010, at 18:14, Steve Litt wrote:


On Wednesday 20 January 2010 11:37:38 John Coppens wrote:

On Wed, 20 Jan 2010 09:14:18 +0100

Olivier Ripoll  wrote:
I'm not planning to attach the images individually, there are more  
than
100 files (including variants and some xcf)! How can I send them  
to the

list. Should I change the extension to pretend it's something else ?


Hi Olivier,

A rather simple solution is using one of the file share sites such as
rapidshare.com, hotfile.com, megaupload.com, upload.to, or one of
many others. For small files, the service is free, and they'll  
delete the

files after some time automatically.

John


Yeah, and that way you don't have to take the time to mess around  
with the
wiki. I'm like you Oliver -- my days are too short to be wikiing  
around just

to distribute a few files.




Re: export pdf only in certain pages

2010-01-21 Thread Daniel Lohmann


On 22.01.2010, at 06:13, Waluyo Adi Siswanto wrote:


Dear All

I am going to export lyx file to pdf, but not all pages.
What I usually do: File>export>pdf(pdflatex)
but it will export all pages.

Is that possible to chose only at specific pages, for example page 13
to 14 only.


This is not possible directly from within LyX or pdflatex. However,  
you can easily use an external tool to extract the pages you want from  
the final pdf, such as the free pdftk tool kit (pre-installed on most  
Linux distros, easily to get via macports/fink on Mac and most  
probable also available for windows):


(1) Export from lyx to doc.pdf

(2) run the following command in a command shell:

pdftk doc.pdf cat 14-14 output doc-selected-pages.pdf


Daniel


Re: Table Challenge

2010-01-20 Thread Daniel Lohmann


On 20.01.2010, at 11:25, Steve Sidney wrote:


Rob

Thanks. Although I haven't used the longtable package, I am aware of  
its exsistence.


My report is already some 30 odd pages and if I allow each table to  
take 2 pages it will make it even more bulky.


There seems to be two alternatives.
1) Carry on preparing the table by hand as I currently do and then  
importing it directly into Lyx.

2) Attempt to create the table in R.

Do you think it's worth the effort to do this in R.



Another quick shot idea: Use longtables in combination with multicol  
to let your table break over two columns on the same page.


Don't know if this exactly works, though.

Daniel



Re: Table Challenge

2010-01-20 Thread Daniel Lohmann


On 20.01.2010, at 11:25, Steve Sidney wrote:


Rob

Thanks. Although I haven't used the longtable package, I am aware of  
its exsistence.


My report is already some 30 odd pages and if I allow each table to  
take 2 pages it will make it even more bulky.


There seems to be two alternatives.
1) Carry on preparing the table by hand as I currently do and then  
importing it directly into Lyx.

2) Attempt to create the table in R.

Do you think it's worth the effort to do this in R.



Another quick shot idea: Use longtables in combination with multicol  
to let your table break over two columns on the same page.


Don't know if this exactly works, though.

Daniel



Re: Table Challenge

2010-01-20 Thread Daniel Lohmann


On 20.01.2010, at 11:25, Steve Sidney wrote:


Rob

Thanks. Although I haven't used the longtable package, I am aware of  
its exsistence.


My report is already some 30 odd pages and if I allow each table to  
take 2 pages it will make it even more bulky.


There seems to be two alternatives.
1) Carry on preparing the table by hand as I currently do and then  
importing it directly into Lyx.

2) Attempt to create the table in R.

Do you think it's worth the effort to do this in R.



Another quick shot idea: Use longtables in combination with multicol  
to let your table break over two columns on the same page.


Don't know if this exactly works, though.

Daniel



Re: floats and subfloats with longtables SOLVED

2010-01-14 Thread Daniel Lohmann

Hi Rob,

a clean solution might be possible using the afterpage package.  
Basically it provides the \afterpage{something} command, which  
causes the expansion of something to be postponed until LaTeX has  
shipped out the current page. If you insert your long table this way,  
it should (theoretically) appear on the beginning of the next page  
without interrupting the flow of text on the current page.



Daniel


On 14.01.2010, at 16:20, Rob Oakes wrote:


Hi Helge,

You make good  points, but there is a third use case that I am  
currently struggling with (and which Liviu's solution appears to  
address, at least in part).  What do you do with long tables that  
you don't want to disrupt the flow of the text?


Let me give you an example.  I am currently working on a book about  
writing with open source tools.  One of the chapters in this book is  
an overview of the different LaTeX classes and their options.  For  
some of the classes (like Memoir and Beamer), there are many  
different options that control the appearance of headers, footers  
and chapter headings.  In trying to describe the options, I've found  
that the most space efficient way is to create a long-table.  Some  
of these tables can stretch over two, or sometimes even three pages.


However, I want them to work like floats, in that the table will be  
started at the top of a new page without disrupting the flow of the  
other text.  The current long-table approach doesn't work very well  
in that I have to manually calculate the page breaks and move the  
environment to an appropriate place in the text.  This is similar to  
how I would need to work with Word and is very frustrating.


Are you aware of a method to position long tables so that they  
combine the best featrues of the float environment (e.g. semi- 
automatic displacement so that they don't disrupt the flow of the  
text) and the long-table environment (so that you can have page  
breaks at appropriate places)?


For me, getting the sort of sub-labeling described by Liviu is not  
something I am concerned about.  In fact, I would prefer to maintain  
the standard labeling scheme (Table ChapNum.TableNum).


Cheers,

Rob Oakes





Re: floats and subfloats with longtables SOLVED

2010-01-14 Thread Daniel Lohmann

Hi Rob,

a clean solution might be possible using the afterpage package.  
Basically it provides the \afterpage{something} command, which  
causes the expansion of something to be postponed until LaTeX has  
shipped out the current page. If you insert your long table this way,  
it should (theoretically) appear on the beginning of the next page  
without interrupting the flow of text on the current page.



Daniel


On 14.01.2010, at 16:20, Rob Oakes wrote:


Hi Helge,

You make good  points, but there is a third use case that I am  
currently struggling with (and which Liviu's solution appears to  
address, at least in part).  What do you do with long tables that  
you don't want to disrupt the flow of the text?


Let me give you an example.  I am currently working on a book about  
writing with open source tools.  One of the chapters in this book is  
an overview of the different LaTeX classes and their options.  For  
some of the classes (like Memoir and Beamer), there are many  
different options that control the appearance of headers, footers  
and chapter headings.  In trying to describe the options, I've found  
that the most space efficient way is to create a long-table.  Some  
of these tables can stretch over two, or sometimes even three pages.


However, I want them to work like floats, in that the table will be  
started at the top of a new page without disrupting the flow of the  
other text.  The current long-table approach doesn't work very well  
in that I have to manually calculate the page breaks and move the  
environment to an appropriate place in the text.  This is similar to  
how I would need to work with Word and is very frustrating.


Are you aware of a method to position long tables so that they  
combine the best featrues of the float environment (e.g. semi- 
automatic displacement so that they don't disrupt the flow of the  
text) and the long-table environment (so that you can have page  
breaks at appropriate places)?


For me, getting the sort of sub-labeling described by Liviu is not  
something I am concerned about.  In fact, I would prefer to maintain  
the standard labeling scheme (Table ChapNum.TableNum).


Cheers,

Rob Oakes





Re: floats and subfloats with longtables SOLVED

2010-01-14 Thread Daniel Lohmann

Hi Rob,

a clean solution might be possible using the afterpage package.  
Basically it provides the \afterpage{} command, which  
causes the expansion of  to be postponed until LaTeX has  
shipped out the current page. If you insert your long table this way,  
it should (theoretically) appear on the beginning of the next page  
without interrupting the flow of text on the current page.



Daniel


On 14.01.2010, at 16:20, Rob Oakes wrote:


Hi Helge,

You make good  points, but there is a third use case that I am  
currently struggling with (and which Liviu's solution appears to  
address, at least in part).  What do you do with long tables that  
you don't want to disrupt the flow of the text?


Let me give you an example.  I am currently working on a book about  
writing with open source tools.  One of the chapters in this book is  
an overview of the different LaTeX classes and their options.  For  
some of the classes (like Memoir and Beamer), there are many  
different options that control the appearance of headers, footers  
and chapter headings.  In trying to describe the options, I've found  
that the most space efficient way is to create a long-table.  Some  
of these tables can stretch over two, or sometimes even three pages.


However, I want them to work like floats, in that the table will be  
started at the top of a new page without disrupting the flow of the  
other text.  The current long-table approach doesn't work very well  
in that I have to manually calculate the page breaks and move the  
environment to an appropriate place in the text.  This is similar to  
how I would need to work with Word and is very frustrating.


Are you aware of a method to position long tables so that they  
combine the best featrues of the float environment (e.g. semi- 
automatic displacement so that they don't disrupt the flow of the  
text) and the long-table environment (so that you can have page  
breaks at appropriate places)?


For me, getting the sort of sub-labeling described by Liviu is not  
something I am concerned about.  In fact, I would prefer to maintain  
the standard labeling scheme (Table ChapNum.TableNum).


Cheers,

Rob Oakes





Re: Lining up text and graphics in tables?

2010-01-13 Thread Daniel Lohmann



Thanks Daniel,

Yeah, I tried a minipage containing three minipages just before I  
wrote the

original email. It walked waay off the right side of the page.

Hmmm, but I didn't try the textwidth and hfill. Where would I place  
the
\textwidth, and how would I back it out once all these triples are  
complete?




Hi Steve,

the width of the minipage can be set up in its settings; the hfill can  
be entered in LyX via Insert-Formatting-Horizontal Space  
However, never mind -- the hfill trick works only with two columns,  
for three we need to do something different.


Attached is a LyX file with three minipages in a row. I have set the  
width of each minipage to 0.3\textwidth (30 textwidth% in the LyX  
minpage settings) and inserted a horizontal space of 0.05\textwidth (5  
textwidth%) in between, so the complete row should sum up to 100  
textwidth%.


The spacing has to be done via ERT, as LyX does not allow to enter  
relative dimensions in the Horizontal Space dialog.


It's pretty obvious -- once you have seen it. Well LyX and LaTeX tend  
to be like that :-)


Have fun,

Daniel



3minipages.lyx
Description: Binary data




Re: Lining up text and graphics in tables?

2010-01-13 Thread Daniel Lohmann



Thanks Daniel,

Yeah, I tried a minipage containing three minipages just before I  
wrote the

original email. It walked waay off the right side of the page.

Hmmm, but I didn't try the textwidth and hfill. Where would I place  
the
\textwidth, and how would I back it out once all these triples are  
complete?




Hi Steve,

the width of the minipage can be set up in its settings; the hfill can  
be entered in LyX via Insert-Formatting-Horizontal Space  
However, never mind -- the hfill trick works only with two columns,  
for three we need to do something different.


Attached is a LyX file with three minipages in a row. I have set the  
width of each minipage to 0.3\textwidth (30 textwidth% in the LyX  
minpage settings) and inserted a horizontal space of 0.05\textwidth (5  
textwidth%) in between, so the complete row should sum up to 100  
textwidth%.


The spacing has to be done via ERT, as LyX does not allow to enter  
relative dimensions in the Horizontal Space dialog.


It's pretty obvious -- once you have seen it. Well LyX and LaTeX tend  
to be like that :-)


Have fun,

Daniel



3minipages.lyx
Description: Binary data




Re: Lining up text and graphics in tables?

2010-01-13 Thread Daniel Lohmann



Thanks Daniel,

Yeah, I tried a minipage containing three minipages just before I  
wrote the

original email. It walked waay off the right side of the page.

Hmmm, but I didn't try the textwidth and hfill. Where would I place  
the
\textwidth, and how would I back it out once all these triples are  
complete?




Hi Steve,

the width of the minipage can be set up in its settings; the hfill can  
be entered in LyX via "Insert->Formatting->Horizontal Space...".  
However, never mind -- the "hfill trick" works only with two columns,  
for three we need to do something different.


Attached is a LyX file with three minipages in a row. I have set the  
width of each minipage to 0.3\textwidth (30 textwidth% in the LyX  
minpage settings) and inserted a horizontal space of 0.05\textwidth (5  
textwidth%) in between, so the complete row should sum up to 100  
textwidth%.


The spacing has to be done via ERT, as LyX does not allow to enter  
relative dimensions in the "Horizontal Space" dialog.


It's pretty obvious -- once you have seen it. Well LyX and LaTeX tend  
to be like that :-)


Have fun,

Daniel



3minipages.lyx
Description: Binary data




Re: Lining up text and graphics in tables?

2010-01-12 Thread Daniel Lohmann


On 12.01.2010, at 07:05, Steve Litt wrote:


Ugh!

I wanted rows with 3 columns. Column 1 is the name of the graphic.  
Column 2 is
the graphic itself. Column 3 is a short explanation of the graphic.  
I used
individual 1 row, 3 column tables to save room and make sure pages  
broke

reasonably.

Trouble is, no matter how I set cell alignment in any of the  
columns, the
graphic always rises to the top, and the text (in other columns/ 
cells mind
you) always starts just below where the graphic ends, thereby  
costing a lot of

space, looking ugly, and causing confusion.

Does anyone have an idea how to get the graphic and text to line up  
correctly,
vertically, within their respective cells? Does anyone have any idea  
what

would cause the behavior I describe?


Hi Steve,

have you tried using minipages instead? In my experience they tend to  
be less fragile than tables. I have never tried 3 columns (just 2 so  
far), but that shouldn't matter. Just insert 3 minipages side by side  
with a width of 33% \textwidth and a \hfill in between.


Daniel 


Re: Lining up text and graphics in tables?

2010-01-12 Thread Daniel Lohmann


On 12.01.2010, at 07:05, Steve Litt wrote:


Ugh!

I wanted rows with 3 columns. Column 1 is the name of the graphic.  
Column 2 is
the graphic itself. Column 3 is a short explanation of the graphic.  
I used
individual 1 row, 3 column tables to save room and make sure pages  
broke

reasonably.

Trouble is, no matter how I set cell alignment in any of the  
columns, the
graphic always rises to the top, and the text (in other columns/ 
cells mind
you) always starts just below where the graphic ends, thereby  
costing a lot of

space, looking ugly, and causing confusion.

Does anyone have an idea how to get the graphic and text to line up  
correctly,
vertically, within their respective cells? Does anyone have any idea  
what

would cause the behavior I describe?


Hi Steve,

have you tried using minipages instead? In my experience they tend to  
be less fragile than tables. I have never tried 3 columns (just 2 so  
far), but that shouldn't matter. Just insert 3 minipages side by side  
with a width of 33% \textwidth and a \hfill in between.


Daniel 


Re: Lining up text and graphics in tables?

2010-01-12 Thread Daniel Lohmann


On 12.01.2010, at 07:05, Steve Litt wrote:


Ugh!

I wanted rows with 3 columns. Column 1 is the name of the graphic.  
Column 2 is
the graphic itself. Column 3 is a short explanation of the graphic.  
I used
individual 1 row, 3 column tables to save room and make sure pages  
broke

reasonably.

Trouble is, no matter how I set cell alignment in any of the  
columns, the
graphic always rises to the top, and the text (in other columns/ 
cells mind
you) always starts just below where the graphic ends, thereby  
costing a lot of

space, looking ugly, and causing confusion.

Does anyone have an idea how to get the graphic and text to line up  
correctly,
vertically, within their respective cells? Does anyone have any idea  
what

would cause the behavior I describe?


Hi Steve,

have you tried using minipages instead? In my experience they tend to  
be less fragile than tables. I have never tried 3 columns (just 2 so  
far), but that shouldn't matter. Just insert 3 minipages side by side  
with a width of 33% \textwidth and a \hfill in between.


Daniel 


Re: input preamble with biblatex?

2010-01-06 Thread Daniel Lohmann


On 06.01.2010, at 10:58, Jürgen Spitzmüller wrote:


Guenter Milde wrote:

In older LyX versions, you could choose to compile without temporary
directory. Is this still supported?


I don't think so.


Which is a pity, IMHO.

Not only this would be an easy workaround for all problems related to  
not natively supported external material (and we have many cases for  
that), I also really liked the fact, that I always had the latest PDF  
version of the document at hand without having to explicitly export it  
first.


Daniel

Re: input preamble with biblatex?

2010-01-06 Thread Daniel Lohmann


On 06.01.2010, at 10:58, Jürgen Spitzmüller wrote:


Guenter Milde wrote:

In older LyX versions, you could choose to compile without temporary
directory. Is this still supported?


I don't think so.


Which is a pity, IMHO.

Not only this would be an easy workaround for all problems related to  
not natively supported external material (and we have many cases for  
that), I also really liked the fact, that I always had the latest PDF  
version of the document at hand without having to explicitly export it  
first.


Daniel

Re: input preamble with biblatex?

2010-01-06 Thread Daniel Lohmann


On 06.01.2010, at 10:58, Jürgen Spitzmüller wrote:


Guenter Milde wrote:

In older LyX versions, you could choose to compile without temporary
directory. Is this still supported?


I don't think so.


Which is a pity, IMHO.

Not only this would be an easy workaround for all problems related to  
not natively supported external material (and we have many cases for  
that), I also really liked the fact, that I always had the latest PDF  
version of the document at hand without having to explicitly export it  
first.


Daniel

Re: calender

2010-01-05 Thread Daniel Lohmann


On 29.12.2009, at 19:55, Paul Sutton wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Daniel Lohmann wrote:


The PGF/TikZ package contains a quite decent calendar library. Within
LyX you have to use ERT as it is a LaTeX package, but its relatively
easy to use.

Daniel

Ok thanks

I have found http://www.texample.net/tikz/examples/ to give a few good
examples,  i have pgf installed but do I need to install TikZ as a
separate package, under ubuntu ?

or are they one package.


Hm... usually they are shipped as one package. However, historically  
PGF was first and previous versions of PGF were also shipped with  
latex-beamer (by the same author), so I am not completely sure.


Will have a read of the tutorial and information files.

TikZ comes with an impressive amount of documentation and examples;  
there are several calendar examples in  pgfmanual.pdf.


Daniel


Re: calender

2010-01-05 Thread Daniel Lohmann


On 29.12.2009, at 19:55, Paul Sutton wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Daniel Lohmann wrote:


The PGF/TikZ package contains a quite decent calendar library. Within
LyX you have to use ERT as it is a LaTeX package, but its relatively
easy to use.

Daniel

Ok thanks

I have found http://www.texample.net/tikz/examples/ to give a few good
examples,  i have pgf installed but do I need to install TikZ as a
separate package, under ubuntu ?

or are they one package.


Hm... usually they are shipped as one package. However, historically  
PGF was first and previous versions of PGF were also shipped with  
latex-beamer (by the same author), so I am not completely sure.


Will have a read of the tutorial and information files.

TikZ comes with an impressive amount of documentation and examples;  
there are several calendar examples in  pgfmanual.pdf.


Daniel


Re: calender

2010-01-05 Thread Daniel Lohmann


On 29.12.2009, at 19:55, Paul Sutton wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Daniel Lohmann wrote:


The PGF/TikZ package contains a quite decent calendar library. Within
LyX you have to use ERT as it is a LaTeX package, but its relatively
easy to use.

Daniel

Ok thanks

I have found http://www.texample.net/tikz/examples/ to give a few good
examples,  i have pgf installed but do I need to install TikZ as a
separate package, under ubuntu ?

or are they one package.


Hm... usually they are shipped as one package. However, historically  
PGF was first and previous versions of PGF were also shipped with  
latex-beamer (by the same author), so I am not completely sure.


Will have a read of the tutorial and information files.

TikZ comes with an impressive amount of documentation and examples;  
there are several calendar examples in  pgfmanual.pdf.


Daniel


Re: LyZ: LyX plugin for Zotero

2010-01-02 Thread Daniel Lohmann


On 30.12.2009, at 01:57, Pavel Sanda wrote:


Petr Šimon wrote:
Currently the citation key can be made out of 'author', 'year',  
'title' and
optionally from separators like '_'. I will add another keyword,  
'zotero'

that will create the cite key from unique identifier in zotero db.


yep, this was the main complaint in bug #6300. i expect two usecases -

* users who dont care a about citekeys and just want to externally  
push
 citations and need to keep bitex keys stable. for these zotero ID  
is the way.


* users who care about keys and need the stable bibtex keys too. for  
those
 the customizable citekey is the way. in this case is expecting  
users to

 be intelligent about the keys certainly in order.



Hey Petr,

Thanks for all the hard work on LyZ. I haven't checked out Zotero for  
a while; liked it a lot, but the integration with LyX was odd and it  
tended to corrupt my bibtex databases. However, with LyZ I will give  
it another try.


I just want to put emphasize the importance of customizable citation  
keys! Many of us work in collaborative environments with shared bibtex  
databases and specific home grown requirements on how the keys are  
made up. For instance, in our group this is:
 author:two-digit-year:venue (with venue being an  
abbreviation for the conference or journal the paper appeared.)
In fact, in my group this it has always been the number one argument  
against bibtex frontend XYZ that it does not get the keys right.


Having said that, I would appreciate an even better configurability of  
the key generation. What I would really like is the option to enter an  
advanced formatting string to generate the keys, including besides the  
variables for author, year, etc. various formatting specifiers and  
conditionals, such as:

- number of digits (e.g., use only the two last digits of the year)
- upper case/lower vase (very important, unfortunately very few tools  
support this)
- conditionals (e.g., @book entries do not have a venue; URLs do not  
have a year and the venue is 'site')

- ...

Another important point in which most, if not all, bibtex frontends  
fail miserably is the requirement to be minimally invasive on the  
bibtex database. Some collaborators still prefer editing the database  
with a text editor. What I expect from  a good frontend is that it  
leaves all entries alone in the file that have not been modified in  
the current session,  including formatting, LaTeX comment lines  
beginning with %, and so on. Basically, if I use your tool to add or  
edit an entry 'foobar' and update the bibtex file underneath, the the  
diff to the previous version of the bibtex file should contain only  
lines that are related to the 'foobar' entry.


Just my 2 items on the long-term wish list :-)

Daniel



Re: LyZ: LyX plugin for Zotero

2010-01-02 Thread Daniel Lohmann


On 30.12.2009, at 01:57, Pavel Sanda wrote:


Petr Šimon wrote:
Currently the citation key can be made out of 'author', 'year',  
'title' and
optionally from separators like '_'. I will add another keyword,  
'zotero'

that will create the cite key from unique identifier in zotero db.


yep, this was the main complaint in bug #6300. i expect two usecases -

* users who dont care a about citekeys and just want to externally  
push
 citations and need to keep bitex keys stable. for these zotero ID  
is the way.


* users who care about keys and need the stable bibtex keys too. for  
those
 the customizable citekey is the way. in this case is expecting  
users to

 be intelligent about the keys certainly in order.



Hey Petr,

Thanks for all the hard work on LyZ. I haven't checked out Zotero for  
a while; liked it a lot, but the integration with LyX was odd and it  
tended to corrupt my bibtex databases. However, with LyZ I will give  
it another try.


I just want to put emphasize the importance of customizable citation  
keys! Many of us work in collaborative environments with shared bibtex  
databases and specific home grown requirements on how the keys are  
made up. For instance, in our group this is:
 author:two-digit-year:venue (with venue being an  
abbreviation for the conference or journal the paper appeared.)
In fact, in my group this it has always been the number one argument  
against bibtex frontend XYZ that it does not get the keys right.


Having said that, I would appreciate an even better configurability of  
the key generation. What I would really like is the option to enter an  
advanced formatting string to generate the keys, including besides the  
variables for author, year, etc. various formatting specifiers and  
conditionals, such as:

- number of digits (e.g., use only the two last digits of the year)
- upper case/lower vase (very important, unfortunately very few tools  
support this)
- conditionals (e.g., @book entries do not have a venue; URLs do not  
have a year and the venue is 'site')

- ...

Another important point in which most, if not all, bibtex frontends  
fail miserably is the requirement to be minimally invasive on the  
bibtex database. Some collaborators still prefer editing the database  
with a text editor. What I expect from  a good frontend is that it  
leaves all entries alone in the file that have not been modified in  
the current session,  including formatting, LaTeX comment lines  
beginning with %, and so on. Basically, if I use your tool to add or  
edit an entry 'foobar' and update the bibtex file underneath, the the  
diff to the previous version of the bibtex file should contain only  
lines that are related to the 'foobar' entry.


Just my 2 items on the long-term wish list :-)

Daniel



Re: LyZ: LyX plugin for Zotero

2010-01-02 Thread Daniel Lohmann


On 30.12.2009, at 01:57, Pavel Sanda wrote:


Petr Šimon wrote:
Currently the citation key can be made out of 'author', 'year',  
'title' and
optionally from separators like '_'. I will add another keyword,  
'zotero'

that will create the cite key from unique identifier in zotero db.


yep, this was the main complaint in bug #6300. i expect two usecases -

* users who dont care a about citekeys and just want to externally  
push
 citations and need to keep bitex keys stable. for these zotero ID  
is the way.


* users who care about keys and need the stable bibtex keys too. for  
those
 the "customizable" citekey is the way. in this case is expecting  
users to

 be intelligent about the keys certainly in order.



Hey Petr,

Thanks for all the hard work on LyZ. I haven't checked out Zotero for  
a while; liked it a lot, but the integration with LyX was odd and it  
tended to corrupt my bibtex databases. However, with LyZ I will give  
it another try.


I just want to put emphasize the importance of customizable citation  
keys! Many of us work in collaborative environments with shared bibtex  
databases and specific "home grown" requirements on how the keys are  
made up. For instance, in our group this is:
 :: (with  being an  
abbreviation for the conference or journal the paper appeared.)
In fact, in my group this it has always been the number one argument  
against bibtex frontend XYZ that it does not get the keys right.


Having said that, I would appreciate an even better configurability of  
the key generation. What I would really like is the option to enter an  
advanced formatting string to generate the keys, including besides the  
variables for author, year, etc. various formatting specifiers and  
conditionals, such as:

- number of digits (e.g., use only the two last digits of the year)
- upper case/lower vase (very important, unfortunately very few tools  
support this)
- conditionals (e.g., @book entries do not have a ; URLs do not  
have a year and the  is 'site')

- ...

Another important point in which most, if not all, bibtex frontends  
fail miserably is the requirement to be "minimally invasive" on the  
bibtex database. Some collaborators still prefer editing the database  
with a text editor. What I expect from  a good frontend is that it  
leaves all entries alone in the file that have not been modified in  
the current session,  including formatting, LaTeX comment lines  
beginning with %, and so on. Basically, if I use your tool to add or  
edit an entry 'foobar' and update the bibtex file underneath, the the  
diff to the previous version of the bibtex file should contain only  
lines that are related to the 'foobar' entry.


Just my 2 items on the long-term wish list :-)

Daniel



Re: calender

2009-12-29 Thread Daniel Lohmann


On 27.12.2009, at 00:41, Steve Litt wrote:


On Saturday 26 December 2009 18:02:09 Paul Sutton wrote:

Hi

Is it possible to produce a calender in LyX, I am looking for some  
sort

of plug in or style to do it.

thanks

Paul



I'm sure it's possible, probably with a series of tables, one for  
each month.


But I can sure see a lot of easier tools to use for a calender,  
especially if

you know a little bit of scripting language programming.


The PGF/TikZ package contains a quite decent calendar library. Within  
LyX you have to use ERT as it is a LaTeX package, but its relatively  
easy to use.


Daniel


Re: calender

2009-12-29 Thread Daniel Lohmann


On 27.12.2009, at 00:41, Steve Litt wrote:


On Saturday 26 December 2009 18:02:09 Paul Sutton wrote:

Hi

Is it possible to produce a calender in LyX, I am looking for some  
sort

of plug in or style to do it.

thanks

Paul



I'm sure it's possible, probably with a series of tables, one for  
each month.


But I can sure see a lot of easier tools to use for a calender,  
especially if

you know a little bit of scripting language programming.


The PGF/TikZ package contains a quite decent calendar library. Within  
LyX you have to use ERT as it is a LaTeX package, but its relatively  
easy to use.


Daniel


Re: calender

2009-12-29 Thread Daniel Lohmann


On 27.12.2009, at 00:41, Steve Litt wrote:


On Saturday 26 December 2009 18:02:09 Paul Sutton wrote:

Hi

Is it possible to produce a calender in LyX, I am looking for some  
sort

of plug in or style to do it.

thanks

Paul



I'm sure it's possible, probably with a series of tables, one for  
each month.


But I can sure see a lot of easier tools to use for a calender,  
especially if

you know a little bit of scripting language programming.


The PGF/TikZ package contains a quite decent calendar library. Within  
LyX you have to use ERT as it is a LaTeX package, but its relatively  
easy to use.


Daniel


Re: Option Clash with hyperref

2009-09-11 Thread Daniel Lohmann


On 10.09.2009, at 22:58, Rob wrote:


Hi,

I want to use backref, but I'm getting an options clash.  I read in  
a past post
that there is some mess when trying to specify the options in  
hyperref since
they're already set but that a work around is to add a \hyperset  
argument to the

preamble.  In this case, I tried the following without any success:

\hyperset{pagebackref=yes}


AFAIK the backref options cannot be set by \hyperset, but have to be  
passed when hyperref is loaded.


Daniel


Re: Option Clash with hyperref

2009-09-11 Thread Daniel Lohmann


On 10.09.2009, at 22:58, Rob wrote:


Hi,

I want to use backref, but I'm getting an options clash.  I read in  
a past post
that there is some mess when trying to specify the options in  
hyperref since
they're already set but that a work around is to add a \hyperset  
argument to the

preamble.  In this case, I tried the following without any success:

\hyperset{pagebackref=yes}


AFAIK the backref options cannot be set by \hyperset, but have to be  
passed when hyperref is loaded.


Daniel


Re: Option Clash with hyperref

2009-09-11 Thread Daniel Lohmann


On 10.09.2009, at 22:58, Rob wrote:


Hi,

I want to use backref, but I'm getting an options clash.  I read in  
a past post
that there is some mess when trying to specify the options in  
hyperref since
they're already set but that a work around is to add a \hyperset  
argument to the

preamble.  In this case, I tried the following without any success:

\hyperset{pagebackref=yes}


AFAIK the backref options cannot be set by \hyperset, but have to be  
passed when hyperref is loaded.


Daniel


Re: How to get a preview for custom graphics format?

2009-08-25 Thread Daniel Lohmann


On 14.08.2009, at 15:56, Pavel Sanda wrote:


Daniel Lohmann wrote:
Or am I mistaken here? I am still seeking for a definite answer  
regarding
the conversion route that to my understanding is automatically  
deduced by
LyX (TiKZ -- PDF | PDF -- Preview). It seem that (newer?)  
versions of LyX
just pass everything right through to ImageMagik and do not bother  
with

deducing a conversion route?


without looking into the code, creating tikz-png convertor wont help?
pavel


Just to close this thread:

Defining an additional tikz-png converter does indeed solve the  
problem. Another possible solution is to extend the convertDefault.py  
script to recognize TikZ: as input format. For convenience reasons,  
this is the route I have been taking.



If others would like to try this:  Here are the step-by-step  
instructions:


-- Under [File Handling -- File formats] add a new file format TikZ  
as Vector graphics format,Short Name: Tikz, Extension: tikz,  
and Editor: vim.


-- Under [File Handling -- Converters] add a Converter Definition  
TikZ -- PDF (ps2pdf)with Converter: pdflatex - 
interaction=nonstopmode $$i


-- Replace the convertDefault.py script by the attached version.

Disclaimer: This are my very first lines of Python code!

Note: According to the docs, it should be enough to put the customized  
version of convertDefault.py into $LYXUSER/scripts (~/Library/ 
Application Support/Lyx-1.x on the Mac). However, on my system (Mac OS  
X, LyX 1.6.3) it seems to remain unrecognized in this position, so I  
ended up with replacing the default version.



Daniel



#!/usr/bin/env python
# -*- coding: utf-8 -*-

# file convertDefault.py
# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.

# \author Herbert Voß
# \author Bo Peng

# Full author contact details are available in file CREDITS.

# The default converter if no other has been defined by the user from the
# Conversion-Converter tab of the Preferences dialog.

# The user can also redefine this default converter, placing their
# replacement in ~/.lyx/scripts

# converts an image from $1 to $2 format
import os, re, sys

# We may need some extra options only supported by recent convert versions
re_version = re.compile(r'^Version:.*ImageMagick\s*(\d*)\.(\d*)\.(\d*).*$')
fout = os.popen('convert -version 21')
output = fout.readline()
fout.close()
version = re_version.match(output)
major = int(version.group(1))
minor = int(version.group(2))
patch = int(version.group(3))
version = hex(major * 65536 + minor * 256 + patch)

opts = -depth 8

# DL: If input format is TikZ convert it to pdf first by calling pdflatex 
# then use the generated pdf as input to ImageMagik's convert
if sys.argv[1][:5].lower() == 'tikz:':
if os.system(r'pdflatex -interaction=nonstopmode %s' % (sys.argv[1][5:])) != 0:
print  sys.stderr, sys.argv[0], 'ERROR'
print  sys.stderr, 'Execution of pdflatex failed.'
sys.exit(1)

# Now use the generated pdf as input format.
sys.argv[1] = pdf:+sys.argv[1][5:-4]+pdf

# If supported, add the -define option for pdf source formats 
if sys.argv[1][:4] == 'pdf:' and version = 0x060206:
opts = '-define pdf:use-cropbox=true ' + opts

# If supported, add the -flatten option for ppm target formats (see bug 4749)
if sys.argv[2][:4] == 'ppm:' and version = 0x060305:
opts = opts + ' -flatten'

if os.system(r'convert %s %s %s' % (opts, sys.argv[1], sys.argv[2])) != 0:
print  sys.stderr, sys.argv[0], 'ERROR'
print  sys.stderr, 'Execution of convert failed.'
sys.exit(1)






Re: How to get a preview for custom graphics format?

2009-08-25 Thread Daniel Lohmann


On 14.08.2009, at 15:56, Pavel Sanda wrote:


Daniel Lohmann wrote:
Or am I mistaken here? I am still seeking for a definite answer  
regarding
the conversion route that to my understanding is automatically  
deduced by
LyX (TiKZ -- PDF | PDF -- Preview). It seem that (newer?)  
versions of LyX
just pass everything right through to ImageMagik and do not bother  
with

deducing a conversion route?


without looking into the code, creating tikz-png convertor wont help?
pavel


Just to close this thread:

Defining an additional tikz-png converter does indeed solve the  
problem. Another possible solution is to extend the convertDefault.py  
script to recognize TikZ: as input format. For convenience reasons,  
this is the route I have been taking.



If others would like to try this:  Here are the step-by-step  
instructions:


-- Under [File Handling -- File formats] add a new file format TikZ  
as Vector graphics format,Short Name: Tikz, Extension: tikz,  
and Editor: vim.


-- Under [File Handling -- Converters] add a Converter Definition  
TikZ -- PDF (ps2pdf)with Converter: pdflatex - 
interaction=nonstopmode $$i


-- Replace the convertDefault.py script by the attached version.

Disclaimer: This are my very first lines of Python code!

Note: According to the docs, it should be enough to put the customized  
version of convertDefault.py into $LYXUSER/scripts (~/Library/ 
Application Support/Lyx-1.x on the Mac). However, on my system (Mac OS  
X, LyX 1.6.3) it seems to remain unrecognized in this position, so I  
ended up with replacing the default version.



Daniel



#!/usr/bin/env python
# -*- coding: utf-8 -*-

# file convertDefault.py
# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.

# \author Herbert Voß
# \author Bo Peng

# Full author contact details are available in file CREDITS.

# The default converter if no other has been defined by the user from the
# Conversion-Converter tab of the Preferences dialog.

# The user can also redefine this default converter, placing their
# replacement in ~/.lyx/scripts

# converts an image from $1 to $2 format
import os, re, sys

# We may need some extra options only supported by recent convert versions
re_version = re.compile(r'^Version:.*ImageMagick\s*(\d*)\.(\d*)\.(\d*).*$')
fout = os.popen('convert -version 21')
output = fout.readline()
fout.close()
version = re_version.match(output)
major = int(version.group(1))
minor = int(version.group(2))
patch = int(version.group(3))
version = hex(major * 65536 + minor * 256 + patch)

opts = -depth 8

# DL: If input format is TikZ convert it to pdf first by calling pdflatex 
# then use the generated pdf as input to ImageMagik's convert
if sys.argv[1][:5].lower() == 'tikz:':
if os.system(r'pdflatex -interaction=nonstopmode %s' % (sys.argv[1][5:])) != 0:
print  sys.stderr, sys.argv[0], 'ERROR'
print  sys.stderr, 'Execution of pdflatex failed.'
sys.exit(1)

# Now use the generated pdf as input format.
sys.argv[1] = pdf:+sys.argv[1][5:-4]+pdf

# If supported, add the -define option for pdf source formats 
if sys.argv[1][:4] == 'pdf:' and version = 0x060206:
opts = '-define pdf:use-cropbox=true ' + opts

# If supported, add the -flatten option for ppm target formats (see bug 4749)
if sys.argv[2][:4] == 'ppm:' and version = 0x060305:
opts = opts + ' -flatten'

if os.system(r'convert %s %s %s' % (opts, sys.argv[1], sys.argv[2])) != 0:
print  sys.stderr, sys.argv[0], 'ERROR'
print  sys.stderr, 'Execution of convert failed.'
sys.exit(1)






Re: How to get a preview for "custom" graphics format?

2009-08-25 Thread Daniel Lohmann


On 14.08.2009, at 15:56, Pavel Sanda wrote:


Daniel Lohmann wrote:
Or am I mistaken here? I am still seeking for a definite answer  
regarding
the conversion route that to my understanding is automatically  
deduced by
LyX (TiKZ --> PDF | PDF --> Preview). It seem that (newer?)  
versions of LyX
just pass everything right through to ImageMagik and do not bother  
with

deducing a conversion route?


without looking into the code, creating tikz->png convertor wont help?
pavel


Just to close this thread:

Defining an additional tikz->png converter does indeed solve the  
problem. Another possible solution is to extend the convertDefault.py  
script to recognize "TikZ:" as input format. For convenience reasons,  
this is the route I have been taking.



If others would like to try this:  Here are the step-by-step  
instructions:


-- Under [File Handling --> File formats] add a new file format "TikZ"  
as Vector graphics format,Short Name: "Tikz", Extension: "tikz",  
and Editor: "vim".


-- Under [File Handling --> Converters] add a Converter Definition  
"TikZ --> PDF (ps2pdf)"with Converter: "pdflatex - 
interaction=nonstopmode $$i"


-- Replace the convertDefault.py script by the attached version.

Disclaimer: This are my very first lines of Python code!

Note: According to the docs, it should be enough to put the customized  
version of convertDefault.py into $LYXUSER/scripts (~/Library/ 
Application Support/Lyx-1.x on the Mac). However, on my system (Mac OS  
X, LyX 1.6.3) it seems to remain unrecognized in this position, so I  
ended up with replacing the default version.



Daniel



#!/usr/bin/env python
# -*- coding: utf-8 -*-

# file convertDefault.py
# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.

# \author Herbert Voß
# \author Bo Peng

# Full author contact details are available in file CREDITS.

# The default converter if no other has been defined by the user from the
# Conversion->Converter tab of the Preferences dialog.

# The user can also redefine this default converter, placing their
# replacement in ~/.lyx/scripts

# converts an image from $1 to $2 format
import os, re, sys

# We may need some extra options only supported by recent convert versions
re_version = re.compile(r'^Version:.*ImageMagick\s*(\d*)\.(\d*)\.(\d*).*$')
fout = os.popen('convert -version 2>&1')
output = fout.readline()
fout.close()
version = re_version.match(output)
major = int(version.group(1))
minor = int(version.group(2))
patch = int(version.group(3))
version = hex(major * 65536 + minor * 256 + patch)

opts = "-depth 8"

# DL: If input format is "TikZ" convert it to pdf first by calling pdflatex 
# then use the generated pdf as input to ImageMagik's convert
if sys.argv[1][:5].lower() == 'tikz:':
if os.system(r'pdflatex -interaction=nonstopmode "%s"' % (sys.argv[1][5:])) != 0:
print >> sys.stderr, sys.argv[0], 'ERROR'
print >> sys.stderr, 'Execution of "pdflatex" failed.'
sys.exit(1)

# Now use the generated pdf as input format.
sys.argv[1] = "pdf:"+sys.argv[1][5:-4]+"pdf"

# If supported, add the -define option for pdf source formats 
if sys.argv[1][:4] == 'pdf:' and version >= 0x060206:
opts = '-define pdf:use-cropbox=true ' + opts

# If supported, add the -flatten option for ppm target formats (see bug 4749)
if sys.argv[2][:4] == 'ppm:' and version >= 0x060305:
opts = opts + ' -flatten'

if os.system(r'convert %s "%s" "%s"' % (opts, sys.argv[1], sys.argv[2])) != 0:
print >> sys.stderr, sys.argv[0], 'ERROR'
print >> sys.stderr, 'Execution of "convert" failed.'
sys.exit(1)






Re: How to embed a spreadsheet in LyX or LaTeX?

2009-08-13 Thread Daniel Lohmann


On 11.08.2009, at 23:48, Phil wrote:



You might also try excel2latex




I can also recommend excel2latex. I used it quite a lot when I was  
writing my thesis. The nice thing about it is that it also preserves a  
sensible part of the formattings (e.g., bold headlines, right aligned  
data, ...). The following process worked pretty well for me:


(1) Open an empty, but compilable LaTeX document (ou may export an  
empty LyX document to LaTeX to get one) in your favorite text editor.


(2) Use excel2latex  to copy the marked part of the Excel table as  
LaTeX code into the clipboard.


(3) Paste the table into the LaTeX document and save the document.

(4) Import the LaTeX document into LyX.

(5) Copy the table from the imported LyX document into the target  
document.



Daniel


Re: How to get a preview for custom graphics format?

2009-08-13 Thread Daniel Lohmann


On 13.08.2009, at 06:47, Paul Johnson wrote:


On Fri, Aug 7, 2009 at 9:52 AM, Daniel
Lohmanndaniel.lohm...@informatik.uni-erlangen.de wrote:

Hi,



So here is what I want to achieve:

I have some TikZ figures (which are actually stand-alone LaTeX- 
documents
with the extension .tikz) that I want to embed (not the source, but  
the
PDF/EPS via \includegraphics) into my LyX document in a way that  
(1) the
LyX-Preview does work (2) PDF generation does work, and (3)  
the .tikz-file

is opened in vim when I select Edit externally...


I am sorry if I am telling you something you already know, but...

It seems to me you are throwing away the value of TikZ by doing this.




Recall that one of the strengths of TikZ/pgf is that the fonts and
such in the figure will match the document. If you persist in keeping
the TikZ as stand alone latex documents, you are destroying that
possibility.
I don't think the document will ever compile because of
the duplicate preambles and such that the latex system encounters.
On the  other hand, if the TikZ file is just the TikZ figure, then I'd
be more optimistic.

But I don't think it is wise to convert the tikz to pdf and embed that
with includegraphics.
Rather, I think you just want to include the tikz code itself. You can
just use input on the TikZ figure itself. If you put that inside a LyX
floating graphic or a minipage, it just works in the final
processing. In Lyx, choose Insert File Child Document and then
choose your tikz text file.  As long as it is just the figure, it is
all good. I've just tested it, and it does work.

But you won't get an in-document preview in LyX without a  bit of
messing about.  I think that's where the other guy who refers you to
the Dia code has a good idea.  I've tried to figure that part out, but
no solution yet. We need a way to tell LyX to pass the Tikz figure
code straight through to LaTeX, but we also want an on-screen preview
of what that will be like.  But it is inherently impossible to get a
preview of what that will be like without compiling the whole
document.  A conundrum for me.


Paul,

Your comments are very valid, but I intentionally want to have the  
possibility to compile the TikZ-figures externally and embedd them as  
PDF:


- TikZ can increase compilation times *dramatically*. If you embed  
dozens of nontrivial TikZ figures as code into your document,  
compilation of your LyX document may take minutes instead of seconds.
- During the development of the TikZ figures (a time-consuming process  
of its own) I need to compile and debug them stand alone with short  
roundtrip times.

- PDF images are much easier to scale (to, e.g, pagewidth)
- Regarding the font (and styles and colors...) issue: I solve it by  
setting that up in a common preamble that is \input'ed into the LyX  
document and the TikZ figures. However, on some (rare) occasions I  
*want* to have different fonts in the figure than in the document.  
This, again, is easy to achieve via the PDF route, but requires quite  
same hacking if the figure is embedded into the source.


In fact, I can imagine only one situation I would prefer embedding  
TikZ figures by source: If they contain references into other parts  
of  the document (such as clicking on a TikZ node should bring you to  
page 212 or you refer to some bibliography item within the figure).


Daniel


Re: How to get a preview for custom graphics format?

2009-08-13 Thread Daniel Lohmann


On 12.08.2009, at 09:53, Guenter Milde wrote:


On 2009-08-11, Pavel Sanda wrote:

Daniel Lohmann wrote:
that mean that it is *not possible* to achieve goal (1) (the  
preview in

LyX, everything else works) via file formats and converters only?



unless imagemagick convert utility knows how to deal with it (i think
it doesn't) i'm not aware of such a plain route.


As the tkiz - PDF (ps2pdf) conversion seems to work, the problem  
should be

solvable with a definition for PDF (ps2pdf) - PNG.



I think I am going to try this. The point is that I still do not  
understand why this possibly could help!


- As far as I understand PDF (ps2pdf) is just the default PDF- 
Format (pdf1).
- LyX is able to create previews from files in this format  
automagically.


Or am I mistaken here? I am still seeking for a definite answer  
regarding the conversion route that to my understanding is  
automatically deduced by LyX (TiKZ -- PDF | PDF -- Preview). It seem  
that (newer?) versions of LyX just pass everything right through to  
ImageMagik and do not bother with deducing a conversion route?


Daniel


Re: How to get a preview for custom graphics format?

2009-08-13 Thread Daniel Lohmann


On 13.08.2009, at 11:22, Pavel Sanda wrote:


Jürgen Spitzmüller wrote:

Pavel Sanda wrote:
- to make a python script which would take the parent document  
dumps the
preamble, then inputs tikz, latex it and returns figure for both  
preview

and output.


Here is such a python script (although it is a bit too UNIX-centric):
http://kogs-www.informatik.uni-hamburg.de/~meine/tikz/process/


in a case some of the intersted people write and test the external  
template

we could include it with this script in a proper lyx release.


The real problem is to get the preamble right. Because TikZ is a huge  
package that has a noticeable impact on LaTeX compilation times (and  
memory consumption), it is pretty well modularized into multiple  
libraries. A typical preamble for a TikZ figure looks as follows:


\usepackage{tikz}
\usetikzlibrary{fit,positioning,shapes,shapes.multipart, depends on  
what you actually use in the figure}


With the external-template mechanism, as far as I understand it, the  
additional stuff for the preamble can only be hard-code in the  
template and not be examined (e.g. by invoking some script) for the  
actual TikZ figures to embed.



Daniel 

Re: How to embed a spreadsheet in LyX or LaTeX?

2009-08-13 Thread Daniel Lohmann


On 11.08.2009, at 23:48, Phil wrote:



You might also try excel2latex




I can also recommend excel2latex. I used it quite a lot when I was  
writing my thesis. The nice thing about it is that it also preserves a  
sensible part of the formattings (e.g., bold headlines, right aligned  
data, ...). The following process worked pretty well for me:


(1) Open an empty, but compilable LaTeX document (ou may export an  
empty LyX document to LaTeX to get one) in your favorite text editor.


(2) Use excel2latex  to copy the marked part of the Excel table as  
LaTeX code into the clipboard.


(3) Paste the table into the LaTeX document and save the document.

(4) Import the LaTeX document into LyX.

(5) Copy the table from the imported LyX document into the target  
document.



Daniel


Re: How to get a preview for custom graphics format?

2009-08-13 Thread Daniel Lohmann


On 13.08.2009, at 06:47, Paul Johnson wrote:


On Fri, Aug 7, 2009 at 9:52 AM, Daniel
Lohmanndaniel.lohm...@informatik.uni-erlangen.de wrote:

Hi,



So here is what I want to achieve:

I have some TikZ figures (which are actually stand-alone LaTeX- 
documents
with the extension .tikz) that I want to embed (not the source, but  
the
PDF/EPS via \includegraphics) into my LyX document in a way that  
(1) the
LyX-Preview does work (2) PDF generation does work, and (3)  
the .tikz-file

is opened in vim when I select Edit externally...


I am sorry if I am telling you something you already know, but...

It seems to me you are throwing away the value of TikZ by doing this.




Recall that one of the strengths of TikZ/pgf is that the fonts and
such in the figure will match the document. If you persist in keeping
the TikZ as stand alone latex documents, you are destroying that
possibility.
I don't think the document will ever compile because of
the duplicate preambles and such that the latex system encounters.
On the  other hand, if the TikZ file is just the TikZ figure, then I'd
be more optimistic.

But I don't think it is wise to convert the tikz to pdf and embed that
with includegraphics.
Rather, I think you just want to include the tikz code itself. You can
just use input on the TikZ figure itself. If you put that inside a LyX
floating graphic or a minipage, it just works in the final
processing. In Lyx, choose Insert File Child Document and then
choose your tikz text file.  As long as it is just the figure, it is
all good. I've just tested it, and it does work.

But you won't get an in-document preview in LyX without a  bit of
messing about.  I think that's where the other guy who refers you to
the Dia code has a good idea.  I've tried to figure that part out, but
no solution yet. We need a way to tell LyX to pass the Tikz figure
code straight through to LaTeX, but we also want an on-screen preview
of what that will be like.  But it is inherently impossible to get a
preview of what that will be like without compiling the whole
document.  A conundrum for me.


Paul,

Your comments are very valid, but I intentionally want to have the  
possibility to compile the TikZ-figures externally and embedd them as  
PDF:


- TikZ can increase compilation times *dramatically*. If you embed  
dozens of nontrivial TikZ figures as code into your document,  
compilation of your LyX document may take minutes instead of seconds.
- During the development of the TikZ figures (a time-consuming process  
of its own) I need to compile and debug them stand alone with short  
roundtrip times.

- PDF images are much easier to scale (to, e.g, pagewidth)
- Regarding the font (and styles and colors...) issue: I solve it by  
setting that up in a common preamble that is \input'ed into the LyX  
document and the TikZ figures. However, on some (rare) occasions I  
*want* to have different fonts in the figure than in the document.  
This, again, is easy to achieve via the PDF route, but requires quite  
same hacking if the figure is embedded into the source.


In fact, I can imagine only one situation I would prefer embedding  
TikZ figures by source: If they contain references into other parts  
of  the document (such as clicking on a TikZ node should bring you to  
page 212 or you refer to some bibliography item within the figure).


Daniel


Re: How to get a preview for custom graphics format?

2009-08-13 Thread Daniel Lohmann


On 12.08.2009, at 09:53, Guenter Milde wrote:


On 2009-08-11, Pavel Sanda wrote:

Daniel Lohmann wrote:
that mean that it is *not possible* to achieve goal (1) (the  
preview in

LyX, everything else works) via file formats and converters only?



unless imagemagick convert utility knows how to deal with it (i think
it doesn't) i'm not aware of such a plain route.


As the tkiz - PDF (ps2pdf) conversion seems to work, the problem  
should be

solvable with a definition for PDF (ps2pdf) - PNG.



I think I am going to try this. The point is that I still do not  
understand why this possibly could help!


- As far as I understand PDF (ps2pdf) is just the default PDF- 
Format (pdf1).
- LyX is able to create previews from files in this format  
automagically.


Or am I mistaken here? I am still seeking for a definite answer  
regarding the conversion route that to my understanding is  
automatically deduced by LyX (TiKZ -- PDF | PDF -- Preview). It seem  
that (newer?) versions of LyX just pass everything right through to  
ImageMagik and do not bother with deducing a conversion route?


Daniel


Re: How to get a preview for custom graphics format?

2009-08-13 Thread Daniel Lohmann


On 13.08.2009, at 11:22, Pavel Sanda wrote:


Jürgen Spitzmüller wrote:

Pavel Sanda wrote:
- to make a python script which would take the parent document  
dumps the
preamble, then inputs tikz, latex it and returns figure for both  
preview

and output.


Here is such a python script (although it is a bit too UNIX-centric):
http://kogs-www.informatik.uni-hamburg.de/~meine/tikz/process/


in a case some of the intersted people write and test the external  
template

we could include it with this script in a proper lyx release.


The real problem is to get the preamble right. Because TikZ is a huge  
package that has a noticeable impact on LaTeX compilation times (and  
memory consumption), it is pretty well modularized into multiple  
libraries. A typical preamble for a TikZ figure looks as follows:


\usepackage{tikz}
\usetikzlibrary{fit,positioning,shapes,shapes.multipart, depends on  
what you actually use in the figure}


With the external-template mechanism, as far as I understand it, the  
additional stuff for the preamble can only be hard-code in the  
template and not be examined (e.g. by invoking some script) for the  
actual TikZ figures to embed.



Daniel 

Re: How to embed a spreadsheet in LyX or LaTeX?

2009-08-13 Thread Daniel Lohmann


On 11.08.2009, at 23:48, Phil wrote:



You might also try excel2latex




I can also recommend excel2latex. I used it quite a lot when I was  
writing my thesis. The nice thing about it is that it also preserves a  
sensible part of the formattings (e.g., bold headlines, right aligned  
data, ...). The following process worked pretty well for me:


(1) Open an empty, but compilable LaTeX document (ou may export an  
empty LyX document to LaTeX to get one) in your favorite text editor.


(2) Use excel2latex  to copy the marked part of the Excel table as  
LaTeX code into the clipboard.


(3) Paste the table into the LaTeX document and save the document.

(4) Import the LaTeX document into LyX.

(5) Copy the table from the imported LyX document into the target  
document.



Daniel


Re: How to get a preview for "custom" graphics format?

2009-08-13 Thread Daniel Lohmann


On 13.08.2009, at 06:47, Paul Johnson wrote:


On Fri, Aug 7, 2009 at 9:52 AM, Daniel
Lohmann<daniel.lohm...@informatik.uni-erlangen.de> wrote:

Hi,



So here is what I want to achieve:

I have some TikZ figures (which are actually stand-alone LaTeX- 
documents
with the extension .tikz) that I want to embed (not the source, but  
the
PDF/EPS via \includegraphics) into my LyX document in a way that  
(1) the
LyX-Preview does work (2) PDF generation does work, and (3)  
the .tikz-file

is opened in vim when I select "Edit externally..."


I am sorry if I am telling you something you already know, but...

It seems to me you are throwing away the value of TikZ by doing this.




Recall that one of the strengths of TikZ/pgf is that the fonts and
such in the figure will match the document. If you persist in keeping
the TikZ as stand alone latex documents, you are destroying that
possibility.
I don't think the document will ever compile because of
the duplicate preambles and such that the latex system encounters.
On the  other hand, if the TikZ file is just the TikZ figure, then I'd
be more optimistic.

But I don't think it is wise to convert the tikz to pdf and embed that
with includegraphics.
Rather, I think you just want to include the tikz code itself. You can
just use input on the TikZ figure itself. If you put that inside a LyX
floating graphic or a minipage, it "just works" in the final
processing. In Lyx, choose "Insert" "File" "Child Document" and then
choose your tikz text file.  As long as it is just the figure, it is
all good. I've just tested it, and it does work.

But you won't get an in-document preview in LyX without a  bit of
messing about.  I think that's where the other guy who refers you to
the Dia code has a good idea.  I've tried to figure that part out, but
no solution yet. We need a way to tell LyX to pass the Tikz figure
code straight through to LaTeX, but we also want an on-screen preview
of what that will be like.  But it is inherently impossible to get a
preview of what that will be like without compiling the whole
document.  A conundrum for me.


Paul,

Your comments are very valid, but I intentionally want to have the  
possibility to compile the TikZ-figures externally and embedd them as  
PDF:


- TikZ can increase compilation times *dramatically*. If you embed  
dozens of nontrivial TikZ figures "as code" into your document,  
compilation of your LyX document may take minutes instead of seconds.
- During the development of the TikZ figures (a time-consuming process  
of its own) I need to compile and debug them "stand alone" with short  
roundtrip times.

- PDF images are much easier to scale (to, e.g, pagewidth)
- Regarding the font (and styles and colors...) issue: I solve it by  
setting that up in a common preamble that is \input'ed into the LyX  
document and the TikZ figures. However, on some (rare) occasions I  
*want* to have different fonts in the figure than in the document.  
This, again, is easy to achieve via the PDF route, but requires quite  
same hacking if the figure is embedded into the source.


In fact, I can imagine only one situation I would prefer embedding  
TikZ figures by source: If they contain references into other parts  
of  the document (such as clicking on a TikZ node should bring you to  
page 212 or you refer to some bibliography item within the figure).


Daniel


Re: How to get a preview for "custom" graphics format?

2009-08-13 Thread Daniel Lohmann


On 12.08.2009, at 09:53, Guenter Milde wrote:


On 2009-08-11, Pavel Sanda wrote:

Daniel Lohmann wrote:
that mean that it is *not possible* to achieve goal (1) (the  
preview in

LyX, everything else works) via file formats and converters only?



unless imagemagick convert utility knows how to deal with it (i think
it doesn't) i'm not aware of such a plain route.


As the tkiz -> PDF (ps2pdf) conversion seems to work, the problem  
should be

solvable with a definition for PDF (ps2pdf) -> PNG.



I think I am going to try this. The point is that I still do not  
understand why this possibly could help!


- As far as I understand "PDF (ps2pdf)" is just the "default" PDF- 
Format (pdf1).
- LyX is able to create previews from files in this format  
"automagically".


Or am I mistaken here? I am still seeking for a definite answer  
regarding the conversion route that to my understanding is  
automatically deduced by LyX (TiKZ --> PDF | PDF --> Preview). It seem  
that (newer?) versions of LyX just pass everything right through to  
ImageMagik and do not bother with deducing a conversion route?


Daniel


Re: How to get a preview for "custom" graphics format?

2009-08-13 Thread Daniel Lohmann


On 13.08.2009, at 11:22, Pavel Sanda wrote:


Jürgen Spitzmüller wrote:

Pavel Sanda wrote:
- to make a python script which would take the parent document  
dumps the
preamble, then inputs tikz, latex it and returns figure for both  
preview

and output.


Here is such a python script (although it is a bit too UNIX-centric):
http://kogs-www.informatik.uni-hamburg.de/~meine/tikz/process/


in a case some of the intersted people write and test the external  
template

we could include it with this script in a proper lyx release.


The real problem is to get the preamble right. Because TikZ is a huge  
package that has a noticeable impact on LaTeX compilation times (and  
memory consumption), it is pretty well modularized into multiple  
libraries. A typical preamble for a TikZ figure looks as follows:


\usepackage{tikz}
\usetikzlibrary{fit,positioning,shapes,shapes.multipart, what you actually use in the figure>}


With the external-template mechanism, as far as I understand it, the  
additional stuff for the preamble can only be hard-code in the  
template and not be examined (e.g. by invoking some script) for the  
actual TikZ figures to embed.



Daniel 

Re: How to get a preview for custom graphics format?

2009-08-11 Thread Daniel Lohmann


On 09.08.2009, at 17:31, Pavel Sanda wrote:


Daniel Lohmann wrote:

Your  help is highly appreciated!


try to mimic http://www.lyx.org/trac/changeset/27914
and ask for inclusion if you succeed. you may also
want to comment on bug 4882.


Hi Pavel,

Thanks for your answer!

However, I have to admit that I don't really get what you suggest me  
to do. As I read 27914, this introduces Dia support via  
external_templates. Does that mean that it is *not possible* to  
achieve goal (1) (the preview in LyX, everything else works) via file  
formats and converters only?  Do I have to go the external_templates  
route?


Thanks!

Daniel




Hi,

Even though I consider myself a LyX master in many respects, the  
exact usage of File Formats, Converters and External  
Material... have always remained a mystery to me. Today I gave it  
another try (LyX 1.6.3-mac) -- and failed again.


So here is what I want to achieve:

I have some TikZ figures (which are actually stand-alone LaTeX- 
documents with the extension .tikz) that I want to embed (not the  
source, but the PDF/EPS via \includegraphics) into my LyX document  
in a way that (1) the LyX-Preview does work (2) PDF generation does  
work, and (3) the .tikz-file is opened in vim when I select Edit  
externally...


So far I got (2) and (3) working, but not (1):

-- Under [File Handling -- File formats] I have added a new file  
format TikZ as Vector graphics format,Short Name: Tikz,  
Extension: tikz, and Editor: vim.


-- Under [File Handling -- Converters] I have added a Converter  
Definition TikZ -- PDF (ps2pdf)with Converter: pdflatex $$i


If I now embed a .tikz-file, external editing and PDF generation  
works fine, but LyX is not able to show a preview. As I interpret  
the output of lyx -dbg graphics, LyX does not know how to  
generate a pixmap  from the input format (TikZ). Do I have to  
define a converter to some pixmap format as well?  How to do so?


This is pretty confusing. As I understand the manuals (don't  
remember where exactly I have read this) LyX should be able to  
deduce its route through conversion rules automatically, that is,  
to convert from TikZ to PDF first  and then from PDF to the pixmap  
required for the preview functionality.


Re: How to get a preview for custom graphics format?

2009-08-11 Thread Daniel Lohmann


On 09.08.2009, at 17:31, Pavel Sanda wrote:


Daniel Lohmann wrote:

Your  help is highly appreciated!


try to mimic http://www.lyx.org/trac/changeset/27914
and ask for inclusion if you succeed. you may also
want to comment on bug 4882.


Hi Pavel,

Thanks for your answer!

However, I have to admit that I don't really get what you suggest me  
to do. As I read 27914, this introduces Dia support via  
external_templates. Does that mean that it is *not possible* to  
achieve goal (1) (the preview in LyX, everything else works) via file  
formats and converters only?  Do I have to go the external_templates  
route?


Thanks!

Daniel




Hi,

Even though I consider myself a LyX master in many respects, the  
exact usage of File Formats, Converters and External  
Material... have always remained a mystery to me. Today I gave it  
another try (LyX 1.6.3-mac) -- and failed again.


So here is what I want to achieve:

I have some TikZ figures (which are actually stand-alone LaTeX- 
documents with the extension .tikz) that I want to embed (not the  
source, but the PDF/EPS via \includegraphics) into my LyX document  
in a way that (1) the LyX-Preview does work (2) PDF generation does  
work, and (3) the .tikz-file is opened in vim when I select Edit  
externally...


So far I got (2) and (3) working, but not (1):

-- Under [File Handling -- File formats] I have added a new file  
format TikZ as Vector graphics format,Short Name: Tikz,  
Extension: tikz, and Editor: vim.


-- Under [File Handling -- Converters] I have added a Converter  
Definition TikZ -- PDF (ps2pdf)with Converter: pdflatex $$i


If I now embed a .tikz-file, external editing and PDF generation  
works fine, but LyX is not able to show a preview. As I interpret  
the output of lyx -dbg graphics, LyX does not know how to  
generate a pixmap  from the input format (TikZ). Do I have to  
define a converter to some pixmap format as well?  How to do so?


This is pretty confusing. As I understand the manuals (don't  
remember where exactly I have read this) LyX should be able to  
deduce its route through conversion rules automatically, that is,  
to convert from TikZ to PDF first  and then from PDF to the pixmap  
required for the preview functionality.


Re: How to get a preview for "custom" graphics format?

2009-08-11 Thread Daniel Lohmann


On 09.08.2009, at 17:31, Pavel Sanda wrote:


Daniel Lohmann wrote:

Your  help is highly appreciated!


try to mimic http://www.lyx.org/trac/changeset/27914
and ask for inclusion if you succeed. you may also
want to comment on bug 4882.


Hi Pavel,

Thanks for your answer!

However, I have to admit that I don't really get what you suggest me  
to do. As I read 27914, this introduces "Dia" support via  
external_templates. Does that mean that it is *not possible* to  
achieve goal (1) (the preview in LyX, everything else works) via file  
formats and converters only?  Do I have to go the external_templates  
route?


Thanks!

Daniel




Hi,

Even though I consider myself a "LyX master" in many respects, the  
exact usage of "File Formats", "Converters" and "External  
Material..." have always remained a mystery to me. Today I gave it  
another try (LyX 1.6.3-mac) -- and failed again.


So here is what I want to achieve:

I have some TikZ figures (which are actually stand-alone LaTeX- 
documents with the extension .tikz) that I want to embed (not the  
source, but the PDF/EPS via \includegraphics) into my LyX document  
in a way that (1) the LyX-Preview does work (2) PDF generation does  
work, and (3) the .tikz-file is opened in vim when I select "Edit  
externally..."


So far I got (2) and (3) working, but not (1):

-- Under [File Handling --> File formats] I have added a new file  
format "TikZ" as Vector graphics format,Short Name: "Tikz",  
Extension: "tikz", and Editor: "vim".


-- Under [File Handling --> Converters] I have added a Converter  
Definition "TikZ --> PDF (ps2pdf)"with Converter: "pdflatex $$i"


If I now embed a .tikz-file, external editing and PDF generation  
works fine, but LyX is not able to show a preview. As I interpret  
the output of "lyx -dbg graphics", LyX does not know how to  
generate a pixmap  from the input format ("TikZ"). Do I have to  
define a converter to some pixmap format as well?  How to do so?


This is pretty confusing. As I understand the manuals (don't  
remember where exactly I have read this) LyX should be able to  
deduce its route through conversion rules automatically, that is,  
to convert from TikZ to PDF first  and then from PDF to the pixmap  
required for the preview functionality.


How to get a preview for custom graphics format?

2009-08-07 Thread Daniel Lohmann

Hi,

Even though I consider myself a LyX master in many respects, the  
exact usage of File Formats, Converters and External Material...  
have always remained a mystery to me. Today I gave it another try (LyX  
1.6.3-mac) -- and failed again.


So here is what I want to achieve:

I have some TikZ figures (which are actually stand-alone LaTeX- 
documents with the extension .tikz) that I want to embed (not the  
source, but the PDF/EPS via \includegraphics) into my LyX document in  
a way that (1) the LyX-Preview does work (2) PDF generation does work,  
and (3) the .tikz-file is opened in vim when I select Edit  
externally...


So far I got (2) and (3) working, but not (1):

-- Under [File Handling -- File formats] I have added a new file  
format TikZ as Vector graphics format, 
Short Name: Tikz, Extension: tikz, and Editor: vim.


-- Under [File Handling -- Converters] I have added a Converter  
Definition TikZ -- PDF (ps2pdf) 
with Converter: pdflatex $$i


If I now embed a .tikz-file, external editing and PDF generation works  
fine, but LyX is not able to show a preview. As I interpret the output  
of lyx -dbg graphics, LyX does not know how to generate a pixmap   
from the input format (TikZ). Do I have to define a converter to  
some pixmap format as well?  How to do so?


This is pretty confusing. As I understand the manuals (don't remember  
where exactly I have read this) LyX should be able to deduce its route  
through conversion rules automatically, that is, to convert from TikZ  
to PDF first  and then from PDF to the pixmap required for the preview  
functionality.


Your  help is highly appreciated!

Daniel



lyx.log
Description: Binary data


converter.lyx
Description: Binary data


image.tikz
Description: Binary data



 

How to get a preview for custom graphics format?

2009-08-07 Thread Daniel Lohmann

Hi,

Even though I consider myself a LyX master in many respects, the  
exact usage of File Formats, Converters and External Material...  
have always remained a mystery to me. Today I gave it another try (LyX  
1.6.3-mac) -- and failed again.


So here is what I want to achieve:

I have some TikZ figures (which are actually stand-alone LaTeX- 
documents with the extension .tikz) that I want to embed (not the  
source, but the PDF/EPS via \includegraphics) into my LyX document in  
a way that (1) the LyX-Preview does work (2) PDF generation does work,  
and (3) the .tikz-file is opened in vim when I select Edit  
externally...


So far I got (2) and (3) working, but not (1):

-- Under [File Handling -- File formats] I have added a new file  
format TikZ as Vector graphics format, 
Short Name: Tikz, Extension: tikz, and Editor: vim.


-- Under [File Handling -- Converters] I have added a Converter  
Definition TikZ -- PDF (ps2pdf) 
with Converter: pdflatex $$i


If I now embed a .tikz-file, external editing and PDF generation works  
fine, but LyX is not able to show a preview. As I interpret the output  
of lyx -dbg graphics, LyX does not know how to generate a pixmap   
from the input format (TikZ). Do I have to define a converter to  
some pixmap format as well?  How to do so?


This is pretty confusing. As I understand the manuals (don't remember  
where exactly I have read this) LyX should be able to deduce its route  
through conversion rules automatically, that is, to convert from TikZ  
to PDF first  and then from PDF to the pixmap required for the preview  
functionality.


Your  help is highly appreciated!

Daniel



lyx.log
Description: Binary data


converter.lyx
Description: Binary data


image.tikz
Description: Binary data



 

How to get a preview for "custom" graphics format?

2009-08-07 Thread Daniel Lohmann

Hi,

Even though I consider myself a "LyX master" in many respects, the  
exact usage of "File Formats", "Converters" and "External Material..."  
have always remained a mystery to me. Today I gave it another try (LyX  
1.6.3-mac) -- and failed again.


So here is what I want to achieve:

I have some TikZ figures (which are actually stand-alone LaTeX- 
documents with the extension .tikz) that I want to embed (not the  
source, but the PDF/EPS via \includegraphics) into my LyX document in  
a way that (1) the LyX-Preview does work (2) PDF generation does work,  
and (3) the .tikz-file is opened in vim when I select "Edit  
externally..."


So far I got (2) and (3) working, but not (1):

-- Under [File Handling --> File formats] I have added a new file  
format "TikZ" as Vector graphics format, 
Short Name: "Tikz", Extension: "tikz", and Editor: "vim".


-- Under [File Handling --> Converters] I have added a Converter  
Definition "TikZ --> PDF (ps2pdf)" 
with Converter: "pdflatex $$i"


If I now embed a .tikz-file, external editing and PDF generation works  
fine, but LyX is not able to show a preview. As I interpret the output  
of "lyx -dbg graphics", LyX does not know how to generate a pixmap   
from the input format ("TikZ"). Do I have to define a converter to  
some pixmap format as well?  How to do so?


This is pretty confusing. As I understand the manuals (don't remember  
where exactly I have read this) LyX should be able to deduce its route  
through conversion rules automatically, that is, to convert from TikZ  
to PDF first  and then from PDF to the pixmap required for the preview  
functionality.


Your  help is highly appreciated!

Daniel



lyx.log
Description: Binary data


converter.lyx
Description: Binary data


image.tikz
Description: Binary data



 

Re: Sty to Layout problem

2009-07-27 Thread Daniel Lohmann


On 24.07.2009, at 02:25, Luis F. Amorim França wrote:


Thanks Daniel!

I tried to create a document with a ERT like

\title(Paper Title)
\author{Luis}

but when I compile it, the document is empty. Trying to use the Lyx  
Title

and Author, I get this message:

\author{Luis}\maketitle

The control sequence at the end of the top line of your error  
message was
never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I'  
and the
correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll  
forget

about whatever was undefined


Depending on the peculiarities of the latex class, more or less stuff  
has to be given in ERT - maybe even the abstract. The example I have  
attached, for instance, uses the IOS-Book class, which  requires the  
abstract to be defined within a special frontmatter environment.  
Because I did not want to bother with getting the peculiarities of  
this class right into a LyX layout, I ended up with a big ERT box in  
the beginning and only the real content is written in LyX.


The process: I usually use the latex example file that comes with the  
paper class as template, activate source preview in Lyx (View-View  
Source, then check Complete Source) to see what LyX would generate  
and then copy parts or larger chunks of the LaTeX example into ERT  
until the result looks compilable.


Daniel


is-book-example.lyx
Description: Binary data







Hi Luis,

This may not be exactly the answer you are looking for :-)

IMHO the front matter (the stuff that is rendered by \maketitle) is  
the
most difficult part to get right into a LyX layout, especially with  
paper

styles. Every paper style uses different concepts on how authors,
institutions, multiple authors per institution, authors with multiple
institutions,  thanks-titlenotes, and so on have to be specified.  
So even
with the well-designed paper layout files that ship with LyX (LNCS,  
IEEE,
...) I usually end up using ERT in the front matter to get what I  
need.


So if you are not going to write dozens of articles using that  
style, I
would just not bother in getting everything right into the layout  
and use

ERT in the paper to specify the front matter.


Daniel


On 23.07.2009, ad 01:43, Luis Amorim wrote:

Hi,


I'm trying to write an article at Lyx, but I had some problems  
when I

tried
to use a .layout I created from the .sty file provided by the
conference. I've followed the Customization Instructions (5.2.3)  
but it


doesn't work at Lyx, especially when I try to add a Title (it says  
is a
\maketitle problem). Searching the mailing list I found someone  
who had

almost the same problem, and added

Style TitleERT
   InTitle 1

End

in the .layout to solve it. I tried to do that, but I still can't  
compile

my
files.

I attached the .sty and .layout files, and a .tex which is an  
example of

use.

Thanks!

Luis Amorim

sbc-template.lyxsbc-template.stysbc-template.tex








Re: Sty to Layout problem

2009-07-27 Thread Daniel Lohmann


On 24.07.2009, at 02:25, Luis F. Amorim França wrote:


Thanks Daniel!

I tried to create a document with a ERT like

\title(Paper Title)
\author{Luis}

but when I compile it, the document is empty. Trying to use the Lyx  
Title

and Author, I get this message:

\author{Luis}\maketitle

The control sequence at the end of the top line of your error  
message was
never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I'  
and the
correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll  
forget

about whatever was undefined


Depending on the peculiarities of the latex class, more or less stuff  
has to be given in ERT - maybe even the abstract. The example I have  
attached, for instance, uses the IOS-Book class, which  requires the  
abstract to be defined within a special frontmatter environment.  
Because I did not want to bother with getting the peculiarities of  
this class right into a LyX layout, I ended up with a big ERT box in  
the beginning and only the real content is written in LyX.


The process: I usually use the latex example file that comes with the  
paper class as template, activate source preview in Lyx (View-View  
Source, then check Complete Source) to see what LyX would generate  
and then copy parts or larger chunks of the LaTeX example into ERT  
until the result looks compilable.


Daniel


is-book-example.lyx
Description: Binary data







Hi Luis,

This may not be exactly the answer you are looking for :-)

IMHO the front matter (the stuff that is rendered by \maketitle) is  
the
most difficult part to get right into a LyX layout, especially with  
paper

styles. Every paper style uses different concepts on how authors,
institutions, multiple authors per institution, authors with multiple
institutions,  thanks-titlenotes, and so on have to be specified.  
So even
with the well-designed paper layout files that ship with LyX (LNCS,  
IEEE,
...) I usually end up using ERT in the front matter to get what I  
need.


So if you are not going to write dozens of articles using that  
style, I
would just not bother in getting everything right into the layout  
and use

ERT in the paper to specify the front matter.


Daniel


On 23.07.2009, ad 01:43, Luis Amorim wrote:

Hi,


I'm trying to write an article at Lyx, but I had some problems  
when I

tried
to use a .layout I created from the .sty file provided by the
conference. I've followed the Customization Instructions (5.2.3)  
but it


doesn't work at Lyx, especially when I try to add a Title (it says  
is a
\maketitle problem). Searching the mailing list I found someone  
who had

almost the same problem, and added

Style TitleERT
   InTitle 1

End

in the .layout to solve it. I tried to do that, but I still can't  
compile

my
files.

I attached the .sty and .layout files, and a .tex which is an  
example of

use.

Thanks!

Luis Amorim

sbc-template.lyxsbc-template.stysbc-template.tex








Re: Sty to Layout problem

2009-07-27 Thread Daniel Lohmann


On 24.07.2009, at 02:25, Luis F. Amorim França wrote:


Thanks Daniel!

I tried to create a document with a ERT like

\title(Paper Title)
\author{Luis}

but when I compile it, the document is empty. Trying to use the Lyx  
Title

and Author, I get this message:

\author{Luis}\maketitle

The control sequence at the end of the top line of your error  
message was
never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I'  
and the
correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll  
forget

about whatever was undefined


Depending on the peculiarities of the latex class, more or less stuff  
has to be given in ERT - maybe even the abstract. The example I have  
attached, for instance, uses the "IOS-Book" class, which  requires the  
abstract to be defined within a special frontmatter environment.  
Because I did not want to bother with getting the peculiarities of  
this class right into a LyX layout, I ended up with a big ERT box in  
the beginning and only the real content is written in LyX.


The process: I usually use the latex example file that comes with the  
paper class as template, activate source preview in Lyx ("View->View  
Source", then check "Complete Source") to see what LyX would generate  
and then copy parts or larger chunks of the LaTeX example into ERT  
until the result looks compilable.


Daniel


is-book-example.lyx
Description: Binary data







Hi Luis,

This may not be exactly the answer you are looking for :-)

IMHO the front matter (the stuff that is rendered by \maketitle) is  
the
most difficult part to get right into a LyX layout, especially with  
paper

styles. Every paper style uses different concepts on how authors,
institutions, multiple authors per institution, authors with multiple
institutions,  "thanks"-titlenotes, and so on have to be specified.  
So even
with the well-designed paper layout files that ship with LyX (LNCS,  
IEEE,
...) I usually end up using ERT in the front matter to get what I  
need.


So if you are not going to write dozens of articles using that  
style, I
would just not bother in getting everything right into the layout  
and use

ERT in the paper to specify the front matter.


Daniel


On 23.07.2009, ad 01:43, Luis Amorim wrote:

Hi,


I'm trying to write an article at Lyx, but I had some problems  
when I

tried
to use a .layout I created from the .sty file provided by the
conference. I've followed the Customization Instructions (5.2.3)  
but it


doesn't work at Lyx, especially when I try to add a Title (it says  
is a
\maketitle problem). Searching the mailing list I found someone  
who had

almost the same problem, and added

Style TitleERT
   InTitle 1

End

in the .layout to solve it. I tried to do that, but I still can't  
compile

my
files.

I attached the .sty and .layout files, and a .tex which is an  
example of

use.

Thanks!

Luis Amorim










Re: [Figure embedding] An easy way to share lyx documents

2009-04-26 Thread Daniel Lohmann


On 17.04.2009, at 15:25, Niko Schwarz wrote:

On Fri, Apr 17, 2009 at 8:53 AM, Rainer M Krug r.m.k...@gmail.com  
wrote:


1) I like the lyx format as it is BECAUSE it is not compressed, so I
would definitely not change the default format.



Ok, maybe I didn't make myself clear: you can have self-contained  
archives
with no compression at all on OSX. It works like this: you make a  
directory
and in that directory you dump a special file that tells finder to  
display

the directory as a package.

But from the command line, it is still a directory. And in finder,  
you can
look into the package by choosing Show Package Contents from the  
pop up

menu.

Now Pages files for example come as such packages, you can copy that
directory around, send it through email (yea, email clients handle it
surprisingly well), and it still works.

Now, other operating systems see a directory and not a package.  
People using
something other than OSX would have to be reminded to copy the  
directory

around the .lyx file around, which would be managed by lyx.

The file would still be accessible, no performance penalty, but  
complete
send-aroundability, and while it might feel a little alien on other  
OS's, on

OSX it's the standard way to do such things, so OSX users will cheer.


No, they won't.

The thing is that OSX -- or at least the OSX applications that use  
this concept, with Pages being a good (well, bad) example -- do *not*  
treat packages as true directories, but as a personal container.  
Whenever you save a Pages document, for instance, Pages deletes  
everything in the directory that was not created by itself. This can  
be quite surprising!  Pages might also decide to rename its files in  
the directory. And so on.


All tools that need to manage side-by-side metadata in directories  
(such as CVS and SVN) are inherently unusable with OSX apps that use  
the package format. You just cannot put a Keynote presentation into an  
svn repository...


Packages are one of those OSX standards that are conceptually nice,  
but unfortunately seriously broken in the actual implementation.


Daniel


  1   2   3   4   5   6   >