4

I would like to move a \footnoterule to right by 3 cm to be aligned with a footgroup moved to right by 3 cm.

I know that footnote rule uses a \hrule To move the rule, I should put it in a \vbox, and move it with \moveleft or \moveright.

But when I did it, I lost kerning. I could include the footgroup in the \vbox but it will be very complex.

Any idea?

See the following example:

\documentclass{article}
\parindent=0pt
\begin{document}
\leftskip=2cm
\footnotesize \moveleft-2cm\vbox{\footnoterule}
\footnote{A good vertical distance} A bad vertical distance

\end{document}

Example

LaRiFaRi
  • 43,807
Maïeul
  • 10,984
  • The footnote rule is added during shipout. Using \moveright in the document makes no sense for this. – egreg Aug 28 '14 at 16:36
  • maybe, but I need to shift it ;-) – Maïeul Aug 28 '14 at 16:40
  • The design is that footnotes are aligned with main texts. Hence you may shift it by adjusting margins ... and then do another dirty trick to protect your main texts. Up to you :P – Symbol 1 Aug 28 '14 at 16:59
  • yes, for the second part, I can do it. Indeed, the problem is that main text is not left aligned (eledpar columns) – Maïeul Aug 28 '14 at 17:08
  • 2am now... sorry I had never heard about eledmac and its footnote-commands look insane... – Symbol 1 Aug 28 '14 at 18:04
  • yes, it quite insane, because for complexe case... – Maïeul Aug 29 '14 at 06:22
  • but that is my problem, as maintener, I know how it's work. I can move the block of notes, but not the hrule. That is my question. not more – Maïeul Aug 29 '14 at 06:26
  • If you're in vertical mode, then \moveright2cm\vbox{\hrule width .4\columnwidth} is what you want. I don't understand what you mean by “losing kerning”: just add \kern-3pt before the moved \vbox and \kern-2.6pt after it. – egreg Aug 30 '14 at 22:40
  • no @egreg, there is a problem of vertical distance between the hrule and the following text. – Maïeul Aug 30 '14 at 22:45
  • Compare the distance between rule and s in \moveright2cm\vbox{\hrule width .4\columnwidth} \leftskip=2cm s and in \hrule width .4\columnwidth \leftskip=2cm s – Maïeul Aug 30 '14 at 22:45

3 Answers3

3

If you're in vertical mode, then

\moveright2cm\vbox{\hrule .4\columnwidth}\nointerlineskip

will do.

Here's a Plain TeX simulation.

\leftskip=2cm

\moveright2cm\vbox{\hrule width 5cm}\nointerlineskip
s

\bigskip

\hrule width 5cm
s

\bye

enter image description here

Of course you'll have a strut after the rule and also some kerning (-3pt before and 2.6pt after the rule is what LaTeX uses for \footnoterule).

\leftskip=2cm

\kern-3pt
\moveright2cm\vbox{\hrule width 5cm}\nointerlineskip
\kern2.6pt
\strut s

\bigskip

\kern-3pt
\hrule width 5cm
\kern2.6pt
\strut s

\bye

enter image description here

The same result is obtained if

\moveright2cm\vbox{
  \kern-3pt
  \hrule width 5cm
  \kern2.6pt
}\nointerlineskip

is used for moving the rule to the right.

egreg
  • 1,121,712
  • thanks, but for some other technical reason, I prefer to keep the \footnoterule as one single block. cf my own answer. – Maïeul Aug 31 '14 at 06:28
  • @Maïeul I'm not sure of what you mean. – egreg Aug 31 '14 at 06:51
  • in your example \footnoterule is split as : kern + vbox containing hrule + kern. I need to have : vbox containing kern + hrule + kern. – Maïeul Aug 31 '14 at 06:56
  • @Maïeul Put the kerns in the box; it's as simple as that. – egreg Aug 31 '14 at 07:04
  • yes,but in your example, the \strut add a spurious vertical space that I don't want. – Maïeul Aug 31 '14 at 07:09
  • @Maïeul I don't understand what you're saying: if you don't want the strut, just remove it! I used it just to emulate what the usual footnote mechanism does and it belongs to the paragraph with the “s”, not to the rule. – egreg Aug 31 '14 at 07:10
  • I have forgottent to paste the \nointerlineskip, which is, indeed, what prevent spurious space. – Maïeul Aug 31 '14 at 07:15
  • compare \moveright 2cm\vbox{\footnoterule}\nointerlineskip xxx and \moveright 2cm\vbox{\footnoterule} xxx. Thank a lot for your answer. – Maïeul Aug 31 '14 at 07:15
1

When I look into the process generating footnotes, I found that LaTeX is doing everything in vertical mode. Therefore it is really difficult to find somewhere to insert a horizontal space. Finally I can only share this dirty trick:

\documentclass{article}
\begin{document}
\vspace*{17cm}
    \noindent text before \footnote{A good vertical distance} text after
\clearpage
\vspace*{17cm}
    \makeatletter
    \let\oldfootnoterule=\footnoterule
    \def\footnoterule{\moveright3cm\vbox{\oldfootnoterule}}
    \def\@makefntext#1{\parindent 1em\noindent \hskip3cm \hb@xt@ 1.8em{\hss \@makefnmark }#1}
    \noindent text before \footnote{A good vertical distance} text after
\end{document}

Symbol 1
  • 36,855
0

One french people TeXuser send me a good solution. We have to:

  • put the rule in a vbox
  • put this vbox in a hbox, with a kern inside the hbox
  • be certain than this hbox is followed by a \vbox AND NOT by a \hbox.

See the three followings example

\newbox\a
\leftskip=2cm
\setbox\a=\vbox{x}
\footnoterule
\unvbox\a
% normal position position 

\newpage

\setbox\a=\hbox{x}
\hbox{\kern 2cm\vbox{\footnoterule}}
\unhbox\a
% good x position, bad y position

\newpage

\setbox\a=\vbox{x}
\hbox{\kern 2cm\vbox{\footnoterule}}
\unvbox\a
Maïeul
  • 10,984