LyXBiocStyle and hyperref

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
Hive
Posts: 11
Joined: Mon Feb 08, 2016 2:55 pm

BiocStyle and hyperref

Post by Hive »

Hi everyone.

I am a new Lyx user and I have to use the page layout BiocStyle for a report writting. It seems to work fine until I insert html links, getting some "Missing \begin{Document}" and "Option clash for package hyperref" errors.

I don't understand where the problem is, given that I don't manually call (correct word ?) the hyperref package.

Here is my preamble :

Code: Select all

% Layout page
<<style-knitr, eval=TRUE, echo=FALSE, results="asis">>=
BiocStyle::latex()
@

% Import Rds file
<<eval=TRUE, echo = FALSE, results = "asis">>=
options(scipen = 50)
library(knitr)
library(xtable)
R_param = readRDS("/path/file.Rds")
@

% Language
\usepackage{booktabs}
% Horizontal pagination
\usepackage{pdflscape}
% Tables
\usepackage{array}
\usepackage{longtable}
\usepackage{multirow}
\usepackage{colortbl}
% Colors
\usepackage{xcolor}
\usepackage{color}
% Special caracters
\usepackage{textcomp}
% Set size of page
\usepackage{fullpage}
% Table position
\usepackage{graphics}

\usepackage{rotating}
\usepackage{ulem}
\usepackage{soul}

% Set color and column types
\newcolumntype{a}{>{\columncolor{blue!30}}c}
Any help would be appreciated.
Sorry for my english.

Have a nice day
Hive

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Re: BiocStyle and hyperref

Post by scottkosty »

Can you please post a minimal working example (see e.g. here: https://wiki.lyx.org/FAQ/MinimalExample) .lyx file (it is just a text file) and also .tex file?
Hive
Posts: 11
Joined: Mon Feb 08, 2016 2:55 pm

BiocStyle and hyperref

Post by Hive »

Sorry for the late. In attach, a mwe of my problem, which gives the same errors. It works if I remove the link on the last line ("forum lyx").

I just load the knitr module in order to use BiocStyle.
Attachments
mwe.tex
(2.97 KiB) Downloaded 287 times
mwe.lyx
(2.41 KiB) Downloaded 231 times
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Re: BiocStyle and hyperref

Post by scottkosty »

Is the custom LaTeX preamble you have necessary to reproduce the problem? Is the knitr module? Please read the link regarding what a minimal example is.
Hive
Posts: 11
Joined: Mon Feb 08, 2016 2:55 pm

BiocStyle and hyperref

Post by Hive »

Ok sorry for that. Here a better MWE I hope.

In the preamble I put a knitr "chunk" which allows to use R code in a latex document. Here I can call BiocStyle::latex() which change the layout of my pdf. So the only module loaded is Rnw (knitr) to make it work.

I use lyx in version 2.1.3

I put a simple hyperlink to the lyx forum in the document body. This one causes some problems described in my first post. When I remove it, all works fine. But I would like to use hyperlink AND BiocStyle layout.

The joined pdf file shows what it looks when it works (whithout the link).

Hope I'm clear enough.
Attachments
mwe_biocstyle.pdf
PDF file I have whithout the link
(49.69 KiB) Downloaded 226 times
mwe_biocstyle.tex
tex file whith the link
(2.62 KiB) Downloaded 261 times
mwe_biocstyle.lyx
lyx file with a hyperlink
(2.02 KiB) Downloaded 230 times
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Re: BiocStyle and hyperref

Post by scottkosty »

I see. Yes, after testing the MWE your message is clear to me. So *with* the preamble code you have in there you get an error, and without everything is fine (I tested and if I click on the hyperlink it works fine). I don't know what the problem is. Perhaps someone around here will install the Bioconductor LaTeX class and look at the .tex file that posted. If not, consider trying a Bioconductor forum or mailing list. Hope you get it figured out! If you do, let us know the solution.
Hive
Posts: 11
Joined: Mon Feb 08, 2016 2:55 pm

Re: BiocStyle and hyperref

Post by Hive »

Thanks for your time. I'll let you know if I find any solution ;)
Hive
Posts: 11
Joined: Mon Feb 08, 2016 2:55 pm

BiocStyle and hyperref

Post by Hive »

Finally found it !

The problem comes from the Lyx tool to make hyperlink (litteraly the hyperlink button) which interfere with BiocStyle. I manualy wrote it in a code chunk with the latex command href :
\href{http://www.site.com}{site}

And it works.
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Re: BiocStyle and hyperref

Post by scottkosty »

Thanks for posting back with your solution!
Post Reply