LyXProblem: Import LaTeX to LyX (a title page with graphics)

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
pooz
Posts: 65
Joined: Sat Apr 11, 2009 10:47 am

Problem: Import LaTeX to LyX (a title page with graphics)

Post by pooz »

Hello,

I have problems, when importing a LaTeX doc into LyX.

The LaTeX Code is correct and will be compiled in TeXShop (a main file calls the "title.tex" File)
But when I import this "title.tex"-file or even only the code (by CMD-L), Lyx wont compile it.

When inserting the complete code via "insert/Tex Code (CMD-L) or when trying to import Latex-File: Lyx gives this error:

Code: Select all

Code, edit and compile here:
\href
{http://www.google.de} { \includegraphics[width = 2.8cm]{figures/...
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.
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The Code is:

Code: Select all

Code, edit and compile here:
\begin{titlepage}
\label{sec:title}
%\enlargethispage{\voff}
\large
\begin{center}
\href{http://www.google.de}
{
\includegraphics[width = 2.8cm]{figures/center_logo.pdf}
}
\vspace{1.5cm}
% Titel
\begin{minipage}{1.1\linewidth}
{\centering\Huge\bf My long Title with technical terms}%\par}
% \par ist n·tig f·r korrekten Zeilenabstand im Titel
\end{minipage}
\large
\vspace{.1cm}
{\huge{\bf \it Title 2} %\\[1cm]
}
\vspace{.1cm}
{
\Large von \\[.5cm]
{\bf \LARGE \huge Author}\\[1.5cm]
}
\end{center}
\vfill
%\vspace{1.2cm}
\begin{minipage}[c]{7.5cm}
\href{http://www.wikipedia.org}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I would be thankful for any help
greetings

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Problem: Import LaTeX to LyX (a title page with graphics)

Post by meho_r »

Your code is not compilable, it's missing a lot of elements (no \documentclass, no \begin{document} etc.). Please, post fully compilable Minimum Working Example.
pooz
Posts: 65
Joined: Sat Apr 11, 2009 10:47 am

Re: Problem: Import LaTeX to LyX (a title page with graphics)

Post by pooz »

My Code is placed in a file called "title.tex" and this file again will be called by a main template file called "template.tex". But the main file is very big, because it includes a lot of other files beside "title.tex" like "chapter1.tex" etc... and has a big preamble/header stuff.
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Problem: Import LaTeX to LyX (a title page with graphics)

Post by meho_r »

And you expect that people here guess what documentclass you're using, which packages you're using etc.? You haven't provide the most basic infos. Of course you don't have to post your whole document, but you really have to post compilable example. Don't expect help if you're not obeying fundamental rules (Minimum Working Example being one of them).

Here's a doc which works when imported in LyX. You'll have to correct paths for included graphics and remove part above \begin{document} (including \begin{document} and \end{document} lines):

Code: Select all

Code, edit and compile here:
\documentclass{book}
\usepackage{graphicx}
\usepackage{hyperref}
\begin{document}
\begin{titlepage}
\label{sec:title}
%\enlargethispage{\voff}
\large
\begin{center}
\href{http://www.google.de}
{%
\includegraphics[width = 2.8cm]{center_logo.pdf}%
}
\vspace{1.5cm}
% Titel
\begin{minipage}{1.1\linewidth}
{\centering\Huge\bf My long Title with technical terms}%\par}
% \par ist n·tig f·r korrekten Zeilenabstand im Titel
\end{minipage}
\large
\vspace{.1cm}
{\huge{\bf \it Title 2} %\\[1cm]
}
\vspace{.1cm}
{
\Large von \\[.5cm]
{\bf \LARGE \huge Author}\\[1.5cm]
}
\end{center}
\vfill
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Take notice of the packages in the preamble which are needed to compile this document correctly, so make sure you'll have them in your master document's preamble (especially graphicx package which is needed for \includegraphic command to work).
pooz
Posts: 65
Joined: Sat Apr 11, 2009 10:47 am

Problem: Import LaTeX to LyX (a title page with graphics)

Post by pooz »

It wasn´t my intention, to not provide an information. It is just, that I am a LaTeX noob and have only very few knowledge about it. Thats why I am using LyX.

Now, I deleted some comments and "chapter-includes" to build a minimal example.
here we go for the "template.tex"

Code: Select all

Code, edit and compile here:
\NeedsTeXFormat{LaTeX2e}
\documentclass[a4paper, twoside, 11pt]{report}
\newif\ifmakeindex
\makeindextrue % generate index
%\makeindexfalse % don't generate index
\ifmakeindex
\usepackage{makeidx}
% Stichwortverzeichnis erstellen
\makeindex
\fi
\newif\ifenglish
\englishfalse % german document
\usepackage[margin=1cm,format=hang,font=small,labelfont=bf,textfont=sl]{caption}
\usepackage{subfigure}
\usepackage[ngerman]{babel}
\usepackage[latin1]{inputenc}
% Unterstuetzen von deutschen Umlauten
\usepackage{t1enc}
\usepackage{courier}
\usepackage{bibgerm}
\usepackage{cite}
\usepackage{fancyheadings}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Thanks for your code:
But it doesn´t work when importing this to LyX after deleting the lines you mentioned and saving the code to a fresh file i.e. "test.tex". The error LyX throws is the same as in my opening-post.

It seems, that LyX has problems with hyperlinks behind an image, hasn´t it?
- graphicx is used in this way

Code: Select all

Code, edit and compile here:
\usepackage[dvips]{graphicx}
% (...)
\usepackage[pdftex]{graphicx}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Thanks
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Re: Problem: Import LaTeX to LyX (a title page with graphics)

Post by meho_r »

Did you solve the problem? I tried your new code, but still cannot compile it. Can you provide package readfile.sty? macrox.tex and layout.tex are missing (you shouldn't include any external material in MWE, or at least provide them). Without these I can't get any output.
pooz
Posts: 65
Joined: Sat Apr 11, 2009 10:47 am

Problem: Import LaTeX to LyX (a title page with graphics)

Post by pooz »

Hi,

unfortunately I did not get it working. I am still on the state of my last post.

readfile.sty

Code: Select all

Code, edit and compile here:
\def\readit#1#2{\begingroup\@endpefalse
\trivlist \item[]\if@minipage\else\vskip\parskip\fi
\leftskip\@totalleftmargin\rightskip\z@
\parindent\z@\parfillskip\@flushglue\parskip\z@
\@tempswafalse \def\par{\if@tempswa\hbox{}\fi\@tempswatrue\@@par}
\obeylines #2 \catcode``=13 \@noligs \let\do\@makeother \dospecials
\frenchspacing\@vobeyspaces \@myxverbatim{#1}
\endgroup}
\begingroup \catcode `|=0 \catcode `[= 1
\catcode`]=2 \catcode `\{=12 \catcode `\}=12
\catcode`\\=12 |gdef|@myxverbatim#1[|input #1 ]
|endgroup
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
- macrox.tex and layout.tex are in my folder, whith all other files.
Post Reply