This is what I've cobbled together but the right brace shouldn't contain the underbrace. They should look like siblings, so to speak. Is there a way of doing that?
\(
\left.
\underbrace{
\left[
\begin{matrix}
a_{11} & a_{12} & a_{13} & \cdots & a_{1n} \\
a_{21} & a_{22} & a_{23} & \cdots & a_{2n} \\
a_{31} & a_{32} & a_{33} & \cdots & a_{3n} \\
\vdots & \vdots & \vdots & & \vdots \\
a_{m1} & a_{m2} & a_{m3} & \cdots & a_{mn}
\end{matrix}
\right]
}_{\text{ n columns}}
\right\} \text{m rows}
\)
Here is a complete hack to get this for you.
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/MathJax.js?config=TeX-AMS_HTML"></script>
\(
\kern .4em
\underbrace{
\kern-.4em
\left.
\left[
\begin{matrix}
a_{11} & a_{12} & a_{13} & \cdots & a_{1n} \\
a_{21} & a_{22} & a_{23} & \cdots & a_{2n} \\
a_{31} & a_{32} & a_{33} & \cdots & a_{3n} \\
\vdots & \vdots & \vdots & & \vdots \\
a_{m1} & a_{m2} & a_{m3} & \cdots & a_{mn}
\end{matrix}
\right]
\right\} m\text{ rows}
\Rule{0em}{0em}{3.6em}
\kern -4.5em
}_{\textstyle n \text{ columns}}
\kern 4.5em
\)
The kerning has to be worked out by hand. If you are planning to use this in actual LaTeX, the \Rule is non-standard, and would have to be replaced by a corresponding \rule. Or it could be left out entirely (as it is only for a little space between the matrix and the underbrace).
Related
I am getting application-defined error 1004 for the formula where I am trying to find the cells with only public email ids such as gmail yahoo etc. I replaced # with # previously.
Dim n As String
n = vbNullString
ActiveCell.Formula = "=IF(LEN(G2)-LEN(SUBSTITUTE(G2," & "#" & "," & n & "))=LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(G2," & "#gmail.com" & "," & "^" & ")," & "#yahoo.com" & "," & "^" & ")," & "#yahoo.co.in" & "," & "^" & ")," & "#rediffmail.com" & "," & "^" & ")," & "#hotmail.com" & "," & "^" & "))-LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(G2," & "#gmail.com" & "," & "^" & ")," & "#yahoo.com" & "," & "^" & ")," & "#yahoo.co.in" & "," & "^" & ")," & "#rediffmail.com" & "," & "^" & ")," & "#hotmail.com" & "," & "^" & ")," & "^" & "," & "))," & "All Public recipients" & "," & "OK" & ")"
I am writing a to a txt file and the first character in the first line, when I view the file in notepad is a double quote. If I examine the variables that get written out when the code is running, the double quote is not there. Any ideas what might be wrong? Here is my code snippet:
mydata1 = "!TRNS" & vbTab & vbTab & "TRNSID" & vbTab & "TRNSTYPE" & vbTab &
"DATE" & vbTab & "ACCNT" & vbTab & "CLASS" & vbTab & "AMOUNT" & vbTab &
"DOCNUM" & vbTab & "MEMO" & vbCrLf
mydata1 = mydata1 & "!SPL" & vbTab & "SPLID" & vbTab & "TRNSTYPE" & vbTab &
"DATE" & vbTab & "ACCNT" & vbTab & "CLASS" & vbTab & "AMOUNT" & vbTab &
"DOCNUM" & vbTab & "MEMO" & vbCrLf
mydata1 = mydata1 & "!ENDTRNS" & vbTab & vbTab & vbTab & vbTab & vbTab &
vbTab & vbTab & vbTab & vbCrLf
mydata1 = mydata1 & "TRNS" & vbTab & "GENERAL JOURNAL" & vbTab & myDate &
vbTab & "ACCOUNTS REC-CORP OFFICE" & vbTab & "CORPORATE OFFICE" & vbTab &
mytot & vbTab & myDate & vbTab & vbCrLf
mydata1 = mydata1 & mydata2
file = "d:\junk\todd\tester.txt"
Open myfile For Output As #1
Write #1, mydata1
Close #1
You can use below syntax and see if it works for you:
Print #1, mydata1
BTW, the variable myfile and file do not match in your code.
I'm trying to create a vba code to write a formula in determined cell on my sheet, but it doesn't work. What's wrong ? 'Cause, i really don't see what am i doing wrong in this code.
Range("BC" & ActiveCell.Row).Formula = "=IF($BB" & ActiveCell.Row & "=" & """" & "REVIEW" & """" & ";IF(ROW($BB" & ActiveCell.Row & ")<MAX(IF($BB:$BB=" & """" & "OK" & """" & ";$A:$A));IF(TODAY()-$AY" & ActiveCell.Row & ">=3;" & """" & "DROP" & """" & ";" & """" & "REVIEW" & """" & ");" & """" & "REVIEW" & """" & ");" & """" & """" & ")"
Your computer's use of a ; as the regional list separator is fouling you up. VBA is very EN-US-centric so the Range.Formula and Range.FormulaR1C1 expect a comma (,) as the function's argument list separator.
Range("BC" & ActiveCell.Row).Formula = "=IF($BB" & ActiveCell.Row & "=" & """" & "REVIEW" & """" & ", IF(ROW($BB" & ActiveCell.Row & ")<MAX(IF($BB:$BB=" & """" & "OK" & """" & ", $A:$A)), IF(TODAY()-$AY" & ActiveCell.Row & ">=3, " & """" & "DROP" & """" & ", " & """" & "REVIEW" & """" & "), " & """" & "REVIEW" & """" & "), " & """" & """" & ")"
Alternately, Range.FormulaLocal property or Range.FormulaR1C1Local property can be used with your own semi-colon as the list separator.
Range("BC" & ActiveCell.Row).FormulaLocal = "=IF($BB" & ActiveCell.Row & "=" & """" & "REVIEW" & """" & ";IF(ROW($BB" & ActiveCell.Row & ")<MAX(IF($BB:$BB=" & """" & "OK" & """" & ";$A:$A));IF(TODAY()-$AY" & ActiveCell.Row & ">=3;" & """" & "DROP" & """" & ";" & """" & "REVIEW" & """" & ");" & """" & "REVIEW" & """" & ");" & """" & """" & ")"
Your doubling up double quotes within a quoted string is a bit verbose and xlR1C1 notation would save some steps. TEXT(,) is the same as "" in a formula; each produces the same zero-length string.
Range("BC" & ActiveCell.Row).Formula = "=IF($BB" & ActiveCell.Row & "=""REVIEW"", IF(ROW($BB" & ActiveCell.Row & ")<MAX(IF($BB:$BB=""OK"", $A:$A)), IF(TODAY()-$AY" & ActiveCell.Row & ">=3, ""DROP"", ""REVIEW""), ""REVIEW""), TEXT(,))"
'.FormulaR1C1
Range("BC" & ActiveCell.Row).FormulaR1C1 = "=IF(RC54=""REVIEW"", IF(ROW(R:R)<MAX(IF(C54:C54=""OK"", C1:C1)), IF(TODAY()-RC51>=3, ""DROP"", ""REVIEW""), ""REVIEW""), TEXT(,))"
The xlA1 and xlR1C1 formula rewrites above each produce the following when ActiveCell is on the second row.
=IF($BB2="REVIEW", IF(ROW($BB2)<MAX(IF($BB:$BB="OK", $A:$A)), IF(TODAY()-$AY2>=3, "DROP", "REVIEW"), "REVIEW"), TEXT(,))
As I mentioned in comments above, that formula would seem to be an array formula. In that case, use the .Formula comma based rewrite but change the Range.Formula property to Range.FormulaArray.
I have been batling this suposedly simple problem for 2 hours now and I just cant figure it out. I am trying to make a link and no matter how many " marks I try it always ends up in error or the link says & Poracun(Z).Ime & Can anyone find me a way that I can change the link name ?
Here is my code:
Cells(i, "B").Formula = "=HYPERLINK(""[" & ActiveWorkbook.Path & "\" & "DN_Pokalkulacija.xlsx" & "]" & "'" & "Sheet1" & "'" & "!E" & Poracun(Z).Vrstica & ""","" & Poracun(Z).Ime & "")"
Two issues:
Your " delimiting is not quite right
Formula expects ' around the file name, not the sheet. Like '[FileName]SheetName'!
Try
Cells(5, "B").Formula = "=HYPERLINK('[" & ActiveWorkbook.Path & "\" & "DN_Pokalkulacija.xlsx" & "]" & "Sheet1" & "'" & "!E" & Poracun(Z).Vrstica & ",""" & Poracun(Z).Ime & """)"
I have figured it out , it was quotation problem, i forgot all about it and now i have read up on it inside quotation string you need to make double quotation to use as single in final string. Here is a working link :
g = "=HYPERLINK(""[" & ActiveWorkbook.Path & "\" & "DN_Pokalkulacija.xlsx" & "]" & "'" & "Sheet1" & "'" & "!E" & Poracun(Z).Vrstica & """,""" & Poracun(Z).Ime & """)"
It was all in quotation (") marks :)
I’m trying to format tables in LaTeX nicely using the Tabular command, and frequently I’ll want to right-align the leftmost column, then left align everything else. Using :'<,'>Tabularize /&/r1c1l0 almost works, but only on the first column pair; the rest of the table is weirdly aligned almost as if Tabular is repeating that sequence.
How can I write a command that will align the table code without me having to type something like :'<,'>Tabularize /&/r1c1l0c1l0c1l0…?
EDIT: Example table code
\begin{longtable}{>{\bfseries}l >{\scshape}Fl -l -l -l -l -l -l -l -l -l -l}
\toprule
Case & & \SetRowStyle{\scshape} nil & 1sg & 2sg & 3sg & 1du;inc & 2du & 1pl;inc & 1pl;exc & 2pl & 3pl \\
\midrule\endhead
\multirow{4}{*}{Focal} & nat & -a & -ai & -uta & -ima & -iva & -etua & -isa & -ečé & -atá & -amia \\
& sgv & -ena & -enai & -enta & -enima & -eniva & -entua & -enisa & -enčé & -entá & -emia \\
& du & -eva & -evai & -evta & -evima & -eviva & -evtua & -evisa & -evčé & -evtá & -evmia \\
& pl & -esa & -esai & -esta & -esima & -esiva & -estua & -esisa & -esčé & -está & -esmia \\
\midrule
\multirow{4}{*}{Nominative} & nat & -am & -aim & -utam & -imam & -ium & -etum & -isam & -ečem & -atám & -amim \\
& sgv & -enam & -enaim & -entam & -enimam & -enium & -entum & -ensim & -enčem & -entám & -emim \\
& du & -evam & -evaim & -evtam & -evimam & -evium & -evtum & -evsim & -evčem & -evtám & -evmim \\
& pl & -esam & -esaim & -estam & -esimam & -esium & -estum & -essim & -esčem & -estám & -esmim \\
\midrule
\multirow{4}{*}{Absolutive} & nat & -aš & -aiš & -utaš & -imaš & -iuš & -etuš & -isaš & -ečeš & -atáš & -amiš \\
& sgv & -enaš & -enaiš & -entaš & -enimaš & -eniuš & -entuš & -ensiš & -enčeš & -entáš & -emiš \\
& du & -evaš & -evaiš & -evtaš & -evimaš & -eviuš & -evtuš & -evsiš & -evčeš & -evtáš & -evmiš \\
& pl & -esaš & -esaiš & -estaš & -esimaš & -esiuš & -estuš & -essiš & -esčeš & -estáš & -esmiš \\
\bottomrule
\caption{Consonant-final animate noun suffixes\label{tab:nst_animate_consonant_stem_suffixes}}
\end{longtable}
It compiles just fine but I’d like the source code to be formatted somewhat nicer.
You may find vim-easy-align useful.
Try
:'<,'>EasyAlign&mrl*
which is a shorthand notation for
:'<,'>EasyAlign & { 'mode_sequence': 'rl*' }
& tells the plugin to align text using predefined & rule for LaTeX tables
rl* means right, left, left, left, ...
You can adjust left and right margin around the delimiter as follows:
:'<,'>EasyAlign&mrl*l0r1
a shorthand notation for
:'<,'>EasyAlign & { 'mode_sequence': 'rl*', 'left_margin': 0, 'right_margin': 1 }