MCPcopy Create free account
hub / github.com/NanoMichael/MicroTeX / parseAlign

Method parseAlign

src/atom/atom_impl.cpp:829–871  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

827/*************************************** multicolumn atoms ****************************************/
828
829int MulticolumnAtom::parseAlign(const string& str) {
830 int pos = 0;
831 int len = str.length();
832 int align = ALIGN_CENTER;
833 bool first = true;
834 while (pos < len) {
835 char c = str[pos];
836 switch (c) {
837 case 'l': {
838 align = ALIGN_LEFT;
839 first = false;
840 } break;
841 case 'r': {
842 align = ALIGN_RIGHT;
843 first = false;
844 } break;
845 case 'c': {
846 align = ALIGN_CENTER;
847 first = false;
848 } break;
849 case '|': {
850 if (first)
851 _beforeVlines = 1;
852 else
853 _afterVlines = 1;
854 while (++pos < len) {
855 c = str[pos];
856 if (c != '|') {
857 pos--;
858 break;
859 } else {
860 if (first)
861 _beforeVlines++;
862 else
863 _afterVlines++;
864 }
865 }
866 } break;
867 }
868 pos++;
869 }
870 return align;
871}
872
873sptr<Box> MulticolumnAtom::createBox(_out_ TeXEnvironment& env) {
874 sptr<Box> b;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected