GeneralDefinition of Command for invisible Section Heading

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
ssfjhh
Posts: 12
Joined: Wed Jul 10, 2013 12:38 pm

Definition of Command for invisible Section Heading

Post by ssfjhh »

I want to define a new command to show a new section without section name being shown in the document but can be shown in the PDF bookmark.

I have define one. Most of the time it works very well but sometimes when I insert some pictures the bookmark is aberrant. So I have to try new way to insert pictures often.
When I use the command "section", the bookmarks are OK every time. So I think the command "nosection" I defined need to redefine. :cry:
Can anyone help me?

Code: Select all

\newcommand{\nosection}[1]{%
  \refstepcounter{section}%
  \addcontentsline{toc}{section}{\protect\numberline{\thesection}#1}}
My Englist is poor. If something I wrote confuses you, please let me know.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

ssfjhh
Posts: 12
Joined: Wed Jul 10, 2013 12:38 pm

Re: Definition of Command for invisible Section Heading

Post by ssfjhh »

Anyone can help me?
My Englist is poor. If something I wrote confuses you, please let me know.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Definition of Command for invisible Section Heading

Post by cgnieder »

ssfjhh wrote:Most of the time it works very well but sometimes when I insert some pictures the bookmark is aberrant. So I have to try new way to insert pictures often.
I don't understand what you mean by »the bookmark is aberrant« can you elaborate on this. Best thing would be if you could give a Infominimal working example that shows the behaviour you don't like and want to have changed.

Regards
site moderator & package author
ssfjhh
Posts: 12
Joined: Wed Jul 10, 2013 12:38 pm

Definition of Command for invisible Section Heading

Post by ssfjhh »

cgnieder wrote:
ssfjhh wrote:Most of the time it works very well but sometimes when I insert some pictures the bookmark is aberrant. So I have to try new way to insert pictures often.
I don't understand what you mean by »the bookmark is aberrant« can you elaborate on this. Best thing would be if you could give a Infominimal working example that shows the behaviour you don't like and want to have changed.

Regards
minimal.tex
(2.11 KiB) Downloaded 429 times
Here is the minimal example.

I want to rotate a figure 90° and place the figure title on the right of the figure. So I use the package "sidewaysfigure" in my latex. The code works very well for the main body of the document. But the bookmarks for the figures are missing.
If I replace all the "sidewaysfigure" with "figure", everything is OK.
If I replace all the "nosection/nosubsection" with "section/subsection", everything is OK too. So I think the command "nosection" I defined need to redefine.
Last edited by ssfjhh on Mon Sep 23, 2013 7:27 am, edited 1 time in total.
My Englist is poor. If something I wrote confuses you, please let me know.
ssfjhh
Posts: 12
Joined: Wed Jul 10, 2013 12:38 pm

Definition of Command for invisible Section Heading

Post by ssfjhh »

cgnieder wrote:
ssfjhh wrote:Most of the time it works very well but sometimes when I insert some pictures the bookmark is aberrant. So I have to try new way to insert pictures often.
I don't understand what you mean by »the bookmark is aberrant« can you elaborate on this. Best thing would be if you could give a Infominimal working example that shows the behaviour you don't like and want to have changed.

Regards
abc.tex
(2.3 KiB) Downloaded 389 times
Here is another minimal example.

I set all the figures with options [!htbp]. But the two figures on the first page is closer than two figures on the other pages.

If I set the first figure with option [htbp]. Only one figure will be placed on the first page, while the figure is small enough.
My Englist is poor. If something I wrote confuses you, please let me know.
Post Reply