我尝试在 lyx 中编写一个有背景的文档,我确保它可以在 Texmaker 上运行,在 Texmaker 上需要构建几次才能正确运行,但当我尝试在 lyx 上预览或导出它时,它会失败并且我得到空白页,但是当我放入 ERT 时,\newpage
它只能显示上面的页面(但只有一个),但如果我想让它显示所有页面,我需要逐页检查它是否需要中断。我添加了我的 Latex 代码、我的 lyx 代码和它的序言。(使用 lyx 对我来说很容易,因为我需要输入很多方程式和其他语言,所以继续单独使用 latex 做事情对我来说不是一个选择)谢谢。
Latex 代码
\documentclass{article}
\usepackage{culmus}
\usepackage{ amssymb }
\usepackage{tikz}
\usepackage{lastpage}
\usetikzlibrary{calc}
\usepackage[placement=top,angle=0,color=black,scale=4,hshift=60,vshift=-5]{background}
\backgroundsetup{contents={\begin{tikzpicture}[overlay,remember picture]
\draw [xshift=4mm,color=black,line width=1pt,rounded corners=7pt]
($ (current page.north west) + (.5cm,-.5cm) $)
rectangle
($ (current page.south east) + (-.5cm,.5cm) $);
\end{tikzpicture}
\begin{tikzpicture}[overlay]
\draw[color=black] (0,-2.5) rectangle (-1.3,-0.7);
\draw[color=black] (-0.9,-1.1) node {\large\thepage};
\draw[color=black] (-0.4,-2.1) node {\large\pageref{LastPage}};
\draw[color=black] (-0.2,-0.9) -- (-1.1,-2.3);
\end{tikzpicture}},placement=center,angle=0,opacity=1,scale=1,position =current page.north west }
\pagestyle{empty}
\begin{document}
Here the text
\end{document}
Lyx 代码
Preamble:
\usepackage{tikz}
\usepackage{lastpage}
\date{}
\usepackage[placement=top,angle=0,color=black,scale=4,hshift=60,vshift=-5]{background}
\usepackage[a4paper,top=3cm,bottom=0.5cm,right=2cm,left=2cm,heightrounded]{geometry}
ERT:
\usetikzlibrary{calc}
\usetikzlibrary{backgrounds}
\backgroundsetup{contents={\begin{tikzpicture}[overlay,remember picture]
\draw [xshift=4mm,color=black,line width=1pt,rounded corners=7pt]($ (current page.north west) + (0.3cm,-0.3cm) $) rectangle ($ (current page.south east) + (-0.3cm,0.3cm) $);
\end{tikzpicture}
\begin{tikzpicture}[overlay]
\draw[color=black] (0,-2.5) rectangle (-1.3,-0.7);
\draw[color=black] (-0.9,-1.1) node {\large\thepage};
\draw[color=black] (-0.4,-2.1) node {\large\pageref{LastPage}};
\draw[color=black] (-0.2,-0.9) -- (-1.1,-2.3);
\end{tikzpicture}},placement=center,angle=0,opacity=1,scale=1,position =current page.north west }
\pagestyle{empty}
some text out side ERT
ERT: \newpage