Questions tagged [align]

Use the align tag for questions about aligning text vertically. For example, formatting tables so the columns in a row line up under the columns in the previous row; or having consecutive rows of text arranged to keep a symbol/separator in the same column, such as the equal sign in equations, or a series of variable assignments.

Filter by
Sorted by
Tagged with
1 vote
2 answers
52 views

How to align a region on &?

I thought M-x align-regexp & 1 1 y on the region containing &'s would align all columns, but it does not, so I must be using it wrong. What is the correct way? Reminder: man says white spaces ...
Erwann's user avatar
  • 828
0 votes
0 answers
20 views

How to align source code section in both Org-src-edit-code, Org-mode, and exported PDF file?

How to configure emacs such that code (in this case :which-key) is aligned in both org-edit-src-code org-mode and exported PDF? I'm guessing this is somewhat related to tabs getting different amount ...
Garid's user avatar
  • 505
0 votes
1 answer
21 views

misaligned column view headers

Similar topic here Since update to org-mode 9.4 misaligned column view headers I read that headers are using faces: org-column and org-column-title. Can I just delete those faces? I don't need them in ...
slk500's user avatar
  • 461
0 votes
1 answer
38 views

Emacs spacing format is inconsistent with my setup

emacs version: GNU Emacs 26.3 using specman_mode.el most of the company uses gvim, i am using emacs, so the alignment are a bit different. but, when i open the file with emacs -Q, the alignment is ...
Michael Marjieh's user avatar
0 votes
0 answers
14 views

Recalculating org-mode table causes it to be misaligned when there are multiple tables

Here is my org-mode file foo.org: | Category | Points | |-----------+--------| | Minecraft | 13 | | Tetris | 6 | | Bricks | 1 | |-----------+--------| | | 20 | #+...
Eminent's user avatar
  • 65
0 votes
0 answers
25 views

When using URLs then alignment is breaks

Given: Ubunut 22.04 LTS Emacs 28.1 Here my org file: As you can see then in the column "Task" has text then alignment is good. But when has a hyper link (URL) then alignment breaks. Why? P....
a_subscriber's user avatar
  • 3,830
0 votes
1 answer
81 views

My text is not aligned, what is causing this?

I noticed recently that across all my files, each line is slightly misaligned. As you can see, depending on the line number, the text is off a bit. I tried changing fonts with no luck. Which setting ...
Vinn's user avatar
  • 263
1 vote
0 answers
22 views

align-regexp right-justification works with one exception

/*********************/ /* O r i g i n a l */ /*********************/ -E : regex search" -F : fast search" -r : reverse order (newer first)" --all : search all notes" --txt : ...
ychaouche's user avatar
  • 207
2 votes
2 answers
90 views

How can I create an Emacs keyboard macro to make Clojure code easier for humans to read it?

