Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions docs/tutorials/figure-positioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ For figures that should span both columns in a two-column layout:
{#fig:workflow width="\textwidth" tex_position="t"}
```

**Note:** `width="\textwidth"` automatically creates a `figure*` environment for two-column spanning.
**Note:** `width="\textwidth"` automatically creates a `figure*` environment for two-column spanning, except when `tex_position="p"` which keeps a standard `figure` on its own page.

## Panel References

Expand Down Expand Up @@ -93,11 +93,10 @@ As shown in @fig:results A, the data indicates...
{#fig:schematic tex_position="p" width="\textwidth"}
```

When `width="\textwidth"` is used with `tex_position="p"`, Rxiv-Maker creates a
`figure*` environment to span the full page width, preventing captions from
overflowing in two-column layouts. If the figure floats too far from the
reference point, insert `<clearpage>` or `<float-barrier>` before the figure to
force placement.
When `width="\textwidth"` is used with `tex_position="p"`, Rxiv-Maker uses a
standard `figure[p]` environment so the figure occupies a dedicated page. If
the figure floats too far from the reference point, insert `<clearpage>` or
`<float-barrier>` before the figure to force placement.

## Figure File Organization

Expand Down
5 changes: 5 additions & 0 deletions src/rxiv_maker/converters/figure_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ def create_latex_figure_environment(
or width == "\\textwidth" # Auto-detect full-width figures regardless of position
)

if position == "p":
# Dedicated page figures should use standard figure environment
# even when width is set to \textwidth
is_twocolumn = False

# Only adjust positioning for two-column spanning figures that don't have explicit positioning
if is_twocolumn and position == "ht":
# For two-column spanning figures with default positioning, use 'tp' for better placement
Expand Down