
我是乳膠新手!我已成功地以正確的格式獲取文本,但在將單個圖形定位到需要的位置時遇到問題。本質上它應該位於頁面的左側,左側框架文字位於其頂部。
然而,它並不太有效。以防萬一您需要知道,symbol_strip 是一張 4 x 20cm 的圖像;我已將其註解掉,因為它只會出現在錯誤的位置。
% Left frame
\begin{figure}
\hfill
% \includegraphics{symbol_strip.jpg}
\vspace{-2cm}
\end{figure}
\begin{flushright}
Tractor beat trailer give backwoods hee-haw gold frogskin plumb nugget. Liniment fancy rightly work chicken what cipherin' how ya. Heapin' backwoods her hospitality em got creosote overalls rodeo up. Townfolk soap out.
\end{flushright}\normalsize
\framebreak
而且,是的,我正在使用 Hillbilly,因為我的 Lorem ipsum 已經生鏽了;)
我也嘗試使用這裡的例子文法類似 \centering 左右?透過將圖形包裹在flushright周圍,只是這次文字消失了。使困惑。
\documentclass[a4paper,11pt,final]{memoir}
\pagestyle{empty}
\usepackage{flowfram}
\usepackage{graphicx}
% left frame
\newflowframe{0.2\textwidth}{\textheight}{0pt}{0pt}[left]
\newlength{\LeftMainSep}
\setlength{\LeftMainSep}{0.2\textwidth}
\addtolength{\LeftMainSep}{2\columnsep}
% right frame
\newflowframe{0.7\textwidth}{\textheight}{\LeftMainSep}{0pt}[main01]
\begin{document}
\begin{figure}
\begin{flushright}
\includegraphics{symbol_strip.jpg}
\vspace{-2cm}
Tractor beat trailer give backwoods hee-haw gold frogskin plumb nugget. Liniment fancy rightly work chicken what cipherin' how ya. Heapin' backwoods her hospitality em got creosote overalls rodeo up. Townfolk soap out.
\end{flushright}
\end{figure}
\end{document}
我還附上了一張圖。藍色匕首狀的部分就是有問題的圖像。
答案1
很難說出你想要做什麼,所以我不確定這就是你想要的。但是,您確實說過您希望將文字印在圖片“之上”。我不確定這是否意味著多於圖片或超過圖片。
這段程式碼把圖片在下面文本,以便文字列印在圖片上方。也就是說,圖片形成背景。文字印在背景上。
\documentclass[a4paper,11pt,draft]{memoir}
\pagestyle{empty}
\usepackage{flowfram}
\usepackage{graphicx}
\usepackage{tikz}
% left frame
\newflowframe{0.2\textwidth}{\textheight}{0pt}{0pt}[left]
\newlength{\LeftMainSep}
\setlength{\LeftMainSep}{0.2\textwidth}
\addtolength{\LeftMainSep}{2\columnsep}
% right frame
\newflowframe{0.7\textwidth}{\textheight}{\LeftMainSep}{0pt}[main01]
\begin{document}
\begin{tikzpicture}[remember picture, overlay, x=4cm, y=20cm]
\node at (0,0) {\includegraphics[width=4cm,height=20cm]{symbol_strip.jpg}};
\end{tikzpicture}
\begin{figure}
\begin{flushright}
\vspace{-2cm}
Tractor beat trailer give backwoods hee-haw gold frogskin plumb nugget. Liniment fancy rightly work chicken what cipherin' how ya. Heapin' backwoods her hospitality em got creosote overalls rodeo up. Townfolk soap out.
\end{flushright}
\end{figure}
\end{document}
請注意,我使用草稿選項來消除有關找不到圖像的錯誤。這會產生這樣的結果:
我不知道你為什麼要把這個做成一個數字。如果您希望物體精確定位,您不希望 TeX 移動它們,而這正是圖形環境告訴它要做的!
編輯(刪除):
根據您編輯的問題,我假設您不想要該文本多於圖片。由於這將內容從頁面中刪除,我將刪除原始答案的這一部分。
編輯(根據更新的問題更新):
根據您發布的圖像,您可以嘗試類似以下的操作,但將 tikzpicture 替換為您手頭上的背景圖像。
\documentclass[a4paper,11pt,final]{memoir}
\pagestyle{empty}
\usepackage{flowfram}
\usepackage{graphicx}% not needed to produce my demo
\usepackage{xcolor}% not needed if you use a background image
\usepackage{tikz}
% left frame - alternatively, specify a larger proportion of \textwidth or set this width absolutely
\newflowframe{0.2\paperwidth}{\textheight}{0pt}{0pt}[left]
\newlength{\LeftMainSep}
\setlength{\LeftMainSep}{0.2\paperwidth}
\addtolength{\LeftMainSep}{2\columnsep}
% right frame - alternatively, specify a smaller proportion of \textwidth or calculate width from the absolute width of the left flow frame etc.
\newflowframe{0.7\paperwidth}{\textheight}{\LeftMainSep}{0pt}[main01]
% recalculate left/right margins - or see alternatives above
\newlength{\mywidth}
\setlength{\mywidth}{\LeftMainSep}
\addtolength{\mywidth}{0.7\paperwidth}
\settypeblocksize{\textheight}{\mywidth}{*}
\begin{document}
\begin{tikzpicture}[remember picture, overlay]
\fill [fill=blue!20] (0,1cm) -- (0,-14cm) -- (4cm,-19cm) -- (4cm,1cm) -- cycle;
\end{tikzpicture}
\vfill% or set \vspace*{whatever you like}
\hspace*{\parindent}% text in specimen is set into page somewhat
\begin{minipage}[c]{3cm}% adjust to taste
\raggedleft
Tractor beat trailer give backwoods hee-haw gold frogskin plumb nugget. Liniment fancy rightly work chicken what cipherin' how ya. Heapin' backwoods her hospitality em got creosote overalls rodeo up. Townfolk soap out.
\end{minipage}
\hspace*{1em}% avoid text hitting edge of frame or background - adjust to taste
\vfill\vfill% adjust to taste or reduce to one \vfill if setting \vspace*{} to a specific value above
\framebreak% force following text to next flow frame
\section*{Sphinx of black quartz}% demonstrate relative positioning of text in next frame
Peter Piper picked a pickled pepper.
\end{document}
其產生:
請注意 \paperwidth 和 \textwidth 之間的區別。除非您實際上將左/右邊距歸零,否則 \textwidth 的五分之一不足以包含 4 公分寬的圖像。因此,假設您想要的東西看起來與您發布的圖像大致相似,並且您不希望更改該圖像,我猜您希望左流程框架更寬。我保持比例相同,並根據結果寬度設定邊距。所以現在的利潤非常小。如果這不是你想要的,你可以增加左流框架相對於主框架所佔頁面寬度的比例,或者將左流框架設為絕對寬度(例如4cm或其他)併計算寬度相應的主流程框架。
如果文字應該位於更高的位置,請增加小型頁面後面的 \vfill 命令的數量,調整小型頁面的位置,或將小型頁面之前的 vspace 數量設定為您喜歡的任何值。