1

I have an article to be written with 1 inch margins, with figures of course in the figure environment. [...] I now narrowed down the problem to the use of \abstract{...}. I use

\documentclass[12pt]{article}   
\usepackage[a4paper, margin=1in]{geometry}
\usepackage{graphicx,authblk}    
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}   
\usepackage{csquotes}

\begin{document}    
\abstract{Lorem ipsum dolor sit amet, \ldots}

\section{Test}    
Test

\begin{figure}
\centering
\includegraphics[width=0.8\textwidth]{fig_Test.pdf}
\caption{This is a long sentence used as caption. It has 
to be so long to illustrate my problem.}
\label{fig_Test}
\end{figure}

\end{document}

If I remove the \abstract directive, everything works fine. But as soon as the \abstract instruction is there, its formatting (narrower textblock than standard) is kept for the subsequent sections, and the captions are wider than the text block. What to do, if I do want to provide an abstract for the paper?

Narrow text/wide caption

Schweinebacke
  • 26,336
  • Welcome to TeX.SX! Can you please remove everything from your example, that is not needed to reproduce the problem (e.g., the whole \ifpdf…\else…\fi section could be replaced by loading graphicx and tikz without options) and make the example compilable, e.g., replacing the unknown image by an example image of package mwe? The resulting MWE would help us to help you. BTW: Don't understand your 2nd sentence. – Schweinebacke Aug 07 '17 at 10:43
  • 2
    Compiling your example code I get https://i.stack.imgur.com/t63ks.png which looks fine. How are you compiling? I used pdflatex from Texlive 2017. – samcarter_is_at_topanswers.xyz Aug 07 '17 at 10:50
  • Also related: https://tex.stackexchange.com/questions/29039/how-to-limit-the-figure-caption-width, https://tex.stackexchange.com/questions/110393/too-wide-figure-caption – Schweinebacke Aug 07 '17 at 11:30
  • @Mico If I would retract my vote I could not vote for closing again. So I wouldn't be able to support your close vote. Because of this, I will not retract my vote even though the reason is meanwhile the wrong one. – Schweinebacke Aug 07 '17 at 13:39
  • @Mico: So you want to vote-to-reopen and close it as something else? – Werner Aug 07 '17 at 15:13
  • @Werner - I ended up re-writing much of the OP's code to focus the matter squarely on the use of an \abstract{...} directive. – Mico Aug 07 '17 at 17:08
  • In the article document class, the abstract environment not only uses a narrower text block (i.e., wider margins), it also uses a smaller font. If you use the command version of the abstract environment, i.e., if you write \abstract ..., you must provide a suitably-placed \endabstract directive as well. If you fail to do so, the whole remainder of the document will be typeset using wider margins and a smaller text font. – Mico Aug 07 '17 at 17:13

2 Answers2

7

(edited this answer after the OP revealed some previously missing information)

If you want to write the Abstract using the directive

 \abstract{Lorem ipsum dolor sit amet...}

you must terminate the abstract section with a matching \endabstract directive:

 \abstract
 Lorem ipsum dolor sit amet...
 \endabstract

The \abstract directive does not actually take an argument. Thus, writing \abstract{Lorem ipsum ...} is equivalent to writing \abstract Lorem ipsum ....

However, it's much better (and certainly clearer, in my view) to write

\begin{abstract}
Lorem ipsum dolor sit amet...
\end{abstract}
Mico
  • 506,678
  • Thanks already for all your help, I've narrowed it down to an abstract problem (see edit in my question). – rower2000 Aug 07 '17 at 12:06
2
  • to have caption wide the text width special effort is needed :), so described problem is unlikely (i can't reproduce it)
  • instead \graphics you should load \graphicx
  • the way how the some packages is loaded is wrong, they had to outside of \ifpdf test
  • minimal working example (mwe) is:

\documentclass[12pt]{article}
\usepackage{geometry}
\geometry{a4paper, margin=1in}

\usepackage[demo]{graphicx}
\usepackage{caption}

\usepackage{lipsum}

\begin{document}
\lipsum[11]
    \begin{figure}[ht]
\centering
\includegraphics[width=0.8\textwidth]{fig_Test.pdf}
\caption{This is a long sentence used as caption. It has to be so long to illustrate my problem.}
\label{fig_Test}
    \end{figure}
\end{document}

enter image description here

Zarko
  • 296,517
  • 1
    Your answer was a valiant attempt to address issue as framed in the OP's original write-up. It turned out, though, that the real problem was somewhere completely else, viz., in the use of \abstract (a directive, not an environment) without a corresponding \endabstract instruction. – Mico Aug 07 '17 at 17:09
  • @Mico, thank you for nice words. in similar question many times i have dilemma, what to do: wait with my answer (with risk that nor earn some reputation :)) , or write an answer before the question is clarified ... from question, at least to me, still not obvious, that the abstract is the problem ... as i see, actually is not, problem is wrong comparison caption width with abstract width, which narrower than text width ... i need to rethink if i should add comment about his to my answer ... – Zarko Aug 07 '17 at 17:56