I am working on a Clojure codebase. Sometimes, we have code as: :boxes [{:id "Do-not-map" :description "Do Not Map, expenses" :line "0" ...
Pedro Delfino's user avatar
0 votes
1 answer
43 views

Emacs calendar: how to reset column alignment

On my Agenda view (C-u C-c .) I have a "strange" effect. Line and column are not aligned: How can I reset it?
RenatoP's user avatar
  • 121
0 votes
0 answers
30 views

Org Agenda and Org Files - Tags at the right margin of the window

I can set org-tags-column and org-agenda-tags-column to a specific value and get tags to right align at that column. Is there a way to right align the tags at the margin i.e. the right edge of the ...
deshmukh's user avatar
  • 1,842
1 vote
1 answer
192 views

indent-region does not respect my c-mode style

This is my C style: (defconst mira-c-style '((c-basic-offset . 4) (indent-tabs-mode . nil) (tab-width . 7) (c-comment-only-line-offset . (0 . 0)) (c-lineup-C-comments . 0) (c-...
Gauthier's user avatar
  • 489
0 votes
0 answers
253 views

org mode table cell alignment for HTML export

I've got this all by itself in an org file #+NAME: coinfliptable #+ATTR_HTML: :border 2 :rules all :frame border | <c10> | <c10> | <c10> | <c10> | <c10> | <c10> | | ...
147pm's user avatar
  • 2,887
5 votes
1 answer
122 views

How to right-align with align-regex?

Initial buffer &ei = wFSXYvnUEvaL6dsP9f2HsAE &ip = 195.201.109.29 &id = o-AD7SgDnv171kT3qy-KSuSbDZ3zX4YR5X7cS6Mmq237oY &itag = 22 &source = youtube &requiressl = yes &vprv =...
ychaouche's user avatar
  • 207
1 vote
3 answers
153 views

How can I align indents for condition statements in AucTex algorithm section?

If possible, I want to align condition statements like: \If, \Else, \For statements in between \begin{algorithmic} ... \end{algorithmic} section. example: \begin{algorithmic}[1] \For{a for statement} ...
alper's user avatar
  • 1,130
0 votes
1 answer
55 views

TAB should indent at start of line and advance to tab stop otherwise

More precisely, I would like TAB to indent the current line when there are 0 or more whitespace characters between the start of line and the point and to advance to the next tab stop otherwise. I used ...
Dwight Shih's user avatar
0 votes
0 answers
190 views

How to replace unicode in emacs?

I'm using spacemacs, and am wondering how you do certain commands like replace and align with respect to unicode (particularly relevant for Agda development). For instance, → has the \to shortcut in ...
Warrick Macmillan's user avatar
0 votes
1 answer
75 views

Evenly spaced table-cells

I would like to change the following spacing behavior so that ideally all begin and end of columns are lined up (evenly spaced). All rows should stretch as much as the largest of them.
BuddhiLW's user avatar
  • 257
0 votes
0 answers
68 views

Why emacs makes weird indents in arrays

Often, emacs makes weird indentation in arrays: first line indented properly, but next lines are indented twice. This behaviour found mostly in php (with web-mode): array( array( 'name' => 'Add'...
drmgc's user avatar
  • 1
3 votes
0 answers
192 views

Full Justification for Proportional Fonts

I am having difficulty getting text to fully justify when I use a proportional font. When I do, I get staggered text. As I understand it, the way emacs generally handles filling is by number of ...
strange's user avatar
  • 71
2 votes
1 answer
729 views

Doom-emacs - How to align chinese characters in org-tables

I'm trying out doom emacs for the first time (previously was using spacemacs). I've run into an issue where chinese characters are not aligned in org mode tables. For example: | Character | Pingyin ...
Ishmael7's user avatar
0 votes
1 answer
611 views

Javascript mode mixes tabs and spaces for indent

My javascript mode indents with a mix of tabs and spaces. I'm ok with the mix if spaces are used for cosmetic alignment, but this is just wrong: First level of indentation is spaces, second is tab, ...
Gauthier's user avatar
  • 489
1 vote
2 answers
347 views

Removing alignment in LaTeX align environment

I want to write a very long equation (3-4 lines) in LaTeX. For this equation I want to use align environment. What I don't like is how Emacs formats the LaTeX code: it adds a lot of unnecessary space, ...
cheyp's user avatar
  • 113
0 votes
1 answer
161 views

How to align operands in c++-mode?

I'm trying to get Emacs to align operands vertically. Current behaviour #include <iostream> void main() { std::cout << 1 + 2 + 3; return 1 + 2 + 3; } Wanted ...
tastytea's user avatar
  • 105
2 votes
1 answer
189 views

Lining up text with proportional fonts

Suppose I want to show text data in two columns like here: As you can see the font in the columns is proportional (not monospace). How can text data be shown in an emacs buffer like this, with the ...
Tom's user avatar
  • 1,158
2 votes
1 answer
633 views

Org mode tag column setting is ignored

Running Doom Emacs v 2.0.9. My ~/.doom.d/init.el contains: (custom-set-variables '(org-tags-column -80) ) When I add tags using counsel-org-tag, the tag alignment in the current headline is ...
deshmukh's user avatar
  • 1,842
0 votes
0 answers
37 views

Pasting rectangle indents text to the right

Copying and pasting a rectangle from the following table with C-x SPC C-x r M-w C-x r y shifts the beginning of the line to the right as shown below: |----+----------+------+------+--------| | | ...
Sati's user avatar
  • 755
0 votes
1 answer
131 views

Align statement breaks on rhs with equal sign

Is there a way to have rhs statement breaks align with the equal sign on the lhs line? e.g. some_value = a * b + c / some_other_value * x; becoming some_value = a * b + c / ...
Koala Bear's user avatar
3 votes
0 answers
106 views

How to align latex tables when using macro folding

I have a latex table which contains some long commands like includegraphics or href which makes the table very nasty to read. To get a better view I fold all macros in the table and want to use ...
student's user avatar
  • 997
2 votes
1 answer
424 views

How to align specific columns, for several lines simultaneously?

Consider i want to make something like this row one goes like this row two goes like this woops like this woops like what happend now and i want the like to be aligned in all sentences, something ...
JohEker's user avatar
  • 135
0 votes
0 answers
135 views

org-brain-visualize alignment issue on Mac OS

I am having trouble getting the Picture art in org-brain-visualize to align properly. I have tried this with several versions of Emacs, both run as a Mac app and from the Terminal: Org-brain version ...
Adam's user avatar
  • 1,847
1 vote
0 answers
137 views

Align elements of a matrix to the right

I have a matrix in C++ Matrix<double> A = { {31, -13, 0, 0, 0, -10, 0, 0, 0}, {-13, 35, -9, 0, -11, 0, 0, 0, 0}, {0, -9, 31, -10, 0, 0, 0, 0, 0}, {0, 0, -10, 79, -30, 0, 0, 0, -...
Mike Manilone's user avatar
1 vote
1 answer
126 views

How do I align code on dot/period (.)?

I recently switched to emacs. Just wanted to see how it works and if it'll help with productivity. Right now I'm working in Haskell, which means a lot of function composition with . operator. I have ...
atis's user avatar
  • 113
1 vote
1 answer
240 views

Go Lang Struct Align Text

I am using go programming I have structs like this: type person struct { firstname string lastname string age int address string } I want it to be aligned like this ...
Pharaoh's user avatar
  • 111
0 votes
1 answer
745 views

How to use align-regex to align text as column or matrix?

I am trying to align code using align-regex but I could not figure out how to solve the below problem. This is what I have: public class Person { public static String id = ""; private String ...
tammary's user avatar
0 votes
1 answer
188 views

align doesn't indent multiple lines of C code correctly

This is my simple C code block: int main() { // the enty function in x = 100; // my new variable for(int i=1; i<2012; ++i) { // loop a lot x -= i; } } /* ...
CodyChan's user avatar
  • 2,589
3 votes
2 answers
636 views

How to align both of comments and macro of multiple lines with space instead tabs for C/C++ code?

This is my configuration in init.el for C/C++ code which is default value in linux kernel: (setq indent-tabs-mode t) I'm using this style and won't change it to nil. And indentation and alignment ...
CodyChan's user avatar
  • 2,589
0 votes
1 answer
108 views

Re-align text after a bigger symbol

I'd like to customize a bit mu4e in order to display nice utf-8 chars (or still better, colored emojis). However, the problem is that the utf8 chars does not have the good width (even in the mono ...
tobiasBora's user avatar
1 vote
0 answers
215 views

Why is Emacs not aligning text?

When I started Emacs with emacs -q I customized the variable "Bidi Paragraph Direction" to 1 (right to left) It only affected this "Customize .." buffer and the bottom buffer. One of them is ...
Ahmed Elsawy's user avatar
1 vote
0 answers
41 views

Passing function to align-region raises an error when using 'justify' rule

I have *test* buffer with following contents: 1234 23347 35466 155555 267 31 1444444 2444 32777 Now I'm trying to understand how passing a callback to align-region works, so I ...
mkcms's user avatar
  • 1,340
0 votes
1 answer
64 views

shell script: emacs does not align case if pattern involves $

Let us start with an unaligned piece of code case $word in pattern1) command1 ;; *) command_defaultcase ;; esac I can align this code by selecting the lines and pressing TAB. The result is: case $...
Viesturs's user avatar
  • 755
2 votes
1 answer
96 views

Align the values of a JavaScript map

Say that you have the following JavaScript map literal {a: 1, aoeu: 2} and want the values aligned for readability like {a: 1, aoeu: 2} Is this possible to do with emacs? I'm currently using ...
Rovanion's user avatar
  • 975
10 votes
4 answers
1k views

How to make emacs align and indent a bibtex entry?

I want bibtex-mode to align and properly indent fields. I copied a bibtex entry for the following article into Emacs: (Article source here) But, with a simple paste, the alignment is lost in Emacs ...
Viesturs's user avatar
  • 755
1 vote
0 answers
316 views

Help Aligning a Pattern with `align-regexp`

How can I use M-x align-regexp to align by // All ; after // All , within [] after // For example: With text: Line 1 ; B // Comment 1 [11, 22] ; Comment 2 [3333, 4] Line 2 C // Comment 3 [3, 55] ...
George's user avatar
  • 869
1 vote
1 answer
501 views

emacs align-regexp

I'm looking for a way in emacs to format a code like this: // param1, param2, param3, param4 foo(9, 8, "bar", 3) to this: // param1, param2, param3, param4 foo(9, 8, "bar", 3) I guess ...
dlgd's user avatar
  • 13
4 votes
0 answers
177 views

Prettify symbols without screwing up alignment

Is there a way to prettify symbols without running into alignment issues? E.g. replacing not with ¬is visually pleasing, but screws up code alignment, b/c not is 3 chars while ¬ is one char. Since ...
Tianxiang Xiong's user avatar
0 votes
1 answer
40 views

Shift text after cursor to specified column

If I have a line like: vec3 pos; // May not be defined. And I want to shift the comment to a specific column number, say 27, such that I get: vec3 pos; // May not be defined. Is ...
holocronweaver's user avatar
2 votes
0 answers
62 views

Can align-current handle aligning a varying number of columns?

I'm attempting to write a rule for align-current for Robot Framework tests. Columns are delimited by multiple spaces in a row (I know, what an awful choice) and each row can have a varying number of ...
dshepherd's user avatar
  • 1,281
0 votes
1 answer
245 views

how to get web-mode to ignore alignment in favor of indentation during method chaining?

when I write code (Javascript, specifically) in a web-mode buffer which chains methods across newlines: object.foo() .bar() web-mode seems to want to align it like this: object.foo() .bar()// ...
Dan O's user avatar
  • 151
3 votes
0 answers
1k views

The org-mode table alignment issue in right-to-left languages

I really enjoy writing bidirectional text in org-mode using Emacs as it supports the rt-to-left direction out of the box. However, when it comes to org tables alignment things become very unorganized. ...
doctorate's user avatar
  • 1,759