3

I am writing a letter in the article documentclass in LyX. I tried Koma-script v2, and found it nice, but not quite fulfilling with customization, at any rate not within LyX. Most of my letter works as intended, but in order to get the folding marks, that characterize a small part of scrlttr2, I tried \usepackage[absolute]{textpos}

Thus trying to position the folding marks at 1/3 and 2/3 of the page margins with the following commands:

\textblockorigin{0mm}{0mm}
\setlength{\TPHorizModule}{1mm}\setlength{\TPVertModule}{1mm} 
\begin{textblock}{1}(0,99) \rule[0.5ex]{2mm}{1pt} \end{textblock}
\begin{textblock}{1}(0,178) \rule[0.5ex]{2mm}{1pt} \end{textblock}

The folding marks appear, but they don't appear where I want them to. And even though I set the blockorigin to 0,0 the folding marks don't touch the side of the paper (which is confusing, but not what I desire).

Here is the preamble:

% Preview source code

%% LyX 2.0.5.1 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[danish]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=2.5cm,bmargin=2.5cm,lmargin=3cm,rmargin=3cm}
\setcounter{secnumdepth}{-1}
\usepackage{verbatim}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage[nottoc]{tocbibind}
\usepackage{icomma}
\usepackage{pstricks}
\usepackage{pstricks-add}
\usepackage{pst-plot}
\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0pt}
\pagestyle{fancy}
\let\ps@plain\ps@fancy
\usepackage[all]{xy}
\usepackage{marvosym}
\usepackage[absolute]{textpos}

\makeatother

\usepackage{babel}
\begin{document}

This is were I try to make the folding marks:

\textblockorigin{0mm}{0mm}

\setlength{\TPHorizModule}{1mm}\setlength{\TPVertModule}{1mm} 

\begin{textblock}{1}(0,99) \rule[0.5ex]{2mm}{1pt} \end{textblock}
\begin{textblock}{1}(0,178) \rule[0.5ex]{2mm}{1pt} \end{textblock}

And the rest:

\noindent \begin{center}
Name
\par\end{center}

\noindent \begin{center}
Title
\par\end{center}

\noindent Address\\
Address\\
Address\vspace{4ex}

\noindent \begin{flushright}
\today
\par\end{flushright}

\noindent Dear .. \vspace{4ex}

\noindent bla \vspace{2ex}

\noindent bla \vspace{4ex}

\noindent Sincerely,

\noindent Me

\cfoot{\noindent Myaddress \\
\Letter~bla@mail.com~\Telefon~+45 12\,34\,56\,78}
\end{document}
3
  • Could you provide a minimal working example (MWE) that illustrates your problem? (The LaTeX code from "View source" - but minimized! - would do.) Furthermore, are you using "article" or "scrlttr2" (letter KOMA-Script v.2) or ...?
    – e-birk
    May 8 '13 at 8:02
  • Sure. I've edited my text to include more of source on your request. I hope it will help :)
    – LaTeXNewB
    May 8 '13 at 8:49
  • No, you should provide a minimal working example: that means an example of a LaTeX file which is as short as it can be, and still display the error. For example, you have a lot of packages in your example, but the only relevant one is textpos, so the MWE would start \documentclass{article} \usepackage[absolute]{textpos} \begin{document} ... (this isn't just for posting: often, when you create such a MWE you discover what the problem is) May 8 '13 at 9:39
3

It seems that \textblockorigin{0mm}{0mm} does not set the origin exactly at the corner. Using \textblockorigin{-5.2mm}{0mm} seems to correct this.

Some general remarks not related to the problem:

  • It seems that you removed indentation for each paragraph individual. To set this globally use "Document Settings > Text Layout" and set indentation to "0mm" or similar.

  • LyX provides setting for headers and footers. Go to "Document settings > Page Layout" and set Headings style to "fancy". (If necessary use \fancyhf{} to clear header and footer.)

Here is a (nearly) minimal example (I left a few additional lines for orientation).

\documentclass{article}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=2.5cm,bmargin=2.5cm,lmargin=3cm,rmargin=3cm}
\usepackage{fancyhdr}
\pagestyle{fancy}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
%\let\ps@plain\ps@fancy
\usepackage[absolute]{textpos}
\makeatother

\begin{document}
\textblockorigin{-5.2mm}{0mm}
%---v--- just to show the origin:
\begin{textblock}{1}(0,0)%
\rule{2mm}{2mm}%
\end{textblock}
%---^--- just to show the origin
\setlength{\TPHorizModule}{1mm}
\setlength{\TPVertModule}{1mm} 

\begin{textblock}{1}(0,99)%
\rule{2mm}{1pt}%
\end{textblock}
\begin{textblock}{1}(0,178)%
\rule{2mm}{1pt}%
\end{textblock}

\cfoot{My Address}
\end{document}

Alternatively, you might look at the template "koma-letter2.lyx" (from menu "New from Template..."). The template shows how to use the document class "scrlttr2".

2
  • Thanks a lot for your thorough answer. The main problem though, I found out, is that the math isn't quite well used. 297/2=199 not 179. Sorry for the inconvenience. As for the indentation it seems to me that LyX uses \noindent as a solution to the document setting: 0mm customized indentatation.
    – LaTeXNewB
    May 8 '13 at 12:31
  • @LaTeXNewB You can check that setting indentation to "0mm" in document settings will create \setlength{\parindent}{0mm} whereas \noindent is created by deselecting "Indent Paragraph" under "Paragraph Settings".
    – e-birk
    May 10 '13 at 11:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.